From 12e2c15e8ca4911355b016c5c49d13a378ac8fb4 Mon Sep 17 00:00:00 2001 From: Cameron Koegel Date: Mon, 26 Sep 2022 13:32:44 -0400 Subject: [PATCH 01/30] OpenAPI Generator SDK Feature Branch --- .gitignore | 40 +- .gitlab-ci.yml | 26 + .openapi-generator-ignore | 23 + .openapi-generator/FILES | 319 + .openapi-generator/VERSION | 1 + .rspec | 2 + .rubocop.yml | 182 +- .travis.yml | 14 + Gemfile | 16 +- README.md | 348 +- Rakefile | 23 +- bandwidth-sdk.gemspec | 39 + bandwidth.gemspec | 25 - bandwidth.yml | 5798 +++++++++++++++++ docs/AccountStatistics.md | 20 + docs/AnswerCallback.md | 44 + docs/BridgeCompleteCallback.md | 48 + docs/BridgeTargetCompleteCallback.md | 42 + docs/CallDirectionEnum.md | 15 + docs/CallRecordingMetadata.md | 52 + docs/CallState.md | 52 + docs/CallStateEnum.md | 15 + docs/CallbackMethodEnum.md | 15 + docs/CallsApi.md | 304 + docs/CodeRequest.md | 28 + docs/Conference.md | 32 + docs/ConferenceCompletedCallback.md | 26 + docs/ConferenceCreatedCallback.md | 26 + docs/ConferenceMember.md | 28 + docs/ConferenceMemberExitCallback.md | 32 + docs/ConferenceMemberJoinCallback.md | 32 + docs/ConferenceRecordingAvailableCallback.md | 44 + docs/ConferenceRecordingMetadata.md | 38 + docs/ConferenceRedirectCallback.md | 26 + docs/ConferenceStateEnum.md | 15 + docs/ConferencesApi.md | 688 ++ docs/CreateCall.md | 54 + docs/CreateCallResponse.md | 58 + docs/CreateLookupResponse.md | 20 + docs/CreateMessageRequestError.md | 22 + docs/CreateParticipantRequest.md | 24 + docs/CreateParticipantResponse.md | 20 + docs/DeferredResult.md | 20 + docs/DeviceApiVersionEnum.md | 15 + docs/DisconenctCallback.md | 50 + docs/Diversion.md | 30 + docs/DtmfCallback.md | 50 + docs/FieldError.md | 20 + docs/FileFormatEnum.md | 15 + docs/ForbiddenRequest.md | 18 + docs/GatherCallback.md | 52 + docs/InitiateCallback.md | 40 + docs/ListMessageDirectionEnum.md | 15 + docs/ListMessageItem.md | 48 + docs/LookupRequest.md | 18 + docs/LookupResult.md | 34 + docs/LookupStatus.md | 24 + docs/LookupStatusEnum.md | 15 + docs/MFAApi.md | 226 + docs/MachineDetectionCompleteCallback.md | 44 + docs/MachineDetectionConfiguration.md | 46 + docs/MachineDetectionModeEnum.md | 15 + docs/Media.md | 22 + docs/MediaApi.md | 307 + docs/Message.md | 40 + docs/MessageDirectionEnum.md | 15 + docs/MessageRequest.md | 32 + docs/MessageStatusEnum.md | 15 + docs/MessageTypeEnum.md | 15 + docs/MessagesApi.md | 179 + docs/MessagesList.md | 22 + docs/MessagingCodeResponse.md | 18 + docs/MessagingRequestError.md | 20 + docs/MfaForbiddenRequestError.md | 18 + docs/MfaRequestError.md | 20 + docs/MfaUnauthorizedRequestError.md | 18 + docs/PageInfo.md | 24 + docs/Participant.md | 30 + docs/ParticipantSubscription.md | 20 + docs/ParticipantsApi.md | 227 + docs/PhoneNumberLookupApi.md | 153 + docs/PriorityEnum.md | 15 + docs/PublishPermissionsEnum.md | 15 + docs/RecordingAvailableCallback.md | 60 + docs/RecordingCompleteCallback.md | 60 + docs/RecordingStateEnum.md | 15 + docs/RecordingsApi.md | 758 +++ docs/RedirectCallback.md | 48 + docs/RedirectMethodEnum.md | 15 + docs/RequestError.md | 20 + docs/Session.md | 20 + docs/SessionsApi.md | 605 ++ docs/StatisticsApi.md | 78 + docs/StirShaken.md | 22 + docs/Subscriptions.md | 20 + docs/Tag.md | 20 + docs/TnLookupRequestError.md | 18 + docs/TranscribeRecording.md | 28 + docs/Transcription.md | 20 + docs/TranscriptionAvailableCallback.md | 58 + docs/TranscriptionList.md | 18 + docs/TranscriptionMetadata.md | 24 + docs/TransferAnswerCallback.md | 46 + docs/TransferCompleteCallback.md | 52 + docs/TransferDisconnectCallback.md | 56 + docs/UnauthorizedRequest.md | 18 + docs/UpdateCall.md | 36 + docs/UpdateCallRecording.md | 18 + docs/UpdateConference.md | 34 + docs/UpdateConferenceMember.md | 22 + docs/VerifyCodeRequest.md | 24 + docs/VerifyCodeResponse.md | 18 + docs/VoiceApiError.md | 22 + docs/VoiceCodeResponse.md | 18 + git_push.sh | 57 + lib/bandwidth-sdk.rb | 139 + lib/bandwidth-sdk/api/calls_api.rb | 325 + lib/bandwidth-sdk/api/conferences_api.rb | 717 ++ lib/bandwidth-sdk/api/media_api.rb | 312 + lib/bandwidth-sdk/api/messages_api.rb | 198 + lib/bandwidth-sdk/api/mfa_api.rb | 244 + lib/bandwidth-sdk/api/participants_api.rb | 230 + .../api/phone_number_lookup_api.rb | 165 + lib/bandwidth-sdk/api/recordings_api.rb | 782 +++ lib/bandwidth-sdk/api/sessions_api.rb | 613 ++ lib/bandwidth-sdk/api/statistics_api.rb | 85 + lib/bandwidth-sdk/api_client.rb | 425 ++ lib/bandwidth-sdk/api_error.rb | 57 + lib/bandwidth-sdk/configuration.rb | 612 ++ .../models/account_statistics.rb | 230 + lib/bandwidth-sdk/models/answer_callback.rb | 354 + .../models/bridge_complete_callback.rb | 375 ++ .../models/bridge_target_complete_callback.rb | 343 + lib/bandwidth-sdk/models/bxml/bxml.rb | 36 + lib/bandwidth-sdk/models/bxml/response.rb | 39 + lib/bandwidth-sdk/models/bxml/verbs/bridge.rb | 28 + .../models/bxml/verbs/conference.rb | 32 + .../models/bxml/verbs/forward.rb | 18 + lib/bandwidth-sdk/models/bxml/verbs/gather.rb | 49 + lib/bandwidth-sdk/models/bxml/verbs/hangup.rb | 14 + lib/bandwidth-sdk/models/bxml/verbs/pause.rb | 15 + .../models/bxml/verbs/pause_recording.rb | 14 + .../models/bxml/verbs/phone_number.rb | 24 + .../models/bxml/verbs/play_audio.rb | 17 + lib/bandwidth-sdk/models/bxml/verbs/record.rb | 33 + .../models/bxml/verbs/redirect.rb | 24 + .../models/bxml/verbs/resume_recording.rb | 14 + lib/bandwidth-sdk/models/bxml/verbs/ring.rb | 16 + .../models/bxml/verbs/send_dtmf.rb | 16 + .../models/bxml/verbs/sip_uri.rb | 25 + .../models/bxml/verbs/speak_sentence.rb | 18 + .../models/bxml/verbs/start_gather.rb | 20 + .../models/bxml/verbs/start_recording.rb | 25 + .../models}/bxml/verbs/start_stream.rb | 0 .../models/bxml/verbs/stop_gather.rb | 14 + .../models/bxml/verbs/stop_recording.rb | 14 + .../models/bxml/verbs/stop_stream.rb | 16 + .../models}/bxml/verbs/stream_param.rb | 0 lib/bandwidth-sdk/models/bxml/verbs/tag.rb | 13 + .../models/bxml/verbs/transfer.rb | 48 + .../models/bxml/verbs/xml_verb.rb | 26 + .../models/call_direction_enum.rb | 40 + .../models/call_recording_metadata.rb | 389 ++ lib/bandwidth-sdk/models/call_state.rb | 401 ++ lib/bandwidth-sdk/models/call_state_enum.rb | 40 + .../models/callback_method_enum.rb | 40 + lib/bandwidth-sdk/models/code_request.rb | 427 ++ lib/bandwidth-sdk/models/conference.rb | 298 + .../models/conference_completed_callback.rb | 262 + .../models/conference_created_callback.rb | 262 + lib/bandwidth-sdk/models/conference_member.rb | 273 + .../models/conference_member_exit_callback.rb | 292 + .../models/conference_member_join_callback.rb | 292 + ...conference_recording_available_callback.rb | 352 + .../models/conference_recording_metadata.rb | 320 + .../models/conference_redirect_callback.rb | 262 + .../models/conference_state_enum.rb | 40 + lib/bandwidth-sdk/models/create_call.rb | 629 ++ .../models/create_call_response.rb | 530 ++ .../models/create_lookup_response.rb | 230 + .../models/create_message_request_error.rb | 249 + .../models/create_participant_request.rb | 261 + .../models/create_participant_response.rb | 230 + lib/bandwidth-sdk/models/deferred_result.rb | 228 + .../models/device_api_version_enum.rb | 39 + .../models/disconenct_callback.rb | 385 ++ lib/bandwidth-sdk/models/diversion.rb | 280 + lib/bandwidth-sdk/models/dtmf_callback.rb | 383 ++ lib/bandwidth-sdk/models/field_error.rb | 230 + lib/bandwidth-sdk/models/file_format_enum.rb | 40 + lib/bandwidth-sdk/models/forbidden_request.rb | 220 + lib/bandwidth-sdk/models/gather_callback.rb | 393 ++ lib/bandwidth-sdk/models/initiate_callback.rb | 328 + .../models/list_message_direction_enum.rb | 40 + lib/bandwidth-sdk/models/list_message_item.rb | 372 ++ lib/bandwidth-sdk/models/lookup_request.rb | 227 + lib/bandwidth-sdk/models/lookup_result.rb | 301 + lib/bandwidth-sdk/models/lookup_status.rb | 254 + .../models/lookup_status_enum.rb | 42 + .../machine_detection_complete_callback.rb | 354 + .../models/machine_detection_configuration.rb | 478 ++ .../models/machine_detection_mode_enum.rb | 40 + lib/bandwidth-sdk/models/media.rb | 237 + lib/bandwidth-sdk/models/message.rb | 344 + .../models/message_direction_enum.rb | 40 + lib/bandwidth-sdk/models/message_request.rb | 333 + .../models/message_status_enum.rb | 46 + lib/bandwidth-sdk/models/message_type_enum.rb | 40 + lib/bandwidth-sdk/models/messages_list.rb | 240 + .../models/messaging_code_response.rb | 220 + .../models/messaging_request_error.rb | 238 + .../models/mfa_forbidden_request_error.rb | 220 + lib/bandwidth-sdk/models/mfa_request_error.rb | 230 + .../models/mfa_unauthorized_request_error.rb | 220 + lib/bandwidth-sdk/models/page_info.rb | 250 + lib/bandwidth-sdk/models/participant.rb | 292 + .../models/participant_subscription.rb | 243 + lib/bandwidth-sdk/models/priority_enum.rb | 40 + .../models/publish_permissions_enum.rb | 40 + .../models/recording_available_callback.rb | 432 ++ .../models/recording_complete_callback.rb | 433 ++ .../models/recording_state_enum.rb | 40 + lib/bandwidth-sdk/models/redirect_callback.rb | 373 ++ .../models/redirect_method_enum.rb | 40 + lib/bandwidth-sdk/models/request_error.rb | 230 + lib/bandwidth-sdk/models/session.rb | 231 + lib/bandwidth-sdk/models/stir_shaken.rb | 240 + lib/bandwidth-sdk/models/subscriptions.rb | 232 + lib/bandwidth-sdk/models/tag.rb | 228 + .../models/tn_lookup_request_error.rb | 220 + .../models/transcribe_recording.rb | 332 + lib/bandwidth-sdk/models/transcription.rb | 230 + .../transcription_available_callback.rb | 421 ++ .../models/transcription_list.rb | 221 + .../models/transcription_metadata.rb | 251 + .../models/transfer_answer_callback.rb | 363 ++ .../models/transfer_complete_callback.rb | 395 ++ .../models/transfer_disconnect_callback.rb | 415 ++ .../models/unauthorized_request.rb | 220 + lib/bandwidth-sdk/models/update_call.rb | 389 ++ .../models/update_call_recording.rb | 224 + lib/bandwidth-sdk/models/update_conference.rb | 372 ++ .../models/update_conference_member.rb | 243 + .../models/verify_code_request.rb | 342 + .../models/verify_code_response.rb | 220 + lib/bandwidth-sdk/models/voice_api_error.rb | 238 + .../models/voice_code_response.rb | 220 + lib/bandwidth-sdk/version.rb | 15 + openapi-config.yml | 11 + openapitools.json | 7 + ruby-notes.md | 71 + spec/api/calls_api_spec.rb | 89 + spec/api/conferences_api_spec.rb | 163 + spec/api/media_api_spec.rb | 90 + spec/api/messages_api_spec.rb | 73 + spec/api/mfa_api_spec.rb | 74 + spec/api/participants_api_spec.rb | 74 + spec/api/phone_number_lookup_api_spec.rb | 61 + spec/api/recordings_api_spec.rb | 177 + spec/api/sessions_api_spec.rb | 145 + spec/api/statistics_api_spec.rb | 47 + spec/api_client_spec.rb | 188 + spec/configuration_spec.rb | 42 + spec/models/account_statistics_spec.rb | 40 + spec/models/answer_callback_spec.rb | 112 + spec/models/bridge_complete_callback_spec.rb | 124 + .../bridge_target_complete_callback_spec.rb | 106 + spec/models/call_direction_enum_spec.rb | 28 + spec/models/call_recording_metadata_spec.rb | 136 + spec/models/call_state_enum_spec.rb | 28 + spec/models/call_state_spec.rb | 136 + spec/models/callback_method_enum_spec.rb | 28 + spec/models/code_request_spec.rb | 64 + .../conference_completed_callback_spec.rb | 58 + .../conference_created_callback_spec.rb | 58 + .../conference_member_exit_callback_spec.rb | 76 + .../conference_member_join_callback_spec.rb | 76 + spec/models/conference_member_spec.rb | 64 + ...rence_recording_available_callback_spec.rb | 112 + .../conference_recording_metadata_spec.rb | 94 + .../conference_redirect_callback_spec.rb | 58 + spec/models/conference_spec.rb | 76 + spec/models/conference_state_enum_spec.rb | 28 + spec/models/create_call_response_spec.rb | 154 + spec/models/create_call_spec.rb | 142 + spec/models/create_lookup_response_spec.rb | 40 + .../create_message_request_error_spec.rb | 46 + .../models/create_participant_request_spec.rb | 52 + .../create_participant_response_spec.rb | 40 + spec/models/deferred_result_spec.rb | 40 + spec/models/device_api_version_enum_spec.rb | 28 + spec/models/disconenct_callback_spec.rb | 130 + spec/models/diversion_spec.rb | 70 + spec/models/dtmf_callback_spec.rb | 130 + spec/models/field_error_spec.rb | 40 + spec/models/file_format_enum_spec.rb | 28 + spec/models/forbidden_request_spec.rb | 34 + spec/models/gather_callback_spec.rb | 136 + spec/models/initiate_callback_spec.rb | 100 + .../list_message_direction_enum_spec.rb | 28 + spec/models/list_message_item_spec.rb | 124 + spec/models/lookup_request_spec.rb | 34 + spec/models/lookup_result_spec.rb | 82 + spec/models/lookup_status_enum_spec.rb | 28 + spec/models/lookup_status_spec.rb | 52 + ...achine_detection_complete_callback_spec.rb | 112 + .../machine_detection_configuration_spec.rb | 118 + .../machine_detection_mode_enum_spec.rb | 28 + spec/models/media_spec.rb | 46 + spec/models/message_direction_enum_spec.rb | 28 + spec/models/message_request_spec.rb | 76 + spec/models/message_spec.rb | 100 + spec/models/message_status_enum_spec.rb | 28 + spec/models/message_type_enum_spec.rb | 28 + spec/models/messages_list_spec.rb | 46 + spec/models/messaging_code_response_spec.rb | 34 + spec/models/messaging_request_error_spec.rb | 40 + .../mfa_forbidden_request_error_spec.rb | 34 + spec/models/mfa_request_error_spec.rb | 40 + .../mfa_unauthorized_request_error_spec.rb | 34 + spec/models/page_info_spec.rb | 52 + spec/models/participant_spec.rb | 70 + spec/models/participant_subscription_spec.rb | 40 + spec/models/priority_enum_spec.rb | 28 + spec/models/publish_permissions_enum_spec.rb | 28 + .../recording_available_callback_spec.rb | 160 + .../recording_complete_callback_spec.rb | 160 + spec/models/recording_state_enum_spec.rb | 28 + spec/models/redirect_callback_spec.rb | 124 + spec/models/redirect_method_enum_spec.rb | 28 + spec/models/request_error_spec.rb | 40 + spec/models/session_spec.rb | 40 + spec/models/stir_shaken_spec.rb | 46 + spec/models/subscriptions_spec.rb | 40 + spec/models/tag_spec.rb | 40 + spec/models/tn_lookup_request_error_spec.rb | 34 + spec/models/transcribe_recording_spec.rb | 64 + .../transcription_available_callback_spec.rb | 154 + spec/models/transcription_list_spec.rb | 34 + spec/models/transcription_metadata_spec.rb | 52 + spec/models/transcription_spec.rb | 40 + spec/models/transfer_answer_callback_spec.rb | 118 + .../models/transfer_complete_callback_spec.rb | 136 + .../transfer_disconnect_callback_spec.rb | 148 + spec/models/unauthorized_request_spec.rb | 34 + spec/models/update_call_recording_spec.rb | 34 + spec/models/update_call_spec.rb | 88 + spec/models/update_conference_member_spec.rb | 46 + spec/models/update_conference_spec.rb | 82 + spec/models/verify_code_request_spec.rb | 52 + spec/models/verify_code_response_spec.rb | 34 + spec/models/voice_api_error_spec.rb | 46 + spec/models/voice_code_response_spec.rb | 34 + spec/spec_helper.rb | 111 + spec/test.rb | 453 ++ test/integration/test_integration.rb | 760 --- 356 files changed, 49332 insertions(+), 984 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION create mode 100644 .rspec create mode 100644 .travis.yml create mode 100644 bandwidth-sdk.gemspec delete mode 100644 bandwidth.gemspec create mode 100644 bandwidth.yml create mode 100644 docs/AccountStatistics.md create mode 100644 docs/AnswerCallback.md create mode 100644 docs/BridgeCompleteCallback.md create mode 100644 docs/BridgeTargetCompleteCallback.md create mode 100644 docs/CallDirectionEnum.md create mode 100644 docs/CallRecordingMetadata.md create mode 100644 docs/CallState.md create mode 100644 docs/CallStateEnum.md create mode 100644 docs/CallbackMethodEnum.md create mode 100644 docs/CallsApi.md create mode 100644 docs/CodeRequest.md create mode 100644 docs/Conference.md create mode 100644 docs/ConferenceCompletedCallback.md create mode 100644 docs/ConferenceCreatedCallback.md create mode 100644 docs/ConferenceMember.md create mode 100644 docs/ConferenceMemberExitCallback.md create mode 100644 docs/ConferenceMemberJoinCallback.md create mode 100644 docs/ConferenceRecordingAvailableCallback.md create mode 100644 docs/ConferenceRecordingMetadata.md create mode 100644 docs/ConferenceRedirectCallback.md create mode 100644 docs/ConferenceStateEnum.md create mode 100644 docs/ConferencesApi.md create mode 100644 docs/CreateCall.md create mode 100644 docs/CreateCallResponse.md create mode 100644 docs/CreateLookupResponse.md create mode 100644 docs/CreateMessageRequestError.md create mode 100644 docs/CreateParticipantRequest.md create mode 100644 docs/CreateParticipantResponse.md create mode 100644 docs/DeferredResult.md create mode 100644 docs/DeviceApiVersionEnum.md create mode 100644 docs/DisconenctCallback.md create mode 100644 docs/Diversion.md create mode 100644 docs/DtmfCallback.md create mode 100644 docs/FieldError.md create mode 100644 docs/FileFormatEnum.md create mode 100644 docs/ForbiddenRequest.md create mode 100644 docs/GatherCallback.md create mode 100644 docs/InitiateCallback.md create mode 100644 docs/ListMessageDirectionEnum.md create mode 100644 docs/ListMessageItem.md create mode 100644 docs/LookupRequest.md create mode 100644 docs/LookupResult.md create mode 100644 docs/LookupStatus.md create mode 100644 docs/LookupStatusEnum.md create mode 100644 docs/MFAApi.md create mode 100644 docs/MachineDetectionCompleteCallback.md create mode 100644 docs/MachineDetectionConfiguration.md create mode 100644 docs/MachineDetectionModeEnum.md create mode 100644 docs/Media.md create mode 100644 docs/MediaApi.md create mode 100644 docs/Message.md create mode 100644 docs/MessageDirectionEnum.md create mode 100644 docs/MessageRequest.md create mode 100644 docs/MessageStatusEnum.md create mode 100644 docs/MessageTypeEnum.md create mode 100644 docs/MessagesApi.md create mode 100644 docs/MessagesList.md create mode 100644 docs/MessagingCodeResponse.md create mode 100644 docs/MessagingRequestError.md create mode 100644 docs/MfaForbiddenRequestError.md create mode 100644 docs/MfaRequestError.md create mode 100644 docs/MfaUnauthorizedRequestError.md create mode 100644 docs/PageInfo.md create mode 100644 docs/Participant.md create mode 100644 docs/ParticipantSubscription.md create mode 100644 docs/ParticipantsApi.md create mode 100644 docs/PhoneNumberLookupApi.md create mode 100644 docs/PriorityEnum.md create mode 100644 docs/PublishPermissionsEnum.md create mode 100644 docs/RecordingAvailableCallback.md create mode 100644 docs/RecordingCompleteCallback.md create mode 100644 docs/RecordingStateEnum.md create mode 100644 docs/RecordingsApi.md create mode 100644 docs/RedirectCallback.md create mode 100644 docs/RedirectMethodEnum.md create mode 100644 docs/RequestError.md create mode 100644 docs/Session.md create mode 100644 docs/SessionsApi.md create mode 100644 docs/StatisticsApi.md create mode 100644 docs/StirShaken.md create mode 100644 docs/Subscriptions.md create mode 100644 docs/Tag.md create mode 100644 docs/TnLookupRequestError.md create mode 100644 docs/TranscribeRecording.md create mode 100644 docs/Transcription.md create mode 100644 docs/TranscriptionAvailableCallback.md create mode 100644 docs/TranscriptionList.md create mode 100644 docs/TranscriptionMetadata.md create mode 100644 docs/TransferAnswerCallback.md create mode 100644 docs/TransferCompleteCallback.md create mode 100644 docs/TransferDisconnectCallback.md create mode 100644 docs/UnauthorizedRequest.md create mode 100644 docs/UpdateCall.md create mode 100644 docs/UpdateCallRecording.md create mode 100644 docs/UpdateConference.md create mode 100644 docs/UpdateConferenceMember.md create mode 100644 docs/VerifyCodeRequest.md create mode 100644 docs/VerifyCodeResponse.md create mode 100644 docs/VoiceApiError.md create mode 100644 docs/VoiceCodeResponse.md create mode 100644 git_push.sh create mode 100644 lib/bandwidth-sdk.rb create mode 100644 lib/bandwidth-sdk/api/calls_api.rb create mode 100644 lib/bandwidth-sdk/api/conferences_api.rb create mode 100644 lib/bandwidth-sdk/api/media_api.rb create mode 100644 lib/bandwidth-sdk/api/messages_api.rb create mode 100644 lib/bandwidth-sdk/api/mfa_api.rb create mode 100644 lib/bandwidth-sdk/api/participants_api.rb create mode 100644 lib/bandwidth-sdk/api/phone_number_lookup_api.rb create mode 100644 lib/bandwidth-sdk/api/recordings_api.rb create mode 100644 lib/bandwidth-sdk/api/sessions_api.rb create mode 100644 lib/bandwidth-sdk/api/statistics_api.rb create mode 100644 lib/bandwidth-sdk/api_client.rb create mode 100644 lib/bandwidth-sdk/api_error.rb create mode 100644 lib/bandwidth-sdk/configuration.rb create mode 100644 lib/bandwidth-sdk/models/account_statistics.rb create mode 100644 lib/bandwidth-sdk/models/answer_callback.rb create mode 100644 lib/bandwidth-sdk/models/bridge_complete_callback.rb create mode 100644 lib/bandwidth-sdk/models/bridge_target_complete_callback.rb create mode 100644 lib/bandwidth-sdk/models/bxml/bxml.rb create mode 100644 lib/bandwidth-sdk/models/bxml/response.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/bridge.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/conference.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/forward.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/gather.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/hangup.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/pause.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/record.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/redirect.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/ring.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb rename lib/{bandwidth/voice_lib => bandwidth-sdk/models}/bxml/verbs/start_stream.rb (100%) create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb rename lib/{bandwidth/voice_lib => bandwidth-sdk/models}/bxml/verbs/stream_param.rb (100%) create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/tag.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/transfer.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/xml_verb.rb create mode 100644 lib/bandwidth-sdk/models/call_direction_enum.rb create mode 100644 lib/bandwidth-sdk/models/call_recording_metadata.rb create mode 100644 lib/bandwidth-sdk/models/call_state.rb create mode 100644 lib/bandwidth-sdk/models/call_state_enum.rb create mode 100644 lib/bandwidth-sdk/models/callback_method_enum.rb create mode 100644 lib/bandwidth-sdk/models/code_request.rb create mode 100644 lib/bandwidth-sdk/models/conference.rb create mode 100644 lib/bandwidth-sdk/models/conference_completed_callback.rb create mode 100644 lib/bandwidth-sdk/models/conference_created_callback.rb create mode 100644 lib/bandwidth-sdk/models/conference_member.rb create mode 100644 lib/bandwidth-sdk/models/conference_member_exit_callback.rb create mode 100644 lib/bandwidth-sdk/models/conference_member_join_callback.rb create mode 100644 lib/bandwidth-sdk/models/conference_recording_available_callback.rb create mode 100644 lib/bandwidth-sdk/models/conference_recording_metadata.rb create mode 100644 lib/bandwidth-sdk/models/conference_redirect_callback.rb create mode 100644 lib/bandwidth-sdk/models/conference_state_enum.rb create mode 100644 lib/bandwidth-sdk/models/create_call.rb create mode 100644 lib/bandwidth-sdk/models/create_call_response.rb create mode 100644 lib/bandwidth-sdk/models/create_lookup_response.rb create mode 100644 lib/bandwidth-sdk/models/create_message_request_error.rb create mode 100644 lib/bandwidth-sdk/models/create_participant_request.rb create mode 100644 lib/bandwidth-sdk/models/create_participant_response.rb create mode 100644 lib/bandwidth-sdk/models/deferred_result.rb create mode 100644 lib/bandwidth-sdk/models/device_api_version_enum.rb create mode 100644 lib/bandwidth-sdk/models/disconenct_callback.rb create mode 100644 lib/bandwidth-sdk/models/diversion.rb create mode 100644 lib/bandwidth-sdk/models/dtmf_callback.rb create mode 100644 lib/bandwidth-sdk/models/field_error.rb create mode 100644 lib/bandwidth-sdk/models/file_format_enum.rb create mode 100644 lib/bandwidth-sdk/models/forbidden_request.rb create mode 100644 lib/bandwidth-sdk/models/gather_callback.rb create mode 100644 lib/bandwidth-sdk/models/initiate_callback.rb create mode 100644 lib/bandwidth-sdk/models/list_message_direction_enum.rb create mode 100644 lib/bandwidth-sdk/models/list_message_item.rb create mode 100644 lib/bandwidth-sdk/models/lookup_request.rb create mode 100644 lib/bandwidth-sdk/models/lookup_result.rb create mode 100644 lib/bandwidth-sdk/models/lookup_status.rb create mode 100644 lib/bandwidth-sdk/models/lookup_status_enum.rb create mode 100644 lib/bandwidth-sdk/models/machine_detection_complete_callback.rb create mode 100644 lib/bandwidth-sdk/models/machine_detection_configuration.rb create mode 100644 lib/bandwidth-sdk/models/machine_detection_mode_enum.rb create mode 100644 lib/bandwidth-sdk/models/media.rb create mode 100644 lib/bandwidth-sdk/models/message.rb create mode 100644 lib/bandwidth-sdk/models/message_direction_enum.rb create mode 100644 lib/bandwidth-sdk/models/message_request.rb create mode 100644 lib/bandwidth-sdk/models/message_status_enum.rb create mode 100644 lib/bandwidth-sdk/models/message_type_enum.rb create mode 100644 lib/bandwidth-sdk/models/messages_list.rb create mode 100644 lib/bandwidth-sdk/models/messaging_code_response.rb create mode 100644 lib/bandwidth-sdk/models/messaging_request_error.rb create mode 100644 lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb create mode 100644 lib/bandwidth-sdk/models/mfa_request_error.rb create mode 100644 lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb create mode 100644 lib/bandwidth-sdk/models/page_info.rb create mode 100644 lib/bandwidth-sdk/models/participant.rb create mode 100644 lib/bandwidth-sdk/models/participant_subscription.rb create mode 100644 lib/bandwidth-sdk/models/priority_enum.rb create mode 100644 lib/bandwidth-sdk/models/publish_permissions_enum.rb create mode 100644 lib/bandwidth-sdk/models/recording_available_callback.rb create mode 100644 lib/bandwidth-sdk/models/recording_complete_callback.rb create mode 100644 lib/bandwidth-sdk/models/recording_state_enum.rb create mode 100644 lib/bandwidth-sdk/models/redirect_callback.rb create mode 100644 lib/bandwidth-sdk/models/redirect_method_enum.rb create mode 100644 lib/bandwidth-sdk/models/request_error.rb create mode 100644 lib/bandwidth-sdk/models/session.rb create mode 100644 lib/bandwidth-sdk/models/stir_shaken.rb create mode 100644 lib/bandwidth-sdk/models/subscriptions.rb create mode 100644 lib/bandwidth-sdk/models/tag.rb create mode 100644 lib/bandwidth-sdk/models/tn_lookup_request_error.rb create mode 100644 lib/bandwidth-sdk/models/transcribe_recording.rb create mode 100644 lib/bandwidth-sdk/models/transcription.rb create mode 100644 lib/bandwidth-sdk/models/transcription_available_callback.rb create mode 100644 lib/bandwidth-sdk/models/transcription_list.rb create mode 100644 lib/bandwidth-sdk/models/transcription_metadata.rb create mode 100644 lib/bandwidth-sdk/models/transfer_answer_callback.rb create mode 100644 lib/bandwidth-sdk/models/transfer_complete_callback.rb create mode 100644 lib/bandwidth-sdk/models/transfer_disconnect_callback.rb create mode 100644 lib/bandwidth-sdk/models/unauthorized_request.rb create mode 100644 lib/bandwidth-sdk/models/update_call.rb create mode 100644 lib/bandwidth-sdk/models/update_call_recording.rb create mode 100644 lib/bandwidth-sdk/models/update_conference.rb create mode 100644 lib/bandwidth-sdk/models/update_conference_member.rb create mode 100644 lib/bandwidth-sdk/models/verify_code_request.rb create mode 100644 lib/bandwidth-sdk/models/verify_code_response.rb create mode 100644 lib/bandwidth-sdk/models/voice_api_error.rb create mode 100644 lib/bandwidth-sdk/models/voice_code_response.rb create mode 100644 lib/bandwidth-sdk/version.rb create mode 100644 openapi-config.yml create mode 100644 openapitools.json create mode 100644 ruby-notes.md create mode 100644 spec/api/calls_api_spec.rb create mode 100644 spec/api/conferences_api_spec.rb create mode 100644 spec/api/media_api_spec.rb create mode 100644 spec/api/messages_api_spec.rb create mode 100644 spec/api/mfa_api_spec.rb create mode 100644 spec/api/participants_api_spec.rb create mode 100644 spec/api/phone_number_lookup_api_spec.rb create mode 100644 spec/api/recordings_api_spec.rb create mode 100644 spec/api/sessions_api_spec.rb create mode 100644 spec/api/statistics_api_spec.rb create mode 100644 spec/api_client_spec.rb create mode 100644 spec/configuration_spec.rb create mode 100644 spec/models/account_statistics_spec.rb create mode 100644 spec/models/answer_callback_spec.rb create mode 100644 spec/models/bridge_complete_callback_spec.rb create mode 100644 spec/models/bridge_target_complete_callback_spec.rb create mode 100644 spec/models/call_direction_enum_spec.rb create mode 100644 spec/models/call_recording_metadata_spec.rb create mode 100644 spec/models/call_state_enum_spec.rb create mode 100644 spec/models/call_state_spec.rb create mode 100644 spec/models/callback_method_enum_spec.rb create mode 100644 spec/models/code_request_spec.rb create mode 100644 spec/models/conference_completed_callback_spec.rb create mode 100644 spec/models/conference_created_callback_spec.rb create mode 100644 spec/models/conference_member_exit_callback_spec.rb create mode 100644 spec/models/conference_member_join_callback_spec.rb create mode 100644 spec/models/conference_member_spec.rb create mode 100644 spec/models/conference_recording_available_callback_spec.rb create mode 100644 spec/models/conference_recording_metadata_spec.rb create mode 100644 spec/models/conference_redirect_callback_spec.rb create mode 100644 spec/models/conference_spec.rb create mode 100644 spec/models/conference_state_enum_spec.rb create mode 100644 spec/models/create_call_response_spec.rb create mode 100644 spec/models/create_call_spec.rb create mode 100644 spec/models/create_lookup_response_spec.rb create mode 100644 spec/models/create_message_request_error_spec.rb create mode 100644 spec/models/create_participant_request_spec.rb create mode 100644 spec/models/create_participant_response_spec.rb create mode 100644 spec/models/deferred_result_spec.rb create mode 100644 spec/models/device_api_version_enum_spec.rb create mode 100644 spec/models/disconenct_callback_spec.rb create mode 100644 spec/models/diversion_spec.rb create mode 100644 spec/models/dtmf_callback_spec.rb create mode 100644 spec/models/field_error_spec.rb create mode 100644 spec/models/file_format_enum_spec.rb create mode 100644 spec/models/forbidden_request_spec.rb create mode 100644 spec/models/gather_callback_spec.rb create mode 100644 spec/models/initiate_callback_spec.rb create mode 100644 spec/models/list_message_direction_enum_spec.rb create mode 100644 spec/models/list_message_item_spec.rb create mode 100644 spec/models/lookup_request_spec.rb create mode 100644 spec/models/lookup_result_spec.rb create mode 100644 spec/models/lookup_status_enum_spec.rb create mode 100644 spec/models/lookup_status_spec.rb create mode 100644 spec/models/machine_detection_complete_callback_spec.rb create mode 100644 spec/models/machine_detection_configuration_spec.rb create mode 100644 spec/models/machine_detection_mode_enum_spec.rb create mode 100644 spec/models/media_spec.rb create mode 100644 spec/models/message_direction_enum_spec.rb create mode 100644 spec/models/message_request_spec.rb create mode 100644 spec/models/message_spec.rb create mode 100644 spec/models/message_status_enum_spec.rb create mode 100644 spec/models/message_type_enum_spec.rb create mode 100644 spec/models/messages_list_spec.rb create mode 100644 spec/models/messaging_code_response_spec.rb create mode 100644 spec/models/messaging_request_error_spec.rb create mode 100644 spec/models/mfa_forbidden_request_error_spec.rb create mode 100644 spec/models/mfa_request_error_spec.rb create mode 100644 spec/models/mfa_unauthorized_request_error_spec.rb create mode 100644 spec/models/page_info_spec.rb create mode 100644 spec/models/participant_spec.rb create mode 100644 spec/models/participant_subscription_spec.rb create mode 100644 spec/models/priority_enum_spec.rb create mode 100644 spec/models/publish_permissions_enum_spec.rb create mode 100644 spec/models/recording_available_callback_spec.rb create mode 100644 spec/models/recording_complete_callback_spec.rb create mode 100644 spec/models/recording_state_enum_spec.rb create mode 100644 spec/models/redirect_callback_spec.rb create mode 100644 spec/models/redirect_method_enum_spec.rb create mode 100644 spec/models/request_error_spec.rb create mode 100644 spec/models/session_spec.rb create mode 100644 spec/models/stir_shaken_spec.rb create mode 100644 spec/models/subscriptions_spec.rb create mode 100644 spec/models/tag_spec.rb create mode 100644 spec/models/tn_lookup_request_error_spec.rb create mode 100644 spec/models/transcribe_recording_spec.rb create mode 100644 spec/models/transcription_available_callback_spec.rb create mode 100644 spec/models/transcription_list_spec.rb create mode 100644 spec/models/transcription_metadata_spec.rb create mode 100644 spec/models/transcription_spec.rb create mode 100644 spec/models/transfer_answer_callback_spec.rb create mode 100644 spec/models/transfer_complete_callback_spec.rb create mode 100644 spec/models/transfer_disconnect_callback_spec.rb create mode 100644 spec/models/unauthorized_request_spec.rb create mode 100644 spec/models/update_call_recording_spec.rb create mode 100644 spec/models/update_call_spec.rb create mode 100644 spec/models/update_conference_member_spec.rb create mode 100644 spec/models/update_conference_spec.rb create mode 100644 spec/models/verify_code_request_spec.rb create mode 100644 spec/models/verify_code_response_spec.rb create mode 100644 spec/models/voice_api_error_spec.rb create mode 100644 spec/models/voice_code_response_spec.rb create mode 100644 spec/spec_helper.rb create mode 100644 spec/test.rb delete mode 100644 test/integration/test_integration.rb diff --git a/.gitignore b/.gitignore index eac0157b..9d8a5a13 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,39 @@ -Gemfile.lock +# Generated by: https://openapi-generator.tech +# + +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +## Specific to RubyMotion: +.dat* +.repl_history +build/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..3d57c5b3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,26 @@ +.ruby: &ruby + variables: + LANG: "C.UTF-8" + before_script: + - ruby -v + - bundle config set --local deployment true + - bundle install -j $(nproc) + parallel: + matrix: + - RUBY_VERSION: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0'] + image: "ruby:$RUBY_VERSION" + cache: + paths: + - vendor/ruby + key: 'ruby-$RUBY_VERSION' + +gem: + extends: .ruby + script: + - bundle exec rspec + - bundle exec rake build + - bundle exec rake install + artifacts: + paths: + - pkg/*.gem + diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 00000000..85b6cb4c --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,319 @@ +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.rspec +.rubocop.yml +.travis.yml +Gemfile +README.md +Rakefile +bandwidth-sdk.gemspec +docs/AccountStatistics.md +docs/AnswerCallback.md +docs/BridgeCompleteCallback.md +docs/BridgeTargetCompleteCallback.md +docs/CallDirectionEnum.md +docs/CallRecordingMetadata.md +docs/CallState.md +docs/CallStateEnum.md +docs/CallbackMethodEnum.md +docs/CallsApi.md +docs/CodeRequest.md +docs/Conference.md +docs/ConferenceCompletedCallback.md +docs/ConferenceCreatedCallback.md +docs/ConferenceMember.md +docs/ConferenceMemberExitCallback.md +docs/ConferenceMemberJoinCallback.md +docs/ConferenceRecordingAvailableCallback.md +docs/ConferenceRecordingMetadata.md +docs/ConferenceRedirectCallback.md +docs/ConferenceStateEnum.md +docs/ConferencesApi.md +docs/CreateCall.md +docs/CreateCallResponse.md +docs/CreateLookupResponse.md +docs/CreateMessageRequestError.md +docs/CreateParticipantRequest.md +docs/CreateParticipantResponse.md +docs/DeferredResult.md +docs/DeviceApiVersionEnum.md +docs/DisconenctCallback.md +docs/Diversion.md +docs/DtmfCallback.md +docs/FieldError.md +docs/FileFormatEnum.md +docs/ForbiddenRequest.md +docs/GatherCallback.md +docs/InitiateCallback.md +docs/ListMessageDirectionEnum.md +docs/ListMessageItem.md +docs/LookupRequest.md +docs/LookupResult.md +docs/LookupStatus.md +docs/LookupStatusEnum.md +docs/MFAApi.md +docs/MachineDetectionCompleteCallback.md +docs/MachineDetectionConfiguration.md +docs/MachineDetectionModeEnum.md +docs/Media.md +docs/MediaApi.md +docs/Message.md +docs/MessageDirectionEnum.md +docs/MessageRequest.md +docs/MessageStatusEnum.md +docs/MessageTypeEnum.md +docs/MessagesApi.md +docs/MessagesList.md +docs/MessagingCodeResponse.md +docs/MessagingRequestError.md +docs/MfaForbiddenRequestError.md +docs/MfaRequestError.md +docs/MfaUnauthorizedRequestError.md +docs/PageInfo.md +docs/Participant.md +docs/ParticipantSubscription.md +docs/ParticipantsApi.md +docs/PhoneNumberLookupApi.md +docs/PriorityEnum.md +docs/PublishPermissionsEnum.md +docs/RecordingAvailableCallback.md +docs/RecordingCompleteCallback.md +docs/RecordingStateEnum.md +docs/RecordingsApi.md +docs/RedirectCallback.md +docs/RedirectMethodEnum.md +docs/RequestError.md +docs/Session.md +docs/SessionsApi.md +docs/StatisticsApi.md +docs/StirShaken.md +docs/Subscriptions.md +docs/Tag.md +docs/TnLookupRequestError.md +docs/TranscribeRecording.md +docs/Transcription.md +docs/TranscriptionAvailableCallback.md +docs/TranscriptionList.md +docs/TranscriptionMetadata.md +docs/TransferAnswerCallback.md +docs/TransferCompleteCallback.md +docs/TransferDisconnectCallback.md +docs/UnauthorizedRequest.md +docs/UpdateCall.md +docs/UpdateCallRecording.md +docs/UpdateConference.md +docs/UpdateConferenceMember.md +docs/VerifyCodeRequest.md +docs/VerifyCodeResponse.md +docs/VoiceApiError.md +docs/VoiceCodeResponse.md +git_push.sh +lib/bandwidth-sdk.rb +lib/bandwidth-sdk/api/calls_api.rb +lib/bandwidth-sdk/api/conferences_api.rb +lib/bandwidth-sdk/api/media_api.rb +lib/bandwidth-sdk/api/messages_api.rb +lib/bandwidth-sdk/api/mfa_api.rb +lib/bandwidth-sdk/api/participants_api.rb +lib/bandwidth-sdk/api/phone_number_lookup_api.rb +lib/bandwidth-sdk/api/recordings_api.rb +lib/bandwidth-sdk/api/sessions_api.rb +lib/bandwidth-sdk/api/statistics_api.rb +lib/bandwidth-sdk/api_client.rb +lib/bandwidth-sdk/api_error.rb +lib/bandwidth-sdk/configuration.rb +lib/bandwidth-sdk/models/account_statistics.rb +lib/bandwidth-sdk/models/answer_callback.rb +lib/bandwidth-sdk/models/bridge_complete_callback.rb +lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +lib/bandwidth-sdk/models/call_direction_enum.rb +lib/bandwidth-sdk/models/call_recording_metadata.rb +lib/bandwidth-sdk/models/call_state.rb +lib/bandwidth-sdk/models/call_state_enum.rb +lib/bandwidth-sdk/models/callback_method_enum.rb +lib/bandwidth-sdk/models/code_request.rb +lib/bandwidth-sdk/models/conference.rb +lib/bandwidth-sdk/models/conference_completed_callback.rb +lib/bandwidth-sdk/models/conference_created_callback.rb +lib/bandwidth-sdk/models/conference_member.rb +lib/bandwidth-sdk/models/conference_member_exit_callback.rb +lib/bandwidth-sdk/models/conference_member_join_callback.rb +lib/bandwidth-sdk/models/conference_recording_available_callback.rb +lib/bandwidth-sdk/models/conference_recording_metadata.rb +lib/bandwidth-sdk/models/conference_redirect_callback.rb +lib/bandwidth-sdk/models/conference_state_enum.rb +lib/bandwidth-sdk/models/create_call.rb +lib/bandwidth-sdk/models/create_call_response.rb +lib/bandwidth-sdk/models/create_lookup_response.rb +lib/bandwidth-sdk/models/create_message_request_error.rb +lib/bandwidth-sdk/models/create_participant_request.rb +lib/bandwidth-sdk/models/create_participant_response.rb +lib/bandwidth-sdk/models/deferred_result.rb +lib/bandwidth-sdk/models/device_api_version_enum.rb +lib/bandwidth-sdk/models/disconenct_callback.rb +lib/bandwidth-sdk/models/diversion.rb +lib/bandwidth-sdk/models/dtmf_callback.rb +lib/bandwidth-sdk/models/field_error.rb +lib/bandwidth-sdk/models/file_format_enum.rb +lib/bandwidth-sdk/models/forbidden_request.rb +lib/bandwidth-sdk/models/gather_callback.rb +lib/bandwidth-sdk/models/initiate_callback.rb +lib/bandwidth-sdk/models/list_message_direction_enum.rb +lib/bandwidth-sdk/models/list_message_item.rb +lib/bandwidth-sdk/models/lookup_request.rb +lib/bandwidth-sdk/models/lookup_result.rb +lib/bandwidth-sdk/models/lookup_status.rb +lib/bandwidth-sdk/models/lookup_status_enum.rb +lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +lib/bandwidth-sdk/models/machine_detection_configuration.rb +lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +lib/bandwidth-sdk/models/media.rb +lib/bandwidth-sdk/models/message.rb +lib/bandwidth-sdk/models/message_direction_enum.rb +lib/bandwidth-sdk/models/message_request.rb +lib/bandwidth-sdk/models/message_status_enum.rb +lib/bandwidth-sdk/models/message_type_enum.rb +lib/bandwidth-sdk/models/messages_list.rb +lib/bandwidth-sdk/models/messaging_code_response.rb +lib/bandwidth-sdk/models/messaging_request_error.rb +lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +lib/bandwidth-sdk/models/mfa_request_error.rb +lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +lib/bandwidth-sdk/models/page_info.rb +lib/bandwidth-sdk/models/participant.rb +lib/bandwidth-sdk/models/participant_subscription.rb +lib/bandwidth-sdk/models/priority_enum.rb +lib/bandwidth-sdk/models/publish_permissions_enum.rb +lib/bandwidth-sdk/models/recording_available_callback.rb +lib/bandwidth-sdk/models/recording_complete_callback.rb +lib/bandwidth-sdk/models/recording_state_enum.rb +lib/bandwidth-sdk/models/redirect_callback.rb +lib/bandwidth-sdk/models/redirect_method_enum.rb +lib/bandwidth-sdk/models/request_error.rb +lib/bandwidth-sdk/models/session.rb +lib/bandwidth-sdk/models/stir_shaken.rb +lib/bandwidth-sdk/models/subscriptions.rb +lib/bandwidth-sdk/models/tag.rb +lib/bandwidth-sdk/models/tn_lookup_request_error.rb +lib/bandwidth-sdk/models/transcribe_recording.rb +lib/bandwidth-sdk/models/transcription.rb +lib/bandwidth-sdk/models/transcription_available_callback.rb +lib/bandwidth-sdk/models/transcription_list.rb +lib/bandwidth-sdk/models/transcription_metadata.rb +lib/bandwidth-sdk/models/transfer_answer_callback.rb +lib/bandwidth-sdk/models/transfer_complete_callback.rb +lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +lib/bandwidth-sdk/models/unauthorized_request.rb +lib/bandwidth-sdk/models/update_call.rb +lib/bandwidth-sdk/models/update_call_recording.rb +lib/bandwidth-sdk/models/update_conference.rb +lib/bandwidth-sdk/models/update_conference_member.rb +lib/bandwidth-sdk/models/verify_code_request.rb +lib/bandwidth-sdk/models/verify_code_response.rb +lib/bandwidth-sdk/models/voice_api_error.rb +lib/bandwidth-sdk/models/voice_code_response.rb +lib/bandwidth-sdk/version.rb +spec/api/calls_api_spec.rb +spec/api/conferences_api_spec.rb +spec/api/media_api_spec.rb +spec/api/messages_api_spec.rb +spec/api/mfa_api_spec.rb +spec/api/participants_api_spec.rb +spec/api/phone_number_lookup_api_spec.rb +spec/api/recordings_api_spec.rb +spec/api/sessions_api_spec.rb +spec/api/statistics_api_spec.rb +spec/api_client_spec.rb +spec/configuration_spec.rb +spec/models/account_statistics_spec.rb +spec/models/answer_callback_spec.rb +spec/models/bridge_complete_callback_spec.rb +spec/models/bridge_target_complete_callback_spec.rb +spec/models/call_direction_enum_spec.rb +spec/models/call_recording_metadata_spec.rb +spec/models/call_state_enum_spec.rb +spec/models/call_state_spec.rb +spec/models/callback_method_enum_spec.rb +spec/models/code_request_spec.rb +spec/models/conference_completed_callback_spec.rb +spec/models/conference_created_callback_spec.rb +spec/models/conference_member_exit_callback_spec.rb +spec/models/conference_member_join_callback_spec.rb +spec/models/conference_member_spec.rb +spec/models/conference_recording_available_callback_spec.rb +spec/models/conference_recording_metadata_spec.rb +spec/models/conference_redirect_callback_spec.rb +spec/models/conference_spec.rb +spec/models/conference_state_enum_spec.rb +spec/models/create_call_response_spec.rb +spec/models/create_call_spec.rb +spec/models/create_lookup_response_spec.rb +spec/models/create_message_request_error_spec.rb +spec/models/create_participant_request_spec.rb +spec/models/create_participant_response_spec.rb +spec/models/deferred_result_spec.rb +spec/models/device_api_version_enum_spec.rb +spec/models/disconenct_callback_spec.rb +spec/models/diversion_spec.rb +spec/models/dtmf_callback_spec.rb +spec/models/field_error_spec.rb +spec/models/file_format_enum_spec.rb +spec/models/forbidden_request_spec.rb +spec/models/gather_callback_spec.rb +spec/models/initiate_callback_spec.rb +spec/models/list_message_direction_enum_spec.rb +spec/models/list_message_item_spec.rb +spec/models/lookup_request_spec.rb +spec/models/lookup_result_spec.rb +spec/models/lookup_status_enum_spec.rb +spec/models/lookup_status_spec.rb +spec/models/machine_detection_complete_callback_spec.rb +spec/models/machine_detection_configuration_spec.rb +spec/models/machine_detection_mode_enum_spec.rb +spec/models/media_spec.rb +spec/models/message_direction_enum_spec.rb +spec/models/message_request_spec.rb +spec/models/message_spec.rb +spec/models/message_status_enum_spec.rb +spec/models/message_type_enum_spec.rb +spec/models/messages_list_spec.rb +spec/models/messaging_code_response_spec.rb +spec/models/messaging_request_error_spec.rb +spec/models/mfa_forbidden_request_error_spec.rb +spec/models/mfa_request_error_spec.rb +spec/models/mfa_unauthorized_request_error_spec.rb +spec/models/page_info_spec.rb +spec/models/participant_spec.rb +spec/models/participant_subscription_spec.rb +spec/models/priority_enum_spec.rb +spec/models/publish_permissions_enum_spec.rb +spec/models/recording_available_callback_spec.rb +spec/models/recording_complete_callback_spec.rb +spec/models/recording_state_enum_spec.rb +spec/models/redirect_callback_spec.rb +spec/models/redirect_method_enum_spec.rb +spec/models/request_error_spec.rb +spec/models/session_spec.rb +spec/models/stir_shaken_spec.rb +spec/models/subscriptions_spec.rb +spec/models/tag_spec.rb +spec/models/tn_lookup_request_error_spec.rb +spec/models/transcribe_recording_spec.rb +spec/models/transcription_available_callback_spec.rb +spec/models/transcription_list_spec.rb +spec/models/transcription_metadata_spec.rb +spec/models/transcription_spec.rb +spec/models/transfer_answer_callback_spec.rb +spec/models/transfer_complete_callback_spec.rb +spec/models/transfer_disconnect_callback_spec.rb +spec/models/unauthorized_request_spec.rb +spec/models/update_call_recording_spec.rb +spec/models/update_call_spec.rb +spec/models/update_conference_member_spec.rb +spec/models/update_conference_spec.rb +spec/models/verify_code_request_spec.rb +spec/models/verify_code_response_spec.rb +spec/models/voice_api_error_spec.rb +spec/models/voice_code_response_spec.rb +spec/spec_helper.rb diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 00000000..4ac4fded --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.2.0 \ No newline at end of file diff --git a/.rspec b/.rspec new file mode 100644 index 00000000..83e16f80 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/.rubocop.yml b/.rubocop.yml index 0b18990d..d32b2b1c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,34 +1,148 @@ -Metrics/ClassLength: - Enabled: false - -Metrics/MethodLength: - Enabled: false - -Metrics/BlockLength: - Enabled: false - -Metrics/ParameterLists: - Enabled: false - -Metrics/AbcSize: - Enabled: false - -Metrics/CyclomaticComplexity: - Enabled: false - -Metrics/PerceivedComplexity: - Enabled: false - -Lint/UnderscorePrefixedVariableName: - Enabled: false - -Naming/AccessorMethodName: - Enabled: false - -Style/AsciiComments: - Enabled: false - -AllCops: - Exclude: - - './test/**/*' - - './*' \ No newline at end of file +# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) +# Automatically generated by OpenAPI Generator (https://openapi-generator.tech) +AllCops: + TargetRubyVersion: 2.4 + # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop + # to ignore them, so only the ones explicitly set in this file are enabled. + DisabledByDefault: true + Exclude: + - '**/templates/**/*' + - '**/vendor/**/*' + - 'actionpack/lib/action_dispatch/journey/parser.rb' + +# Prefer &&/|| over and/or. +Style/AndOr: + Enabled: true + +# Align `when` with `case`. +Layout/CaseIndentation: + Enabled: true + +# Align comments with method definitions. +Layout/CommentIndentation: + Enabled: true + +Layout/ElseAlignment: + Enabled: true + +Layout/EmptyLineAfterMagicComment: + Enabled: true + +# In a regular class definition, no empty lines around the body. +Layout/EmptyLinesAroundClassBody: + Enabled: true + +# In a regular method definition, no empty lines around the body. +Layout/EmptyLinesAroundMethodBody: + Enabled: true + +# In a regular module definition, no empty lines around the body. +Layout/EmptyLinesAroundModuleBody: + Enabled: true + +Layout/FirstArgumentIndentation: + Enabled: true + +# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. +Style/HashSyntax: + Enabled: false + +# Method definitions after `private` or `protected` isolated calls need one +# extra level of indentation. +Layout/IndentationConsistency: + Enabled: true + EnforcedStyle: indented_internal_methods + +# Two spaces, no tabs (for indentation). +Layout/IndentationWidth: + Enabled: true + +Layout/LeadingCommentSpace: + Enabled: true + +Layout/SpaceAfterColon: + Enabled: true + +Layout/SpaceAfterComma: + Enabled: true + +Layout/SpaceAroundEqualsInParameterDefault: + Enabled: true + +Layout/SpaceAroundKeyword: + Enabled: true + +Layout/SpaceAroundOperators: + Enabled: true + +Layout/SpaceBeforeComma: + Enabled: true + +Layout/SpaceBeforeFirstArg: + Enabled: true + +Style/DefWithParentheses: + Enabled: true + +# Defining a method with parameters needs parentheses. +Style/MethodDefParentheses: + Enabled: true + +Style/FrozenStringLiteralComment: + Enabled: false + EnforcedStyle: always + +# Use `foo {}` not `foo{}`. +Layout/SpaceBeforeBlockBraces: + Enabled: true + +# Use `foo { bar }` not `foo {bar}`. +Layout/SpaceInsideBlockBraces: + Enabled: true + +# Use `{ a: 1 }` not `{a:1}`. +Layout/SpaceInsideHashLiteralBraces: + Enabled: true + +Layout/SpaceInsideParens: + Enabled: true + +# Check quotes usage according to lint rule below. +#Style/StringLiterals: +# Enabled: true +# EnforcedStyle: single_quotes + +# Detect hard tabs, no hard tabs. +Layout/IndentationStyle: + Enabled: true + +# Blank lines should not have any spaces. +Layout/TrailingEmptyLines: + Enabled: true + +# No trailing whitespace. +Layout/TrailingWhitespace: + Enabled: false + +# Use quotes for string literals when they are enough. +Style/RedundantPercentQ: + Enabled: true + +# Align `end` with the matching keyword or starting expression except for +# assignments, where it should be aligned with the LHS. +Layout/EndAlignment: + Enabled: true + EnforcedStyleAlignWith: variable + AutoCorrect: true + +# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. +Lint/RequireParentheses: + Enabled: true + +Style/RedundantReturn: + Enabled: true + AllowMultipleReturnValues: true + +Style/Semicolon: + Enabled: true + AllowAsExpressionSeparator: true diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..baa968ef --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: ruby +cache: bundler +rvm: + - 2.3 + - 2.4 + - 2.5 + - 2.6 + - 2.7 + - 3.0 +script: + - bundle install --path vendor/bundle + - bundle exec rspec + - gem build bandwidth-sdk.gemspec + - gem install ./bandwidth-sdk-11.0.0.gem diff --git a/Gemfile b/Gemfile index 02d11b16..c2e3127c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,9 @@ -source 'https://rubygems.org' - -group :test do - gem 'rake' -end - -gemspec +source 'https://rubygems.org' + +gemspec + +group :development, :test do + gem 'rake', '~> 13.0.1' + gem 'pry-byebug' + gem 'rubocop', '~> 0.66.0' +end diff --git a/README.md b/README.md index 4a1da26e..d1938519 100644 --- a/README.md +++ b/README.md @@ -1,175 +1,235 @@ -# Bandwidth Ruby SDK +# bandwidth-sdk -[![Test](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test.yml) +Bandwidth - the Ruby gem for the Bandwidth +Bandwidth's Communication APIs -| **OS** | **Ruby** | -|:---:|:---:| -| Windows 2016 | 2.6, 2.7, 3.0 | -| Windows 2019 | 2.6, 2.7, 3.0 | -| Ubuntu 18.04 | 2.6, 2.7, 3.0 | -| Ubuntu 20.04 | 2.6, 2.7, 3.0 | +This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -## Getting Started +- API version: 1.0.0 +- Package version: 11.0.0 +- Build package: org.openapitools.codegen.languages.RubyClientCodegen +For more information, please visit [https://dev.bandwidth.com](https://dev.bandwidth.com) -### Installation +## Installation -``` -gem install bandwidth-sdk -``` +### Build a gem -### Initialize +To build the Ruby code into a gem: -```ruby -require 'bandwidth' - -include Bandwidth -include Bandwidth::Voice -include Bandwidth::Messaging -include Bandwidth::WebRtc -include Bandwidth::TwoFactorAuth - -bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: 'username', - voice_basic_auth_password: 'password', - messaging_basic_auth_user_name: 'username', - messaging_basic_auth_password: 'username', - two_factor_auth_basic_auth_user_name: 'username', - two_factor_auth_basic_auth_password: 'password', - web_rtc_basic_auth_user_name: 'username', - web_rtc_basic_auth_password: 'password' -) -account_id = "12345" +```shell +gem build bandwidth-sdk.gemspec ``` -### Create Phone Call +Then either install the gem locally: -```ruby -voice_client = bandwidth_client.voice_client.client - -body = ApiCreateCallRequest.new -body.from = '+16666666666' -body.to = '+17777777777' -body.answer_url = 'https://test.com' -body.application_id = '3-d-4-b-5' - -begin - response = voice_client.create_call(account_id,:body => body) - puts response.data.call_id #c-d45a41e5-bcb12581-b18e-4bdc-9874-6r3235dfweao - puts response.status_code #201 -rescue Bandwidth::ErrorResponseException => e - puts e.description #Invalid to: must be an E164 telephone number - puts e.response_code #400 -end +```shell +gem install ./bandwidth-sdk-11.0.0.gem ``` -### Generate BXML +(for development, run `gem install --dev ./bandwidth-sdk-11.0.0.gem` to install the development dependencies) -```ruby -response = Bandwidth::Voice::Response.new() -hangup = Bandwidth::Voice::Hangup.new() +or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). -response.push(hangup) -puts response.to_bxml() -``` +Finally add this to the Gemfile: -### Send Text Message + gem 'bandwidth-sdk', '~> 11.0.0' -```ruby -messaging_client = bandwidth_client.messaging_client.client +### Install from Git -body = MessageRequest.new -body.application_id = '1-2-3' -body.to = ['+17777777777'] -body.from = '+18888888888' -body.text = 'Hello from Bandwidth' +If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: -begin - response = messaging_client.create_message(account_id, body) - puts response.data.id #1570740275373xbn7mbhsfewasdr - puts response.status_code #202 -rescue Bandwidth::GenericClientException => e - puts e.description #Access is denied - puts e.response_code #403 -rescue Bandwidth::PathClientException => e - puts e.message #Your request could not be accepted. - puts e.response_code #400 -end -``` + gem 'bandwidth-sdk', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' -### Create A MFA Request +### Include the Ruby code directly -```ruby -auth_client = bandwidth_client.two_factor_auth_client.mfa - -from_phone = "+18888888888" -to_phone = "+17777777777" -messaging_application_id = "1-d-b" -scope = "scope" -digits = 6 - -body = TwoFactorCodeRequestSchema.new -body.from = from_phone -body.to = to_phone -body.application_id = messaging_application_id -body.scope = scope -body.digits = digits -body.message = "Your temporary {NAME} {SCOPE} code is {CODE}" - -auth_client.create_messaging_two_factor(account_id, body) - -code = "123456" #This is the user input to validate - -body = TwoFactorVerifyRequestSchema.new -body.from = from_phone -body.to = to_phone -body.application_id = application_id -body.scope = scope -body.code = code -body.digits = digits -body.expiration_time_in_minutes = 3 - -response = auth_client.create_verify_two_factor(account_id, body) -puts "Auth status: " + response.data.valid.to_s -``` +Include the Ruby code directly using `-I` as follows: -### WebRtc Participant & Session Management - -```ruby -web_rtc_client = bandwidth_client.web_rtc_client.client +```shell +ruby -Ilib script.rb +``` -create_session_body = Session.new -create_session_body.tag = 'new-session' +## Getting Started -create_session_response = web_rtc_client.create_session(account_id, :body => create_session_body) -session_id = create_session_response.data.id -puts session_id +Please follow the [installation](#installation) procedure and then run the following code: -create_participant_body = Participant.new -create_participant_body.publish_permissions = [ - PublishPermissionEnum::AUDIO, - PublishPermissionEnum::VIDEO -] -create_participant_body.callback_url = "https://sample.com" +```ruby +# Load the gem +require 'bandwidth-sdk' + +# Setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR_USERNAME' + config.password = 'YOUR_PASSWORD' +end -create_participant_response = web_rtc_client.create_participant(account_id, :body => create_participant_body) -participant_id = create_participant_response.data.participant.id -puts participant_id +api_instance = Bandwidth::CallsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+19195554321', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.com/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call -body = Subscriptions.new -body.session_id = "1234-abcd" +begin + #Create Call + result = api_instance.create_call(account_id, create_call) + p result +rescue Bandwidth::ApiError => e + puts "Exception when calling CallsApi->create_call: #{e}" +end -web_rtc_client.add_participant_to_session(account_id, session_id, participant_id, body: body) ``` -## Supported Ruby Versions - -This package can be used with Ruby >= 2.0 - -## Documentation - -Documentation for this package can be found at https://dev.bandwidth.com/sdks/ruby.html - -## Credentials +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*Bandwidth::CallsApi* | [**create_call**](docs/CallsApi.md#create_call) | **POST** /accounts/{accountId}/calls | Create Call +*Bandwidth::CallsApi* | [**get_call_state**](docs/CallsApi.md#get_call_state) | **GET** /accounts/{accountId}/calls/{callId} | Get Call State Information +*Bandwidth::CallsApi* | [**update_call**](docs/CallsApi.md#update_call) | **POST** /accounts/{accountId}/calls/{callId} | Update Call +*Bandwidth::CallsApi* | [**update_call_bxml**](docs/CallsApi.md#update_call_bxml) | **PUT** /accounts/{accountId}/calls/{callId}/bxml | Update Call BXML +*Bandwidth::ConferencesApi* | [**download_conference_recording**](docs/ConferencesApi.md#download_conference_recording) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media | Download Conference Recording +*Bandwidth::ConferencesApi* | [**get_conference**](docs/ConferencesApi.md#get_conference) | **GET** /accounts/{accountId}/conferences/{conferenceId} | Get Conference Information +*Bandwidth::ConferencesApi* | [**get_conference_member**](docs/ConferencesApi.md#get_conference_member) | **GET** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Get Conference Member +*Bandwidth::ConferencesApi* | [**get_conference_recording**](docs/ConferencesApi.md#get_conference_recording) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId} | Get Conference Recording Information +*Bandwidth::ConferencesApi* | [**list_conference_recordings**](docs/ConferencesApi.md#list_conference_recordings) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings | Get Conference Recordings +*Bandwidth::ConferencesApi* | [**list_conferences**](docs/ConferencesApi.md#list_conferences) | **GET** /accounts/{accountId}/conferences | Get Conferences +*Bandwidth::ConferencesApi* | [**update_conference**](docs/ConferencesApi.md#update_conference) | **POST** /accounts/{accountId}/conferences/{conferenceId} | Update Conference +*Bandwidth::ConferencesApi* | [**update_conference_bxml**](docs/ConferencesApi.md#update_conference_bxml) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/bxml | Update Conference BXML +*Bandwidth::ConferencesApi* | [**update_conference_member**](docs/ConferencesApi.md#update_conference_member) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Update Conference Member +*Bandwidth::MFAApi* | [**generate_messaging_code**](docs/MFAApi.md#generate_messaging_code) | **POST** /accounts/{accountId}/code/messaging | Messaging Authentication Code +*Bandwidth::MFAApi* | [**generate_voice_code**](docs/MFAApi.md#generate_voice_code) | **POST** /accounts/{accountId}/code/voice | Voice Authentication Code +*Bandwidth::MFAApi* | [**verify_code**](docs/MFAApi.md#verify_code) | **POST** /accounts/{accountId}/code/verify | Verify Authentication Code +*Bandwidth::MediaApi* | [**delete_media**](docs/MediaApi.md#delete_media) | **DELETE** /users/{accountId}/media/{mediaId} | Delete Media +*Bandwidth::MediaApi* | [**get_media**](docs/MediaApi.md#get_media) | **GET** /users/{accountId}/media/{mediaId} | Get Media +*Bandwidth::MediaApi* | [**list_media**](docs/MediaApi.md#list_media) | **GET** /users/{accountId}/media | List Media +*Bandwidth::MediaApi* | [**upload_media**](docs/MediaApi.md#upload_media) | **PUT** /users/{accountId}/media/{mediaId} | Upload Media +*Bandwidth::MessagesApi* | [**create_message**](docs/MessagesApi.md#create_message) | **POST** /users/{accountId}/messages | Create Message +*Bandwidth::MessagesApi* | [**list_messages**](docs/MessagesApi.md#list_messages) | **GET** /users/{accountId}/messages | List Messages +*Bandwidth::ParticipantsApi* | [**create_participant**](docs/ParticipantsApi.md#create_participant) | **POST** /accounts/{accountId}/participants | Create Participant +*Bandwidth::ParticipantsApi* | [**delete_participant**](docs/ParticipantsApi.md#delete_participant) | **DELETE** /accounts/{accountId}/participants/{participantId} | Delete Participant +*Bandwidth::ParticipantsApi* | [**get_participant**](docs/ParticipantsApi.md#get_participant) | **GET** /accounts/{accountId}/participants/{participantId} | Get Participant +*Bandwidth::PhoneNumberLookupApi* | [**create_lookup**](docs/PhoneNumberLookupApi.md#create_lookup) | **POST** /accounts/{accountId}/tnlookup | Create Lookup +*Bandwidth::PhoneNumberLookupApi* | [**get_lookup_status**](docs/PhoneNumberLookupApi.md#get_lookup_status) | **GET** /accounts/{accountId}/tnlookup/{requestId} | Get Lookup Request Status +*Bandwidth::RecordingsApi* | [**delete_call_transcription**](docs/RecordingsApi.md#delete_call_transcription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription +*Bandwidth::RecordingsApi* | [**delete_recording**](docs/RecordingsApi.md#delete_recording) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Delete Recording +*Bandwidth::RecordingsApi* | [**delete_recording_media**](docs/RecordingsApi.md#delete_recording_media) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Delete Recording Media +*Bandwidth::RecordingsApi* | [**download_call_recording**](docs/RecordingsApi.md#download_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Download Recording +*Bandwidth::RecordingsApi* | [**get_call_recording**](docs/RecordingsApi.md#get_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Get Call Recording +*Bandwidth::RecordingsApi* | [**get_call_transcription**](docs/RecordingsApi.md#get_call_transcription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription +*Bandwidth::RecordingsApi* | [**list_account_call_recordings**](docs/RecordingsApi.md#list_account_call_recordings) | **GET** /accounts/{accountId}/recordings | Get Call Recordings +*Bandwidth::RecordingsApi* | [**list_call_recordings**](docs/RecordingsApi.md#list_call_recordings) | **GET** /accounts/{accountId}/calls/{callId}/recordings | List Call Recordings +*Bandwidth::RecordingsApi* | [**transcribe_call_recording**](docs/RecordingsApi.md#transcribe_call_recording) | **POST** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Create Transcription Request +*Bandwidth::RecordingsApi* | [**update_call_recording_state**](docs/RecordingsApi.md#update_call_recording_state) | **PUT** /accounts/{accountId}/calls/{callId}/recording | Update Recording +*Bandwidth::SessionsApi* | [**add_participant_to_session**](docs/SessionsApi.md#add_participant_to_session) | **PUT** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId} | Add Participant to Session +*Bandwidth::SessionsApi* | [**create_session**](docs/SessionsApi.md#create_session) | **POST** /accounts/{accountId}/sessions | Create Session +*Bandwidth::SessionsApi* | [**delete_session**](docs/SessionsApi.md#delete_session) | **DELETE** /accounts/{accountId}/sessions/{sessionId} | Delete Session +*Bandwidth::SessionsApi* | [**get_participant_subscriptions**](docs/SessionsApi.md#get_participant_subscriptions) | **GET** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions | Get Participant Subscriptions +*Bandwidth::SessionsApi* | [**get_session**](docs/SessionsApi.md#get_session) | **GET** /accounts/{accountId}/sessions/{sessionId} | Get Session +*Bandwidth::SessionsApi* | [**list_session_participants**](docs/SessionsApi.md#list_session_participants) | **GET** /accounts/{accountId}/sessions/{sessionId}/participants | List Participants in Session +*Bandwidth::SessionsApi* | [**remove_participant_from_session**](docs/SessionsApi.md#remove_participant_from_session) | **DELETE** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId} | Remove Participant from Session +*Bandwidth::SessionsApi* | [**update_participant_subscriptions**](docs/SessionsApi.md#update_participant_subscriptions) | **PUT** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions | Update Participant Subscriptions +*Bandwidth::StatisticsApi* | [**get_statistics**](docs/StatisticsApi.md#get_statistics) | **GET** /accounts/{accountId}/statistics | Get Account Statistics + + +## Documentation for Models + + - [Bandwidth::AccountStatistics](docs/AccountStatistics.md) + - [Bandwidth::AnswerCallback](docs/AnswerCallback.md) + - [Bandwidth::BridgeCompleteCallback](docs/BridgeCompleteCallback.md) + - [Bandwidth::BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md) + - [Bandwidth::CallDirectionEnum](docs/CallDirectionEnum.md) + - [Bandwidth::CallRecordingMetadata](docs/CallRecordingMetadata.md) + - [Bandwidth::CallState](docs/CallState.md) + - [Bandwidth::CallStateEnum](docs/CallStateEnum.md) + - [Bandwidth::CallbackMethodEnum](docs/CallbackMethodEnum.md) + - [Bandwidth::CodeRequest](docs/CodeRequest.md) + - [Bandwidth::Conference](docs/Conference.md) + - [Bandwidth::ConferenceCompletedCallback](docs/ConferenceCompletedCallback.md) + - [Bandwidth::ConferenceCreatedCallback](docs/ConferenceCreatedCallback.md) + - [Bandwidth::ConferenceMember](docs/ConferenceMember.md) + - [Bandwidth::ConferenceMemberExitCallback](docs/ConferenceMemberExitCallback.md) + - [Bandwidth::ConferenceMemberJoinCallback](docs/ConferenceMemberJoinCallback.md) + - [Bandwidth::ConferenceRecordingAvailableCallback](docs/ConferenceRecordingAvailableCallback.md) + - [Bandwidth::ConferenceRecordingMetadata](docs/ConferenceRecordingMetadata.md) + - [Bandwidth::ConferenceRedirectCallback](docs/ConferenceRedirectCallback.md) + - [Bandwidth::ConferenceStateEnum](docs/ConferenceStateEnum.md) + - [Bandwidth::CreateCall](docs/CreateCall.md) + - [Bandwidth::CreateCallResponse](docs/CreateCallResponse.md) + - [Bandwidth::CreateLookupResponse](docs/CreateLookupResponse.md) + - [Bandwidth::CreateMessageRequestError](docs/CreateMessageRequestError.md) + - [Bandwidth::CreateParticipantRequest](docs/CreateParticipantRequest.md) + - [Bandwidth::CreateParticipantResponse](docs/CreateParticipantResponse.md) + - [Bandwidth::DeferredResult](docs/DeferredResult.md) + - [Bandwidth::DeviceApiVersionEnum](docs/DeviceApiVersionEnum.md) + - [Bandwidth::DisconenctCallback](docs/DisconenctCallback.md) + - [Bandwidth::Diversion](docs/Diversion.md) + - [Bandwidth::DtmfCallback](docs/DtmfCallback.md) + - [Bandwidth::FieldError](docs/FieldError.md) + - [Bandwidth::FileFormatEnum](docs/FileFormatEnum.md) + - [Bandwidth::ForbiddenRequest](docs/ForbiddenRequest.md) + - [Bandwidth::GatherCallback](docs/GatherCallback.md) + - [Bandwidth::InitiateCallback](docs/InitiateCallback.md) + - [Bandwidth::ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md) + - [Bandwidth::ListMessageItem](docs/ListMessageItem.md) + - [Bandwidth::LookupRequest](docs/LookupRequest.md) + - [Bandwidth::LookupResult](docs/LookupResult.md) + - [Bandwidth::LookupStatus](docs/LookupStatus.md) + - [Bandwidth::LookupStatusEnum](docs/LookupStatusEnum.md) + - [Bandwidth::MachineDetectionCompleteCallback](docs/MachineDetectionCompleteCallback.md) + - [Bandwidth::MachineDetectionConfiguration](docs/MachineDetectionConfiguration.md) + - [Bandwidth::MachineDetectionModeEnum](docs/MachineDetectionModeEnum.md) + - [Bandwidth::Media](docs/Media.md) + - [Bandwidth::Message](docs/Message.md) + - [Bandwidth::MessageDirectionEnum](docs/MessageDirectionEnum.md) + - [Bandwidth::MessageRequest](docs/MessageRequest.md) + - [Bandwidth::MessageStatusEnum](docs/MessageStatusEnum.md) + - [Bandwidth::MessageTypeEnum](docs/MessageTypeEnum.md) + - [Bandwidth::MessagesList](docs/MessagesList.md) + - [Bandwidth::MessagingCodeResponse](docs/MessagingCodeResponse.md) + - [Bandwidth::MessagingRequestError](docs/MessagingRequestError.md) + - [Bandwidth::MfaForbiddenRequestError](docs/MfaForbiddenRequestError.md) + - [Bandwidth::MfaRequestError](docs/MfaRequestError.md) + - [Bandwidth::MfaUnauthorizedRequestError](docs/MfaUnauthorizedRequestError.md) + - [Bandwidth::PageInfo](docs/PageInfo.md) + - [Bandwidth::Participant](docs/Participant.md) + - [Bandwidth::ParticipantSubscription](docs/ParticipantSubscription.md) + - [Bandwidth::PriorityEnum](docs/PriorityEnum.md) + - [Bandwidth::PublishPermissionsEnum](docs/PublishPermissionsEnum.md) + - [Bandwidth::RecordingAvailableCallback](docs/RecordingAvailableCallback.md) + - [Bandwidth::RecordingCompleteCallback](docs/RecordingCompleteCallback.md) + - [Bandwidth::RecordingStateEnum](docs/RecordingStateEnum.md) + - [Bandwidth::RedirectCallback](docs/RedirectCallback.md) + - [Bandwidth::RedirectMethodEnum](docs/RedirectMethodEnum.md) + - [Bandwidth::RequestError](docs/RequestError.md) + - [Bandwidth::Session](docs/Session.md) + - [Bandwidth::StirShaken](docs/StirShaken.md) + - [Bandwidth::Subscriptions](docs/Subscriptions.md) + - [Bandwidth::Tag](docs/Tag.md) + - [Bandwidth::TnLookupRequestError](docs/TnLookupRequestError.md) + - [Bandwidth::TranscribeRecording](docs/TranscribeRecording.md) + - [Bandwidth::Transcription](docs/Transcription.md) + - [Bandwidth::TranscriptionAvailableCallback](docs/TranscriptionAvailableCallback.md) + - [Bandwidth::TranscriptionList](docs/TranscriptionList.md) + - [Bandwidth::TranscriptionMetadata](docs/TranscriptionMetadata.md) + - [Bandwidth::TransferAnswerCallback](docs/TransferAnswerCallback.md) + - [Bandwidth::TransferCompleteCallback](docs/TransferCompleteCallback.md) + - [Bandwidth::TransferDisconnectCallback](docs/TransferDisconnectCallback.md) + - [Bandwidth::UnauthorizedRequest](docs/UnauthorizedRequest.md) + - [Bandwidth::UpdateCall](docs/UpdateCall.md) + - [Bandwidth::UpdateCallRecording](docs/UpdateCallRecording.md) + - [Bandwidth::UpdateConference](docs/UpdateConference.md) + - [Bandwidth::UpdateConferenceMember](docs/UpdateConferenceMember.md) + - [Bandwidth::VerifyCodeRequest](docs/VerifyCodeRequest.md) + - [Bandwidth::VerifyCodeResponse](docs/VerifyCodeResponse.md) + - [Bandwidth::VoiceApiError](docs/VoiceApiError.md) + - [Bandwidth::VoiceCodeResponse](docs/VoiceCodeResponse.md) + + +## Documentation for Authorization + + +### Basic + +- **Type**: HTTP basic authentication -Information for credentials for this package can be found at https://dev.bandwidth.com/guides/accountCredentials.html diff --git a/Rakefile b/Rakefile index 6bf529f4..c72ca30d 100644 --- a/Rakefile +++ b/Rakefile @@ -1,13 +1,10 @@ -lib = File.expand_path('../lib', __FILE__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) - -require "bundler/gem_tasks" -require 'rake/testtask' - -Rake::TestTask.new(:test) do |t| - t.libs << "test" - t.test_files = FileList['test/**/test_*.rb', 'spec/**/*_spec.rb'] - t.warning = false -end - -task :default => :test +require "bundler/gem_tasks" + +begin + require 'rspec/core/rake_task' + + RSpec::Core::RakeTask.new(:spec) + task default: :spec +rescue LoadError + # no rspec available +end diff --git a/bandwidth-sdk.gemspec b/bandwidth-sdk.gemspec new file mode 100644 index 00000000..b3102277 --- /dev/null +++ b/bandwidth-sdk.gemspec @@ -0,0 +1,39 @@ +# -*- encoding: utf-8 -*- + +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +$:.push File.expand_path("../lib", __FILE__) +require "bandwidth-sdk/version" + +Gem::Specification.new do |s| + s.name = "bandwidth-sdk" + s.version = Bandwidth::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["Bandwidth"] + s.email = ["dx@bandwidth.com"] + s.homepage = "https://github.com/Bandwidth/ruby-sdk" + s.summary = "Bandwidth Ruby SDK" + s.description = "The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs" + s.license = "MIT" + s.required_ruby_version = ">=2.4" + + s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0' + s.add_runtime_dependency 'faraday-multipart' + + s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' + + s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } + s.test_files = `find spec/*`.split("\n") + s.executables = [] + s.require_paths = ["lib"] +end diff --git a/bandwidth.gemspec b/bandwidth.gemspec deleted file mode 100644 index a378cc14..00000000 --- a/bandwidth.gemspec +++ /dev/null @@ -1,25 +0,0 @@ -Gem::Specification.new do |s| - s.name = 'bandwidth-sdk' - s.version = '10.2.0' - s.summary = 'Bandwidth' - s.description = 'The official client SDK for Bandwidht\'s Voice, Messaging, MFA, and WebRTC APIs' - s.authors = ['Bandwidth'] - s.email = 'dx@bandwidth.com' - s.homepage = 'https://github.com/Bandwidth/ruby-sdk' - s.license = 'MIT' - s.add_dependency('logging', '~> 2.3') - s.add_dependency('faraday', '>= 1.0', '< 3.0') - s.add_dependency('faraday-follow_redirects', '~> 0.3') - s.add_dependency('faraday-gzip', '~> 0.1.0') - s.add_dependency('faraday-multipart', '~> 1.0') - s.add_dependency('faraday-retry', '~> 1.0') - s.add_dependency('certifi', '~> 2018.1', '>= 2018.01.18') - s.add_dependency('faraday-http-cache', '~> 2.2') - s.add_dependency('builder', '~> 3.2.4') - s.add_development_dependency('minitest', '~> 5.14', '>= 5.14.1') - s.add_development_dependency('minitest-proveit', '~> 1.0') - s.add_development_dependency('test-unit') - s.required_ruby_version = ['>= 2.0'] - s.files = Dir['{bin,lib,man,test,spec}/**/*', 'README*', 'LICENSE*'] - s.require_paths = ['lib'] -end diff --git a/bandwidth.yml b/bandwidth.yml new file mode 100644 index 00000000..797ca0dd --- /dev/null +++ b/bandwidth.yml @@ -0,0 +1,5798 @@ +openapi: 3.0.3 +info: + title: Bandwidth + description: Bandwidth's Communication APIs + contact: + name: Bandwidth + url: https://dev.bandwidth.com + email: letstalk@bandwidth.com + version: 1.0.0 +security: + - Basic: [] +tags: + - name: Messages + - name: Media + - name: Calls + - name: Conferences + - name: Recordings + - name: Statistics + - name: MFA + - name: Phone Number Lookup + - name: Participants + - name: Sessions +paths: + /users/{accountId}/media: + get: + summary: List Media + description: Gets a list of your media files. No query parameters are supported. + operationId: listMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/continuationToken' + responses: + '200': + $ref: '#/components/responses/listMediaResponse' + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + servers: &ref_0 + - url: https://messaging.bandwidth.com/api/v2 + description: Production + /users/{accountId}/media/{mediaId}: + get: + summary: Get Media + description: Downloads a media file you previously uploaded. + operationId: getMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/mediaId' + responses: + '200': + $ref: '#/components/responses/getMediaResponse' + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + put: + summary: Upload Media + description: >- + Upload a file. You may add headers to the request in order to provide + some control to your media file. + + + A list of supported media types can be found + [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). + operationId: uploadMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/mediaId' + - $ref: '#/components/parameters/contentType' + - $ref: '#/components/parameters/cacheControl' + requestBody: + $ref: '#/components/requestBodies/uploadMediaRequest' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + delete: + summary: Delete Media + description: |- + Deletes a media file from Bandwidth API server. Make sure you don't have + any application scripts still using the media before you delete. + + If you accidentally delete a media file you can immediately upload a new + file with the same name. + operationId: deleteMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/mediaId' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + servers: *ref_0 + /users/{accountId}/messages: + get: + summary: List Messages + description: Returns a list of messages based on query parameters. + operationId: listMessages + tags: + - Messages + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/messageId' + - $ref: '#/components/parameters/sourceTn' + - $ref: '#/components/parameters/destinationTn' + - $ref: '#/components/parameters/messageStatus' + - $ref: '#/components/parameters/messageDirection' + - $ref: '#/components/parameters/carrierName' + - $ref: '#/components/parameters/messageType' + - $ref: '#/components/parameters/errorCode' + - $ref: '#/components/parameters/fromDateTime' + - $ref: '#/components/parameters/toDateTime' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/pageToken' + - $ref: '#/components/parameters/limit' + responses: + '200': + $ref: '#/components/responses/listMessagesResponse' + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + post: + summary: Create Message + description: >- + Endpoint for sending text messages and picture messages using V2 + messaging. + operationId: createMessage + tags: + - Messages + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/createMessageRequest' + responses: + '202': + $ref: '#/components/responses/createMessageResponse' + '400': + $ref: '#/components/responses/createMessageBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + servers: *ref_0 + /accounts/{accountId}/calls: + post: + tags: + - Calls + summary: Create Call + description: >- + Creates an outbound phone call. + + + All calls are initially queued. Your outbound calls will initiated at a + specific dequeueing rate, enabling your application to "fire and forget" + when creating calls. Queued calls may not be modified until they are + dequeued and placed, but may be removed from your queue on demand. + + + Please note: Calls submitted to your queue will be placed + approximately in order, but exact ordering is not guaranteed. + operationId: createCall + parameters: + - $ref: '#/components/parameters/accountId1' + requestBody: + $ref: '#/components/requestBodies/createCallRequest' + responses: + '201': + $ref: '#/components/responses/createCallResponse' + '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 + /accounts/{accountId}/calls/{callId}: + get: + tags: + - Calls + summary: Get Call State Information + description: >- + Retrieve the current state of a specific call. This information is + near-realtime, so it may take a few minutes for your call to be + accessible using this endpoint. + + + **Note**: 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 HTTP 404 response. + operationId: getCallState + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + responses: + '200': + $ref: '#/components/responses/getCallStateResponse' + '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' + post: + tags: + - Calls + summary: Update Call + description: >- + Interrupts and redirects a call to a different URL that should return a + BXML document. + operationId: updateCall + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + requestBody: + $ref: '#/components/requestBodies/updateCallRequest' + responses: + '200': + description: Call Successfully Modified + '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' + '409': + $ref: '#/components/responses/voiceConflictError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/bxml: + put: + tags: + - Calls + summary: Update Call BXML + description: Interrupts and replaces an active call's BXML document. + operationId: updateCallBxml + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + requestBody: + $ref: '#/components/requestBodies/updateCallBxmlRequest' + responses: + '204': + description: Call BXML Successfully Replaced + '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' + '409': + $ref: '#/components/responses/voiceConflictError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences: + get: + tags: + - Conferences + summary: Get Conferences + description: >- + Returns a max of 1000 conferences, sorted by `createdTime` from oldest + to newest. + + + **NOTE:** If the number of conferences 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 conference records. + operationId: listConferences + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/minCreatedTime' + - $ref: '#/components/parameters/maxCreatedTime' + - $ref: '#/components/parameters/pageSize' + - $ref: '#/components/parameters/pageToken1' + responses: + '200': + $ref: '#/components/responses/listConferencesResponse' + '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}/conferences/{conferenceId}: + get: + tags: + - Conferences + summary: Get Conference Information + description: Returns information about the specified conference. + operationId: getConference + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/conferenceId' + responses: + '200': + $ref: '#/components/responses/getConferenceResponse' + '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' + post: + tags: + - Conferences + summary: Update Conference + description: Update the conference state. + operationId: updateConference + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/conferenceId' + requestBody: + $ref: '#/components/requestBodies/updateConferenceRequest' + responses: + '204': + description: Conference successfully modified + '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}/conferences/{conferenceId}/bxml: + put: + tags: + - Conferences + summary: Update Conference BXML + description: Update the conference BXML document. + operationId: updateConferenceBxml + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/conferenceId' + requestBody: + $ref: '#/components/requestBodies/updateConferenceBxmlRequest' + responses: + '204': + description: Conference successfully modified + '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}/conferences/{conferenceId}/members/{memberId}: + get: + tags: + - Conferences + summary: Get Conference Member + description: Returns information about the specified conference member. + operationId: getConferenceMember + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/memberId' + responses: + '200': + $ref: '#/components/responses/getConferenceMemberResponse' + '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' + put: + tags: + - Conferences + summary: Update Conference Member + description: Updates settings for a particular conference member. + operationId: updateConferenceMember + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/memberId' + requestBody: + $ref: '#/components/requestBodies/updateConferenceMemberRequest' + responses: + '204': + description: Conference member successfully modified + '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}/conferences/{conferenceId}/recordings: + get: + tags: + - Conferences + summary: Get Conference Recordings + description: >- + Returns a (potentially empty) list of metadata for the recordings that + took place during the specified conference. + operationId: listConferenceRecordings + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/conferenceId' + responses: + '200': + $ref: '#/components/responses/listConferenceRecordingsResponse' + '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}/conferences/{conferenceId}/recordings/{recordingId}: + get: + tags: + - Conferences + summary: Get Conference Recording Information + description: Returns metadata for the specified recording. + operationId: getConferenceRecording + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/getConferenceRecordingResponse' + '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}/conferences/{conferenceId}/recordings/{recordingId}/media: + get: + tags: + - Conferences + summary: Download Conference Recording + description: Downloads the specified recording file. + operationId: downloadConferenceRecording + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/downloadRecordingMediaResponse' + '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}/recordings: + get: + tags: + - Recordings + summary: Get Call Recordings + description: >- + Returns a list of metadata for the recordings associated with the + + specified account. The list can be filtered by the optional from, to, + minStartTime, + + and maxStartTime arguments. The list is capped at 1000 entries and may + be + + empty if no recordings match the specified criteria. + operationId: listAccountCallRecordings + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/to' + - $ref: '#/components/parameters/from' + - $ref: '#/components/parameters/minStartTime' + - $ref: '#/components/parameters/maxStartTime' + responses: + '200': + $ref: '#/components/responses/listCallRecordingsResponse' + '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}/recording: + put: + tags: + - Recordings + summary: Update Recording + description: Pause or resume a recording on an active phone call. + operationId: updateCallRecordingState + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + requestBody: + $ref: '#/components/requestBodies/updateCallRecordingRequest' + responses: + '200': + description: Recording state successfully modified + '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}/recordings: + get: + tags: + - Recordings + summary: List Call Recordings + description: |- + Returns a (potentially empty) list of metadata for the recordings + that took place during the specified call. + operationId: listCallRecordings + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + responses: + '200': + $ref: '#/components/responses/listCallRecordingsResponse' + '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}/recordings/{recordingId}: + get: + tags: + - Recordings + summary: Get Call Recording + description: Returns metadata for the specified recording. + operationId: getCallRecording + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/getCallRecordingResponse' + '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: + - Recordings + summary: Delete Recording + description: >- + 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. + operationId: deleteRecording + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '204': + description: Recording Deleted + '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}/recordings/{recordingId}/media: + get: + tags: + - Recordings + summary: Download Recording + description: Downloads the specified recording. + operationId: downloadCallRecording + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/downloadRecordingMediaResponse' + '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: + - Recordings + summary: Delete Recording Media + description: Deletes the specified recording's media. + operationId: deleteRecordingMedia + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '204': + description: The recording media was successfully deleted + '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}/recordings/{recordingId}/transcription: + get: + tags: + - Recordings + summary: Get Transcription + description: >- + 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. + operationId: getCallTranscription + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + 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' + post: + tags: + - Recordings + summary: Create Transcription Request + description: >- + Generate the transcription for a specific recording. Transcription + + can succeed only for recordings of length greater than 500 milliseconds + and + + less than 4 hours. + operationId: transcribeCallRecording + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + requestBody: + $ref: '#/components/requestBodies/transcribeRecordingRequest' + responses: + '204': + description: Transcription successfully requested + '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: + - Recordings + summary: Delete Transcription + description: >- + 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. + operationId: deleteCallTranscription + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '204': + description: The transcription was successfully deleted + '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}/statistics: + get: + tags: + - Statistics + summary: Get Account Statistics + description: Returns details about the current state of the account. + operationId: getStatistics + parameters: + - $ref: '#/components/parameters/accountId1' + responses: + '200': + $ref: '#/components/responses/getStatisticsResponse' + '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: + - MFA + summary: Voice Authentication Code + description: Send an MFA Code via a phone call. + operationId: generateVoiceCode + parameters: + - $ref: '#/components/parameters/accountId2' + requestBody: + $ref: '#/components/requestBodies/codeRequest' + responses: + '200': + $ref: '#/components/responses/voiceCodeResponse' + '400': + $ref: '#/components/responses/mfaBadRequestError' + '401': + $ref: '#/components/responses/mfaUnauthorizedError' + '403': + $ref: '#/components/responses/mfaForbiddenError' + '500': + $ref: '#/components/responses/mfaInternalServerError' + servers: &ref_2 + - url: https://mfa.bandwidth.com/api/v1 + description: Production + /accounts/{accountId}/code/messaging: + post: + tags: + - MFA + summary: Messaging Authentication Code + description: Send an MFA code via text message (SMS). + operationId: generateMessagingCode + parameters: + - $ref: '#/components/parameters/accountId2' + requestBody: + $ref: '#/components/requestBodies/codeRequest' + responses: + '200': + $ref: '#/components/responses/messagingCodeResponse' + '400': + $ref: '#/components/responses/mfaBadRequestError' + '401': + $ref: '#/components/responses/mfaUnauthorizedError' + '403': + $ref: '#/components/responses/mfaForbiddenError' + '500': + $ref: '#/components/responses/mfaInternalServerError' + servers: *ref_2 + /accounts/{accountId}/code/verify: + post: + tags: + - MFA + summary: Verify Authentication Code + description: Verify a previously sent MFA code. + operationId: verifyCode + parameters: + - $ref: '#/components/parameters/accountId2' + requestBody: + $ref: '#/components/requestBodies/codeVerify' + responses: + '200': + $ref: '#/components/responses/verifyCodeResponse' + '400': + $ref: '#/components/responses/mfaBadRequestError' + '401': + $ref: '#/components/responses/mfaUnauthorizedError' + '403': + $ref: '#/components/responses/mfaForbiddenError' + '429': + $ref: '#/components/responses/mfaTooManyRequestsError' + '500': + $ref: '#/components/responses/mfaInternalServerError' + servers: *ref_2 + /accounts/{accountId}/tnlookup: + post: + summary: Create Lookup + description: Create a Phone Number Lookup Request. + operationId: createLookup + tags: + - Phone Number Lookup + parameters: + - $ref: '#/components/parameters/accountId3' + requestBody: + $ref: '#/components/requestBodies/createLookupRequest' + responses: + '202': + $ref: '#/components/responses/createLookupResponse' + '400': + $ref: '#/components/responses/tnLookupBadRequestError' + '401': + $ref: '#/components/responses/tnLookupUnauthorizedError' + '403': + $ref: '#/components/responses/tnLookupForbiddenError' + '415': + $ref: '#/components/responses/tnLookupMediaTypeError' + '429': + $ref: '#/components/responses/tnLookupTooManyRequestsError' + '500': + $ref: '#/components/responses/tnLookupInternalServerError' + servers: &ref_3 + - url: https://numbers.bandwidth.com/api/v1 + description: Production + /accounts/{accountId}/tnlookup/{requestId}: + get: + summary: Get Lookup Request Status + description: Get an existing Phone Number Lookup Request. + operationId: getLookupStatus + tags: + - Phone Number Lookup + parameters: + - $ref: '#/components/parameters/accountId3' + - $ref: '#/components/parameters/requestId' + responses: + '200': + $ref: '#/components/responses/getLookupResponse' + '400': + $ref: '#/components/responses/tnLookupBadRequestError' + '401': + $ref: '#/components/responses/tnLookupUnauthorizedError' + '403': + $ref: '#/components/responses/tnLookupForbiddenError' + '404': + description: Not Found + '429': + $ref: '#/components/responses/tnLookupTooManyRequestsError' + '500': + $ref: '#/components/responses/tnLookupInternalServerError' + servers: *ref_3 + /accounts/{accountId}/participants: + post: + tags: + - Participants + summary: Create Participant + description: >- + Create a new participant under this account. Participants are + idempotent, so relevant parameters must be set in this function if + desired. + operationId: createParticipant + parameters: + - $ref: '#/components/parameters/accountId4' + requestBody: + $ref: '#/components/requestBodies/createParticipantRequest' + responses: + '200': + $ref: '#/components/responses/createParticipantResponse' + '400': + $ref: '#/components/responses/webrtcBadRequestError' + '401': + $ref: '#/components/responses/webrtcUnauthorizedError' + '403': + $ref: '#/components/responses/webrtcForbiddenError' + '500': + $ref: '#/components/responses/webrtcInternalServerError' + servers: &ref_4 + - url: https://api.webrtc.bandwidth.com/v1 + description: Production + /accounts/{accountId}/participants/{participantId}: + get: + tags: + - Participants + summary: Get Participant + description: Get participant by ID. + operationId: getParticipant + parameters: + - $ref: '#/components/parameters/accountId4' + - $ref: '#/components/parameters/participantId' + responses: + '200': + $ref: '#/components/responses/getParticipantResponse' + '400': + $ref: '#/components/responses/webrtcBadRequestError' + '401': + $ref: '#/components/responses/webrtcUnauthorizedError' + '403': + $ref: '#/components/responses/webrtcForbiddenError' + '404': + $ref: '#/components/responses/webrtcNotFoundError' + '500': + $ref: '#/components/responses/webrtcInternalServerError' + delete: + tags: + - Participants + summary: Delete Participant + description: Delete participant by ID. + operationId: deleteParticipant + parameters: + - $ref: '#/components/parameters/accountId4' + - $ref: '#/components/parameters/participantId' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/webrtcBadRequestError' + '401': + $ref: '#/components/responses/webrtcUnauthorizedError' + '403': + $ref: '#/components/responses/webrtcForbiddenError' + '404': + $ref: '#/components/responses/webrtcNotFoundError' + '500': + $ref: '#/components/responses/webrtcInternalServerError' + servers: *ref_4 + /accounts/{accountId}/sessions: + post: + tags: + - Sessions + summary: Create Session + description: >- + Create a new session. Sessions are idempotent, so relevant parameters + must be set in this function if desired. + operationId: createSession + parameters: + - $ref: '#/components/parameters/accountId4' + requestBody: + $ref: '#/components/requestBodies/createSessionRequest' + responses: + '200': + $ref: '#/components/responses/sessionResponse' + '400': + $ref: '#/components/responses/webrtcBadRequestError' + '401': + $ref: '#/components/responses/webrtcUnauthorizedError' + '403': + $ref: '#/components/responses/webrtcForbiddenError' + '500': + $ref: '#/components/responses/webrtcInternalServerError' + servers: *ref_4 + /accounts/{accountId}/sessions/{sessionId}: + get: + tags: + - Sessions + summary: Get Session + description: Get session by ID. + operationId: getSession + parameters: + - $ref: '#/components/parameters/accountId4' + - $ref: '#/components/parameters/sessionId' + responses: + '200': + $ref: '#/components/responses/sessionResponse' + '400': + $ref: '#/components/responses/webrtcBadRequestError' + '401': + $ref: '#/components/responses/webrtcUnauthorizedError' + '403': + $ref: '#/components/responses/webrtcForbiddenError' + '404': + $ref: '#/components/responses/webrtcNotFoundError' + '500': + $ref: '#/components/responses/webrtcInternalServerError' + delete: + tags: + - Sessions + summary: Delete Session + description: Delete session by ID. + operationId: deleteSession + parameters: + - $ref: '#/components/parameters/accountId4' + - $ref: '#/components/parameters/sessionId' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/webrtcBadRequestError' + '401': + $ref: '#/components/responses/webrtcUnauthorizedError' + '403': + $ref: '#/components/responses/webrtcForbiddenError' + '404': + $ref: '#/components/responses/webrtcNotFoundError' + '500': + $ref: '#/components/responses/webrtcInternalServerError' + servers: *ref_4 + /accounts/{accountId}/sessions/{sessionId}/participants: + get: + tags: + - Sessions + summary: List Participants in Session + description: List participants in a session. + operationId: listSessionParticipants + parameters: + - $ref: '#/components/parameters/accountId4' + - $ref: '#/components/parameters/sessionId' + responses: + '200': + $ref: '#/components/responses/listSessionParticipantsResponse' + '204': + description: No Content + '400': + $ref: '#/components/responses/webrtcBadRequestError' + '401': + $ref: '#/components/responses/webrtcUnauthorizedError' + '403': + $ref: '#/components/responses/webrtcForbiddenError' + '404': + $ref: '#/components/responses/webrtcNotFoundError' + '500': + $ref: '#/components/responses/webrtcInternalServerError' + servers: *ref_4 + /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}: + put: + tags: + - Sessions + summary: Add Participant to Session + description: | + Add a participant to a session. + + Subscriptions can optionally be provided as part of this call. + operationId: addParticipantToSession + parameters: + - $ref: '#/components/parameters/accountId4' + - $ref: '#/components/parameters/sessionId' + - $ref: '#/components/parameters/participantId' + requestBody: + $ref: '#/components/requestBodies/addParticipantToSessionRequest' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/webrtcBadRequestError' + '401': + $ref: '#/components/responses/webrtcUnauthorizedError' + '403': + $ref: '#/components/responses/webrtcForbiddenError' + '404': + $ref: '#/components/responses/webrtcNotFoundError' + '409': + $ref: '#/components/responses/webrtcConflictError' + '500': + $ref: '#/components/responses/webrtcInternalServerError' + delete: + tags: + - Sessions + summary: Remove Participant from Session + description: >- + Remove a participant from a session. This will automatically remove any + subscriptions the participant has associated with this session. + operationId: removeParticipantFromSession + parameters: + - $ref: '#/components/parameters/accountId4' + - $ref: '#/components/parameters/sessionId' + - $ref: '#/components/parameters/participantId' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/webrtcBadRequestError' + '401': + $ref: '#/components/responses/webrtcUnauthorizedError' + '403': + $ref: '#/components/responses/webrtcForbiddenError' + '404': + $ref: '#/components/responses/webrtcNotFoundError' + '500': + $ref: '#/components/responses/webrtcInternalServerError' + servers: *ref_4 + /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions: + get: + tags: + - Sessions + summary: Get Participant Subscriptions + description: Get a participant's subscriptions. + operationId: getParticipantSubscriptions + parameters: + - $ref: '#/components/parameters/accountId4' + - $ref: '#/components/parameters/sessionId' + - $ref: '#/components/parameters/participantId' + responses: + '200': + $ref: '#/components/responses/getParticipantSubscriptionsResponse' + '204': + description: No Content + '400': + $ref: '#/components/responses/webrtcBadRequestError' + '401': + $ref: '#/components/responses/webrtcUnauthorizedError' + '403': + $ref: '#/components/responses/webrtcForbiddenError' + '404': + $ref: '#/components/responses/webrtcNotFoundError' + '500': + $ref: '#/components/responses/webrtcInternalServerError' + put: + tags: + - Sessions + summary: Update Participant Subscriptions + description: >- + Update a participant's subscriptions. This is a full update that will + replace the participant's subscriptions. It allows subscription to the + entire Session, a subset list of Participants in that Session, or + specific media streams on any of the listed Participants. + + First call `getParticipantSubscriptions` if you need the current + subscriptions. + + Calling this API with no `Subscriptions` object to remove all + subscriptions. + operationId: updateParticipantSubscriptions + parameters: + - $ref: '#/components/parameters/accountId4' + - $ref: '#/components/parameters/sessionId' + - $ref: '#/components/parameters/participantId' + requestBody: + $ref: '#/components/requestBodies/updateParticipantSubscriptionsRequest' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/webrtcBadRequestError' + '401': + $ref: '#/components/responses/webrtcUnauthorizedError' + '403': + $ref: '#/components/responses/webrtcForbiddenError' + '404': + $ref: '#/components/responses/webrtcNotFoundError' + '500': + $ref: '#/components/responses/webrtcInternalServerError' + servers: *ref_4 +components: + schemas: + priorityEnum: + type: string + description: The priority specified by the user. + enum: + - default + - high + example: default + messageStatusEnum: + type: string + description: >- + The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED + DELIVERED ACCEPTED UNDELIVERED. + enum: + - RECEIVED + - QUEUED + - SENDING + - SENT + - FAILED + - DELIVERED + - ACCEPTED + - UNDELIVERED + example: RECEIVED + listMessageDirectionEnum: + type: string + description: The direction of the message. One of INBOUND OUTBOUND. + enum: + - INBOUND + - OUTBOUND + messageDirectionEnum: + type: string + description: The direction of the message. One of in out. + enum: + - in + - out + messageTypeEnum: + type: string + description: The type of message. Either SMS or MMS. + enum: + - sms + - mms + example: sms + fieldError: + type: object + properties: + fieldName: + type: string + description: The name of the field that contains the error + example: from + description: + type: string + description: The error associated with the field + example: >- + '+invalid' must be replaced with a valid E164 formatted telephone + number + messagesList: + title: MessagesList + type: object + properties: + totalCount: + type: integer + description: Total number of messages matched by the search. + example: 100 + pageInfo: + $ref: '#/components/schemas/pageInfo' + messages: + type: array + items: + $ref: '#/components/schemas/listMessageItem' + listMessageItem: + title: listMessageItem + type: object + properties: + messageId: + type: string + description: The message id + example: 1589228074636lm4k2je7j7jklbn2 + accountId: + type: string + description: The account id associated with this message. + example: '9900000' + sourceTn: + type: string + description: The source phone number of the message. + example: '+15554443333' + destinationTn: + type: string + description: The recipient phone number of the message. + example: '+15554442222' + messageStatus: + $ref: '#/components/schemas/messageStatusEnum' + messageDirection: + $ref: '#/components/schemas/listMessageDirectionEnum' + messageType: + $ref: '#/components/schemas/messageTypeEnum' + segmentCount: + type: integer + description: The number of segments the message was sent as. + example: 1 + errorCode: + type: integer + description: The numeric error code of the message. + example: 9902 + receiveTime: + type: string + description: The ISO 8601 datetime of the message. + example: 2020-04-07T14:03:07.000Z + carrierName: + type: string + nullable: true + description: >- + The name of the carrier. Not currently supported for MMS coming + soon. + example: other + messageSize: + type: integer + description: The size of the message including message content and headers. + nullable: true + example: 27 + messageLength: + type: integer + description: The length of the message content. + example: 18 + attachmentCount: + type: integer + description: The number of attachments the message has. + nullable: true + example: 1 + recipientCount: + type: integer + description: The number of recipients the message has. + nullable: true + example: 1 + campaignClass: + type: string + description: The campaign class of the message if it has one. + nullable: true + example: T + pageInfo: + title: PageInfo + type: object + properties: + prevPage: + type: string + description: The link to the previous page for pagination. + example: >- + https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902 + nextPage: + type: string + description: The link to the next page for pagination. + example: >- + https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C + prevPageToken: + type: string + description: The isolated pagination token for the previous page. + example: DLAPE902 + nextPageToken: + type: string + description: The isolated pagination token for the next page. + example: GL83PD3C + messagingRequestError: + title: MessagingRequestError + type: object + properties: + type: + type: string + description: + type: string + required: + - type + - description + createMessageRequestError: + title: CreateMessageRequestError + type: object + properties: + type: + type: string + description: + type: string + fieldErrors: + type: array + items: + $ref: '#/components/schemas/fieldError' + required: + - type + - description + media: + title: Media + type: object + properties: + content: + type: string + contentLength: + type: integer + mediaName: + type: string + tag: + title: Tag + type: object + properties: + key: + type: string + value: + type: string + deferredResult: + title: DeferredResult + type: object + properties: + result: + type: object + setOrExpired: + type: boolean + message: + title: Message + type: object + properties: + id: + type: string + description: The id of the message. + example: 1589228074636lm4k2je7j7jklbn2 + owner: + type: string + description: The Bandwidth phone number associated with the message. + example: '+15554443333' + applicationId: + type: string + description: The application ID associated with the message. + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + description: The datetime stamp of the message in ISO 8601 + example: 2022-09-14T18:20:16.000Z + segmentCount: + type: integer + description: >- + The number of segments the original message from the user is broken + into before sending over to carrier networks. + example: 2 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + description: The phone number recipients of the message. + example: + - '+15552223333' + from: + type: string + description: The phone number the message was sent from. + example: '+15553332222' + media: + uniqueItems: true + type: array + items: + type: string + description: >- + The list of media URLs sent in the message. Including a `filename` + field in the `Content-Disposition` header of the media linked with a + URL will set the displayed file name. This is a best practice to + ensure that your media has a readable file name. + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + text: + type: string + description: The contents of the message. + example: Hello world + tag: + type: string + description: The custom string set by the user. + example: custom tag + priority: + $ref: '#/components/schemas/priorityEnum' + messageRequest: + title: MessageRequest + type: object + required: + - applicationId + - to + - from + properties: + applicationId: + type: string + description: >- + The ID of the Application your from number is associated with in the + Bandwidth Phone Number Dashboard. + example: 93de2206-9669-4e07-948d-329f4b722ee2 + to: + uniqueItems: true + type: array + description: The phone number(s) the message should be sent to in E164 format. + example: + - '+15554443333' + - '+15552223333' + items: + type: string + from: + type: string + description: >- + One of your telephone numbers the message should come from in E164 + format. + example: '+15551113333' + text: + type: string + description: The contents of the text message. Must be 2048 characters or less. + maxLength: 2048 + example: Hello world + media: + type: array + items: + type: string + format: uri + description: >- + A list of URLs to include as media attachments as part of the + message. + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + tag: + type: string + description: >- + A custom string that will be included in callback events of the + message. Max 1024 characters. + example: custom string + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + type: string + description: >- + A string with the date/time value that the message will + automatically expire by. This must be a valid RFC-3339 value, e.g., + 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. + example: '2021-02-01T11:29:18-05:00' + callbackMethodEnum: + type: string + nullable: true + default: POST + enum: + - GET + - POST + description: >- + The HTTP method to use to deliver the callback. GET or POST. Default + value is POST. + example: POST + redirectMethodEnum: + type: string + nullable: true + default: POST + enum: + - GET + - POST + description: >- + The HTTP method to use for the request to `redirectUrl`. GET + + or POST. Default value is POST.

Not allowed if `state` is + `completed` + example: POST + recordingStateEnum: + type: string + enum: + - paused + - recording + description: |- + The recording state. Possible values: + + `paused` to pause an active recording + + `recording` to resume a paused recording + callDirectionEnum: + type: string + enum: + - inbound + - outbound + description: The direction of the call. + fileFormatEnum: + type: string + enum: + - mp3 + - wav + description: The format that the recording is stored in + callStateEnum: + nullable: true + type: string + default: active + enum: + - active + - completed + description: >- + 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 + conferenceStateEnum: + nullable: true + type: string + default: active + enum: + - active + - completed + description: >- + Setting the conference state to `completed` ends the conference and + ejects all members + machineDetectionModeEnum: + type: string + default: async + enum: + - sync + - async + description: >- + 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. + createCall: + type: object + required: + - answerUrl + - applicationId + - from + - to + properties: + to: + type: string + description: |- + The destination to call (must be an E.164 formatted number + (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.com`)). + example: '+19195551234' + from: + type: string + 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' + uui: + nullable: true + type: string + example: >- + eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ=;encoding=base64 + 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. + applicationId: + type: string + description: The id of the application associated with the `from` number. + example: 1234-qwer-5679-tyui + answerUrl: + type: string + format: uri + 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` + maxLength: 2048 + example: https://www.myCallbackServer.com/webhooks/answer + answerMethod: + $ref: '#/components/schemas/callbackMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + answerFallbackUrl: + nullable: true + type: string + format: uri + 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` + maxLength: 2048 + example: https://www.myFallbackServer.com/webhooks/answer + answerFallbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + disconnectUrl: + nullable: true + type: string + format: uri + description: >- + The URL to send the Disconnect event to when + the call ends. This event does not expect a BXML response. + maxLength: 2048 + disconnectMethod: + $ref: '#/components/schemas/callbackMethodEnum' + callTimeout: + nullable: true + type: number + format: double + 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. + minimum: 1 + maximum: 300 + default: 30 + callbackTimeout: + nullable: true + type: number + format: double + 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. + minimum: 1 + maximum: 25 + default: 15 + machineDetection: + $ref: '#/components/schemas/machineDetectionConfiguration' + priority: + nullable: true + type: integer + minimum: 1 + maximum: 5 + 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: + nullable: true + type: string + 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. + maximum: 256 + createCallResponse: + type: object + required: + - accountId + - answerMethod + - answerUrl + - applicationId + - callId + - callUrl + - disconnectMethod + - from + - to + properties: + applicationId: + type: string + example: 04e88489-df02-4e34-a0ee-27a91849555f + description: The id of the application associated with the `from` number. + accountId: + type: string + example: '9900000' + description: The bandwidth account ID associated with the call + callId: + type: string + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + description: Programmable Voice API Call ID + to: + type: string + example: '+19195551234' + description: Recipient of the outgoing call + from: + type: string + example: '+19195554321' + description: Phone number that created the outbound call + enqueuedTime: + nullable: true + type: string + format: date-time + description: Time the call was accepted into the queue + example: '2022-06-16T13:15:07.160Z' + callUrl: + type: string + format: uri + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + description: The URL to update call state + callTimeout: + type: number + format: double + example: 30 + description: >- + The timeout (in seconds) for the callee to answer the call after it + starts ringing. + callbackTimeout: + type: number + format: double + example: 15 + description: >- + This is the timeout (in seconds) to use when delivering webhooks for + the call. + tag: + nullable: true + type: string + example: My custom tag value + description: Custom tag value + answerMethod: + $ref: '#/components/schemas/callbackMethodEnum' + answerUrl: + type: string + format: uri + example: https://myServer.com/bandwidth/webhooks/answer + description: URL to deliver the `answer` event webhook. + answerFallbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + answerFallbackUrl: + nullable: true + type: string + format: uri + example: https://myFallbackServer.com/bandwidth/webhooks/answer + description: Fallback URL to deliver the `answer` event webhook. + disconnectMethod: + $ref: '#/components/schemas/callbackMethodEnum' + disconnectUrl: + nullable: true + type: string + format: uri + example: https://myServer.com/bandwidth/webhooks/disconnect + description: URL to deliver the `disconnect` event webhook. + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + priority: + nullable: true + type: number + format: integer + example: 5 + description: The priority of this call over other calls from your account. + callState: + type: object + properties: + applicationId: + type: string + description: The application id associated with the call. + example: 04e88489-df02-4e34-a0ee-27a91849555f + accountId: + type: string + description: The account id associated with the call. + example: '9900000' + callId: + type: string + description: The programmable voice API call ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + parentCallId: + nullable: true + type: string + description: >- + The A-leg call id, set only if this call is the B-leg of a + [``](/docs/voice/bxml/transfer). + example: c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + to: + type: string + description: >- + The phone number that received the call, in E.164 format (e.g. + +15555555555), or if the call was to a SIP URI, the SIP URI + example: '+19195551234' + from: + type: string + description: >- + The phone number that made the call, in E.164 format (e.g. + +15555555555). + example: '19195554321' + direction: + $ref: '#/components/schemas/callDirectionEnum' + state: + description: >- + The current state of the call. Current possible values are + + `queued`, `initiated`, `answered` and `disconnected`. Additional + states + + may be added in the future, so your application must be tolerant of + unknown + + values. + type: string + example: disconnected + stirShaken: + nullable: true + type: object + description: >- + For inbound calls, the Bandwidth STIR/SHAKEN implementation will + verify the information provided in the inbound invite request + `Identity` header. + + The verification status is stored in the call state `stirShaken` + property as follows. + + + | Property | Description | + + |:------------------|:------------| + + | verstat | (optional) The verification status indicating whether + the verification was successful or not. Possible values are + `TN-Verification-Passed` or `TN-Verification-Failed`. | + + | attestationIndicator | (optional) The attestation level verified + by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` + (gateway). | + + | originatingId | (optional) A unique origination identifier. | + + + Note that these are common properties but that the `stirShaken` + object is free form and can contain other key-value pairs. + + + More information: [Understanding + STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken) + additionalProperties: + type: string + example: + verstat: TN-Verification-Passed + attestationIndicator: A + originatingId: abc123 + identity: + nullable: true + type: string + description: >- + The value of the `Identity` header from the inbound invite + + request. Only present for inbound calls and if the account is + configured + + to forward this header. + example: >- + eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken + enqueuedTime: + nullable: true + type: string + format: date-time + description: The time this call was placed in queue. + example: '2022-06-16T13:15:07.160Z' + startTime: + nullable: true + type: string + format: date-time + description: >- + The time the call was initiated, in ISO 8601 format. `null` if the + call is still in your queue. + example: '2022-06-16T13:15:07.160Z' + answerTime: + nullable: true + type: string + format: date-time + description: >- + Populated once the call has been answered, with the time in ISO 8601 + format. + example: '2022-06-16T13:15:18.126Z' + endTime: + nullable: true + type: string + format: date-time + description: Populated once the call has ended, with the time in ISO 8601 format. + example: '2022-06-16T13:15:18.314Z' + disconnectCause: + nullable: true + type: string + description: >- + | Cause | Description | + + |:------|:------------| + + | `hangup`| One party hung up the call, a + [``](../../bxml/verbs/hangup.md) verb was executed, or there + was no more BXML to execute; it indicates that the call ended + normally. | + + | `busy` | Callee was busy. | + + | `timeout` | Call wasn't answered before the `callTimeout` was + reached. | + + | `cancel` | Call was cancelled by its originator while it was + ringing. | + + | `rejected` | Call was rejected by the callee. | + + | `callback-error` | BXML callback couldn't be delivered to your + callback server. | + + | `invalid-bxml` | Invalid BXML was returned in response to a + callback. | + + | `application-error` | An unsupported action was tried on the call, + e.g. trying to play a .ogg audio. | + + | `account-limit` | Account rate limits were reached. | + + | `node-capacity-exceeded` | System maximum capacity was reached. | + + | `error` | Some error not described in any of the other causes + happened on the call. | + + | `unknown` | Unknown error happened on the call. | + + + Note: This list is not exhaustive and other values can appear in the + future. + errorMessage: + nullable: true + type: string + description: >- + Populated only if the call ended with an error, with text explaining + the reason. + example: null + errorId: + nullable: true + type: string + description: >- + Populated only if the call ended with an error, with a Bandwidth + internal id that references the error event. + example: null + lastUpdate: + type: string + format: date-time + description: The last time the call had a state update, in ISO 8601 format. + example: '2022-06-16T13:15:18.314Z' + updateCall: + type: object + properties: + state: + $ref: '#/components/schemas/callStateEnum' + redirectUrl: + 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`. + nullable: true + type: string + format: uri + example: https://myServer.com/bandwidth/webhooks/redirect + redirectMethod: + $ref: '#/components/schemas/redirectMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + redirectFallbackUrl: + nullable: true + type: string + format: uri + description: |- + A fallback url which, if provided, will be used to retry the + redirect callback delivery in case `redirectUrl` fails to respond + example: https://myFallbackServer.com/bandwidth/webhooks/redirect + redirectFallbackMethod: + $ref: '#/components/schemas/redirectMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + tag: + nullable: true + type: string + 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`. + maximum: 256 + example: My Custom Tag + updateCallRecording: + type: object + required: + - state + properties: + state: + $ref: '#/components/schemas/recordingStateEnum' + accountStatistics: + type: object + properties: + currentCallQueueSize: + type: integer + description: The number of calls currently enqueued. + example: 0 + maxCallQueueSize: + type: integer + description: >- + The maximum size of the queue before outgoing calls start being + rejected. + example: 900 + callRecordingMetadata: + type: object + properties: + applicationId: + $ref: '#/components/schemas/applicationId' + accountId: + $ref: '#/components/schemas/accountId' + callId: + $ref: '#/components/schemas/callId' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + to: + $ref: '#/components/schemas/to' + from: + $ref: '#/components/schemas/from' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + duration: + $ref: '#/components/schemas/duration' + direction: + $ref: '#/components/schemas/callDirectionEnum' + channels: + $ref: '#/components/schemas/channels' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + status: + $ref: '#/components/schemas/status' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + transcription: + $ref: '#/components/schemas/transcriptionMetadata' + conference: + type: object + properties: + id: + type: string + description: The Bandwidth-generated conference ID + example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + name: + type: string + description: The name of the conference, as specified by your application + example: my-conference-name + createdTime: + type: string + format: date-time + description: The time the conference was initiated, in ISO 8601 format. + example: '2022-06-17T22:19:40.375Z' + completedTime: + nullable: true + type: string + format: date-time + description: The time the conference was terminated, in ISO 8601 format. + example: '2022-06-17T22:20:00.000Z' + conferenceEventUrl: + nullable: true + type: string + format: uri + description: The URL to send the conference-related events. + example: https://myServer.com/bandwidth/webhooks/conferenceEvent + conferenceEventMethod: + $ref: '#/components/schemas/callbackMethodEnum' + tag: + nullable: true + type: string + description: >- + The custom string attached to the conference that will be sent with + callbacks. + example: my custom tag + activeMembers: + type: array + nullable: true + items: + $ref: '#/components/schemas/conferenceMember' + 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) + updateConference: + type: object + properties: + status: + $ref: '#/components/schemas/conferenceStateEnum' + redirectUrl: + nullable: true + type: string + format: uri + 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` + example: https://myServer.com/bandwidth/webhooks/conferenceRedirect + redirectMethod: + $ref: '#/components/schemas/redirectMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + redirectFallbackUrl: + nullable: true + type: string + format: uri + 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`. + example: https://myFallbackServer.com/bandwidth/webhooks/conferenceRedirect + redirectFallbackMethod: + $ref: '#/components/schemas/redirectMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + conferenceMember: + type: object + properties: + callId: + $ref: '#/components/schemas/callId' + conferenceId: + $ref: '#/components/schemas/conferenceId' + memberUrl: + type: string + description: >- + A URL that may be used to retrieve information about or update + + the state of this conference member. This is the URL of this + member's + + [Get Conference Member](/apis/voice/#operation/getConferenceMember) + endpoint + + and [Modify Conference + Member](/apis/voice/#operation/updateConferenceMember) + + endpoint. + example: >- + 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: + type: boolean + description: >- + Whether or not this member is currently muted. Members who are muted + are still able to hear other participants. + + + If used in a PUT request, updates this member's mute status. Has no + effect if omitted. + example: false + hold: + type: boolean + description: >- + Whether or not this member is currently on hold. Members who are on + hold are not able to hear or speak in the conference. + + + If used in a PUT request, updates this member's hold status. Has no + effect if omitted. + example: false + callIdsToCoach: + nullable: true + type: array + items: + type: string + description: >- + If this member had a value set for `callIdsToCoach` in its + [Conference](/docs/voice/bxml/conference) verb or this list was + added with a previous PUT request to modify the member, this is that + list of calls. + + + If present in a PUT request, modifies the calls that this member is + coaching. Has no effect if omitted. See the documentation for the + [Conference](/docs/voice/bxml/conference) verb for more details + about coaching. + + Note that this will not add the matching calls to the conference; + each call must individually execute a Conference verb to join. + example: + - c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + updateConferenceMember: + type: object + properties: + mute: + type: boolean + description: >- + Whether or not this member is currently muted. Members who are muted + are still able to hear other participants. + + + Updates this member's mute status. Has no effect if omitted. + example: false + hold: + type: boolean + description: >- + Whether or not this member is currently on hold. Members who are on + hold are not able to hear or speak in the conference. + + + Updates this member's hold status. Has no effect if omitted. + example: false + callIdsToCoach: + nullable: true + type: array + items: + type: string + description: >- + If this member had a value set for `callIdsToCoach` in its + [Conference](/docs/voice/bxml/conference) verb or this list was + added with a previous PUT request to modify the member, this is that + list of calls. + + + Modifies the calls that this member is coaching. Has no effect if + omitted. See the documentation for the + [Conference](/docs/voice/bxml/conference) verb for more details + about coaching. + + + Note that this will not add the matching calls to the conference; + each call must individually execute a Conference verb to join. + example: + - c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + conferenceRecordingMetadata: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + recordingId: + $ref: '#/components/schemas/recordingId' + duration: + $ref: '#/components/schemas/duration' + channels: + $ref: '#/components/schemas/channels' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + status: + $ref: '#/components/schemas/status' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + machineDetectionConfiguration: + type: object + description: >- + The machine detection request used to perform machine detection on the + call. + properties: + mode: + $ref: '#/components/schemas/machineDetectionModeEnum' + detectionTimeout: + nullable: true + type: number + format: double + 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. + default: 15 + example: 15 + silenceTimeout: + nullable: true + type: number + format: double + description: >- + If no speech is detected in this period, a callback with a 'silence' + result is sent. + default: 10 + example: 10 + speechThreshold: + nullable: true + type: number + format: double + 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'. + default: 10 + example: 10 + speechEndThreshold: + nullable: true + type: number + format: double + description: >- + Amount of silence (in seconds) before assuming the callee has + finished speaking. + default: 5 + example: 5 + machineSpeechEndThreshold: + nullable: true + type: number + format: double + 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. + example: 5 + delayResult: + nullable: true + type: boolean + 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. + default: false + example: false + callbackUrl: + nullable: true + description: >- + The URL to send the 'machineDetectionComplete' webhook when the + detection is completed. Only for 'async' mode. + type: string + format: uri + maxLength: 2048 + example: https://myServer.com/bandwidth/webhooks/machineDetectionComplete + callbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + fallbackUrl: + nullable: true + type: string + format: uri + description: >- + A fallback URL which, if provided, will be used to retry the + + machine detection complete webhook delivery in case `callbackUrl` + fails + + to respond + maxLength: 2048 + example: >- + https://myFallbackServer.com/bandwidth/webhooks/machineDetectionComplete + fallbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + transcribeRecording: + type: object + properties: + callbackUrl: + type: string + format: uri + 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. + example: https://myServer.com/bandwidth/webhooks/transcriptionAvailable + callbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + tag: + $ref: '#/components/schemas/tag1' + callbackTimeout: + nullable: true + type: number + format: double + minimum: 1 + maximum: 25 + default: 15 + description: >- + This is the timeout (in seconds) to use when delivering the + + webhook to `callbackUrl`. Can be any numeric value (including + decimals) + + between 1 and 25. + example: 5.5 + transcriptionList: + type: object + properties: + transcripts: + type: array + items: + $ref: '#/components/schemas/transcription' + transcriptionMetadata: + nullable: true + type: object + description: If the recording was transcribed, metadata about the transcription + properties: + id: + type: string + description: The unique transcription ID + example: t-387bd648-18f3-4823-9d16-746bca0003c9 + status: + $ref: '#/components/schemas/status' + completedTime: + type: string + description: The time that the transcription was completed + example: '2022-06-13T18:46:29.715Z' + url: + type: string + format: uri + description: The URL of the [transcription](#operation/getCallTranscription) + example: >- + 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 + voiceApiError: + type: object + properties: + type: + type: string + description: + type: string + id: + nullable: true + type: string + answerCallback: + type: object + description: >- + The Answer event is sent to the answerUrl specified in the createCall + request when an outbound call is answered. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + machineDetectionResult: + $ref: '#/components/schemas/machineDetectionResult' + bridgeCompleteCallback: + type: object + description: >- + If the target call leaves the , then this callback is sent to + the bridgeCompleteUrl, and the BXML returned in it is executed on the + call. If this webhook is sent, the Bridge Target Complete webhook is NOT + sent. This callback is also sent if any problem occurs that prevents the + calls to be bridged. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + bridgeTargetCompleteCallback: + type: object + description: >- + If the originating call leaves the , then this callback is sent + to the bridgeTargetCompleteUrl, and the BXML returned in it is executed + on the target call. If this webhook is sent, the Bridge Complete webhook + is NOT sent. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + conferenceCreatedCallback: + type: object + description: >- + The Conference Created event is fired whenever a new conference that + specified a callbackUrl is created. The response may be either empty or + a BXML document. Only the following verbs are valid for conferences: + PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, + ResumeRecording. Audio verbs will be heard by all members of the + conference. Recordings capture audio from all members who are not muted + or on hold, as well as any audio verbs that are played into the + conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + tag: + $ref: '#/components/schemas/tag1' + conferenceRedirectCallback: + type: object + description: >- + The Conference Redirect event is fired whenever an existing conference + is modified via a POST request made to the /conferences/{conferenceId} + endpoint. The response may be either empty or a BXML document. Only the + following verbs are valid for conferences: PlayAudio, SpeakSentence, + StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio + verbs will be heard by all members of the conference. Recordings capture + audio from all members who are not muted or on hold, as well as any + audio verbs that are played into the conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + tag: + $ref: '#/components/schemas/tag1' + conferenceMemberJoinCallback: + type: object + description: >- + The Conference Member Join event is fired whenever a caller joins a + conference that specified a callbackUrl. The response may be either + empty or a BXML document. Only the following verbs are valid for + conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, + PauseRecording, ResumeRecording. Audio verbs will be heard by all + members of the conference. Recordings capture audio from all members who + are not muted or on hold, as well as any audio verbs that are played + into the conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + tag: + $ref: '#/components/schemas/tag1' + conferenceMemberExitCallback: + type: object + description: >- + The Conference Member Exit event is fired whenever a caller exits a + conference that specified a callbackUrl. The response may be either + empty or a BXML document. Only the following verbs are valid for + conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, + PauseRecording, ResumeRecording. Audio verbs will be heard by all + members of the conference. Recordings capture audio from all members who + are not muted or on hold, as well as any audio verbs that are played + into the conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + tag: + $ref: '#/components/schemas/tag1' + conferenceCompletedCallback: + type: object + description: >- + The Conference Completed event is fired when the last member leaves the + conference. The response to this event may not contain BXML. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + tag: + $ref: '#/components/schemas/tag1' + conferenceRecordingAvailableCallback: + type: object + description: >- + The Conference Recording Available event is sent after a conference + recording has been processed. It indicates that the recording is + available for download. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + accountId: + $ref: '#/components/schemas/accountId' + recordingId: + $ref: '#/components/schemas/recordingId' + channels: + $ref: '#/components/schemas/channels' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + tag: + $ref: '#/components/schemas/tag1' + status: + $ref: '#/components/schemas/status' + disconenctCallback: + type: object + description: The Disconnect event is fired when a call ends, for any reason. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + endTime: + $ref: '#/components/schemas/endTime' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + tag: + $ref: '#/components/schemas/tag1' + dtmfCallback: + type: object + description: >- + The DTMF event is sent for every digit detected after a + verb is executed. You may not respond to this event with BXML. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + direction: + $ref: '#/components/schemas/callDirectionEnum' + digit: + $ref: '#/components/schemas/digit' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + parentCallId: + $ref: '#/components/schemas/parentCallId' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + tag: + $ref: '#/components/schemas/tag1' + gatherCallback: + type: object + description: >- + The gather event is sent after a verb is executed. Its purpose + is to report the gathered digits to the calling application. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + digits: + $ref: '#/components/schemas/digits' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + parentCallId: + $ref: '#/components/schemas/parentCallId' + terminatingDigit: + $ref: '#/components/schemas/terminatingDigit' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + tag: + $ref: '#/components/schemas/tag1' + initiateCallback: + type: object + description: >- + The Initiate event is fired when an inbound call is received for a + Telephone Number on your Account. It is sent to the URL specified in the + application associated with the location (sip-peer) that the called + telephone number belongs to. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + startTime: + $ref: '#/components/schemas/startTime' + diversion: + $ref: '#/components/schemas/diversion' + stirShaken: + $ref: '#/components/schemas/stirShaken' + machineDetectionCompleteCallback: + type: object + description: >- + This event is sent to the url informed when requesting a machine + detection operation. It contains the machine detection operation result, + which can be: human, answering-machine, silence, timeout, error. This + event is not sent when sync answering machine detection mode is chosen. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + machineDetectionResult: + $ref: '#/components/schemas/machineDetectionResult' + recordingCompleteCallback: + type: object + description: >- + The Record Complete event is sent after a verb has executed if + the call is still active. The BXML returned by this callback is executed + next. When the recording is available for download, a Recording + Available event will be sent. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + channels: + $ref: '#/components/schemas/channels' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + recordingAvailableCallback: + type: object + description: >- + The Recording Available event is sent after a recording has been + processed. It indicates that the recording is available for download. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + channels: + $ref: '#/components/schemas/status' + tag: + $ref: '#/components/schemas/tag1' + status: + $ref: '#/components/schemas/status' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + redirectCallback: + type: object + description: >- + The Redirect event is fired when a verb is executed. Its + purpose is to get the next set of verbs from the calling application. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + transcriptionAvailableCallback: + type: object + description: >- + The Transcription Available event is sent when the recording + transcription is available to be downloaded. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + tag: + $ref: '#/components/schemas/tag1' + transcription: + $ref: '#/components/schemas/transcription' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + transferAnswerCallback: + type: object + description: >- + When processing a verb, this event is sent when a called + party (B-leg) answers. The event is sent to the endpoint specified in + the transferAnswerUrl attribute of the tag that answered. + BXML returned by this callback will be executed for the called party + only. After all BXML has been executed, the called party will be bridged + to the original call. Most BXML verbs are allowed in response to a + transferAnswer event, but some are not allowed. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + transferCompleteCallback: + type: object + description: >- + This event is sent to the transferCompleteUrl of the A-leg's + verb when the transferred call (B-leg) completes. In a simultaneous + ringing scenario, only one B-leg succeeds and this event corresponds to + that successful leg. If none of the calls were answered, the + transferComplete event corresponds to one of the legs. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + transferDisconnectCallback: + type: object + description: >- + This event is sent to the transferDisconnectUrl of each + tag when its respective call leg ends for any reason. The event is sent + in the normal case, when the transferred leg is answered and later hung + up, but is also sent if the new leg was never answered in the first + place, if it was rejected, and if the original call leg hung up before + the transferred leg. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + endTime: + $ref: '#/components/schemas/endTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + eventType: + type: string + description: >- + The event type, value can be one of the following: answer, + bridgeComplete, bridgeTargetComplete, conferenceCreated, + conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, + conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, + gather, initiate, machineDetectionComplete, recordingComplete, + recordingAvailable, redirect, transcriptionAvailable, transferAnswer, + transferComplete, transferDisconnect. + example: bridgeComplete + eventTime: + type: string + 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. + accountId: + type: string + description: The user account associated with the call. + example: '920012' + applicationId: + type: string + description: The id of the application associated with the call. + example: 04e88489-df02-4e34-a0ee-27a91849555f + to: + type: string + description: >- + The phone number that received the call, in E.164 format (e.g. + +15555555555). + example: '+15555555555' + 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. + example: '+15555555555' + conferenceId: + type: string + description: The unique, Bandwidth-generated ID of the conference that was recorded + example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + name: + type: string + description: The user-specified name of the conference that was recorded + example: my-conference-name + recordingId: + type: string + description: The unique ID of this recording + example: r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833 + duration: + type: string + description: The duration of the recording in ISO-8601 format + example: PT13.67S + channels: + type: integer + format: int32 + description: >- + Always `1` for conference recordings; multi-channel recordings are not + supported on conferences. + example: 1 + digit: + type: string + description: The digit collected in the call. + example: '2' + digits: + type: string + description: >- + (optional) The digits, letters, and/or symbols entered by the user. The + string is empty if a timeout occurred before any buttons were pressed. + example: '123' + terminatingDigit: + type: string + description: >- + (optional) The digit the user pressed to end the gather. Empty string + value if no terminating digit was pressed. + example: '#' + startTime: + type: string + format: date-time + description: Time the call was started, in ISO 8601 format. + example: '2022-06-17T22:19:40.375Z' + enqueuedTime: + type: string + format: date-time + description: >- + (optional) If call queueing is enabled and this is an outbound call, + time the call was queued, in ISO 8601 format. + example: '2022-06-17T22:20:00.000Z' + nullable: true + answerTime: + type: string + format: date-time + description: Time the call was answered, in ISO 8601 format. + example: '2022-06-17T22:20:00.000Z' + nullable: true + endTime: + type: string + format: date-time + description: The time that the recording ended in ISO-8601 format + example: '2022-06-17T22:20:00.000Z' + status: + type: string + 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. + example: completed + transferCallerId: + 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. + 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) + mediaUrl: + nullable: true + type: string + format: uri + description: >- + The URL that can be used to download the recording. Only present if the + recording is finished and may be downloaded. + example: >- + 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 + callId: + type: string + description: The call id associated with the event. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + callUrl: + type: string + description: The URL of the call associated with the event. + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + parentCallId: + type: string + 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. + example: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d + tag1: + type: string + description: >- + (optional) The tag specified on call creation. If no tag was specified + or it was previously cleared, this field will not be present. + example: exampleTag + nullable: true + cause: + type: string + description: >- + Reason the call failed - hangup, busy, timeout, cancel, rejected, + callback-error, invalid-bxml, application-error, account-limit, + node-capacity-exceeded, error, or unknown. + example: busy + errorMessage: + type: string + description: >- + Text explaining the reason that caused the call to fail in case of + errors. + example: >- + Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged + with another call + nullable: true + errorId: + type: string + description: Bandwidth's internal id that references the error event. + example: 4642074b-7b58-478b-96e4-3a60955c6765 + nullable: true + machineDetectionResult: + type: string + description: >- + (optional) if machine detection was requested in sync mode, the result + will be specified here. Possible values are the same as the async + counterpart: Machine Detection Complete + properties: + value: + type: string + description: >- + Possible values are answering-machine, human, silence, timeout, or + error. + example: answering-machine + duration: + type: string + description: The amount of time it took to determine the result. + example: PT4.9891287S + nullable: true + diversion: + type: object + properties: + reason: + type: string + description: >- + The reason for the diversion. Common values: unknown, user-busy, + no-answer, unavailable, unconditional, time-of-day, do-not-disturb, + deflection, follow-me, out-of-service, away. + example: unavailable + privacy: + type: string + description: off or full + example: 'off' + screen: + type: string + description: >- + No if the number was provided by the user, yes if the number was + provided by the network + example: 'no' + counter: + type: string + description: The number of diversions that have occurred + example: '2' + limit: + type: string + description: The maximum number of diversions allowed for this session + example: '3' + unknown: + type: string + description: >- + The normal list of values is not exhaustive. Your application must + be tolerant of unlisted keys and unlisted values of those keys. + example: unknownValue + origTo: + type: string + description: >- + Always present. Indicates the last telephone number that the call + was diverted from. + example: '+15558884444' + transcription: + type: object + properties: + text: + type: string + description: The transcribed text + example: Nice talking to you, friend! + confidence: + type: number + format: double + description: >- + The confidence on the recognized content, ranging from `0.0` to + `1.0` with `1.0` being the highest confidence. + example: 0.9 + stirShaken: + type: object + properties: + verstat: + type: string + description: >- + (optional) The verification status indicating whether the + verification was successful or not. Possible values are + TN-Verification-Passed and TN-Verification-Failed. + example: Tn-Verification-Passed + attestationIndicator: + type: string + description: >- + (optional) The attestation level verified by Bandwidth. Possible + values are A (full), B (partial) or C (gateway). + example: A + originatingId: + type: string + description: (optional) A unique origination identifier. + example: 99759086-1335-11ed-9bcf-5f7d464e91af + codeRequest: + type: object + properties: + to: + type: string + description: The phone number to send the mfa code to. + pattern: ^\+[1-9]\d{1,14}$ + example: '+19195551234' + from: + type: string + description: The application phone number, the sender of the mfa code. + pattern: ^\+[1-9]\d{1,14}$ + maxLength: 32 + example: '+19195554321' + applicationId: + type: string + description: The application unique ID, obtained from Bandwidth. + maxLength: 50 + example: 66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1 + scope: + type: string + description: >- + An optional field to denote what scope or action the mfa code is + addressing. If not supplied, defaults to "2FA". + maxLength: 25 + example: 2FA + message: + type: string + description: >- + The message format of the mfa code. There are three values that the + system will replace "{CODE}", "{NAME}", "{SCOPE}". The "{SCOPE}" + and "{NAME} value template are optional, while "{CODE}" must be + supplied. As the name would suggest, code will be replace with the + actual mfa code. Name is replaced with the application name, + configured during provisioning of mfa. The scope value is the same + value sent during the call and partitioned by the server. + maxLength: 2048 + example: Your temporary {NAME} {SCOPE} code is {CODE} + digits: + type: integer + description: >- + The number of digits for your mfa code. The valid number ranges + from 2 to 8, inclusively. + minimum: 4 + maximum: 8 + example: 6 + required: + - to + - from + - applicationId + - message + - digits + voiceCodeResponse: + type: object + properties: + callId: + type: string + description: Programmable Voice API Call ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + messagingCodeResponse: + type: object + properties: + messageId: + type: string + description: Messaging API Message ID. + example: 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 + verifyCodeRequest: + type: object + properties: + to: + type: string + description: The phone number to send the mfa code to. + pattern: ^\+[1-9]\d{1,14}$ + example: '+19195551234' + scope: + type: string + description: >- + An optional field to denote what scope or action the mfa code is + addressing. If not supplied, defaults to "2FA". + example: 2FA + expirationTimeInMinutes: + type: number + description: >- + The time period, in minutes, to validate the mfa code. By setting + this to 3 minutes, it will mean any code generated within the last 3 + minutes are still valid. The valid range for expiration time is + between 0 and 15 minutes, exclusively and inclusively, respectively. + minimum: 1 + maximum: 15 + example: 3 + code: + type: string + description: The generated mfa code to check if valid. + minLength: 4 + maxLength: 8 + example: '123456' + required: + - to + - expirationTimeInMinutes + - code + verifyCodeResponse: + type: object + properties: + valid: + type: boolean + description: Whether or not the supplied code is valid. + example: true + mfaRequestError: + type: object + properties: + error: + type: string + description: A message describing the error with your request. + example: 400 Request is malformed or invalid + requestId: + type: string + description: The associated requestId from AWS. + example: 354cc8a3-6701-461e-8fa7-8671703dd898 + mfaUnauthorizedRequestError: + type: object + properties: + message: + type: string + description: Unauthorized + example: Unauthorized + mfaForbiddenRequestError: + type: object + properties: + message: + type: string + description: >- + The message containing the reason behind the request being + forbidden. + example: Missing Authentication Token + lookupStatusEnum: + type: string + description: >- + The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or + FAILED). + enum: + - IN_PROGRESS + - COMPLETE + - PARTIAL_COMPLETE + - FAILED + example: COMPLETE + lookupRequest: + type: object + description: Create phone number lookup request. + properties: + tns: + type: array + items: + type: string + required: + - tns + createLookupResponse: + type: object + description: >- + The request has been accepted for processing but not yet finished and in + a terminal state (COMPLETE, PARTIAL_COMPLETE, or FAILED). + properties: + requestId: + type: string + description: The phone number lookup request ID from Bandwidth. + status: + $ref: '#/components/schemas/lookupStatusEnum' + lookupStatus: + type: object + description: >- + If requestId exists, the result for that request is returned. See the + Examples for details on the various responses that you can receive. + Generally, if you see a Response Code of 0 in a result for a TN, + information will be available for it. Any other Response Code will + indicate no information was available for the TN. + properties: + requestId: + type: string + description: The requestId. + example: 004223a0-8b17-41b1-bf81-20732adf5590 + status: + $ref: '#/components/schemas/lookupStatusEnum' + result: + type: array + description: The carrier information results for the specified telephone number. + items: + $ref: '#/components/schemas/lookupResult' + failedTelephoneNumbers: + type: array + description: The telephone numbers whose lookup failed. + items: + type: string + example: + - '+191955512345' + lookupResult: + type: object + description: Carrier information results for the specified telephone number. + properties: + Response Code: + type: integer + description: Our vendor's response code. + example: 0 + Message: + type: string + description: Message associated with the response code. + example: NOERROR + E.164 Format: + type: string + description: The telephone number in E.164 format. + example: '+19195551234' + Formatted: + type: string + description: The formatted version of the telephone number. + example: (919) 555-1234 + Country: + type: string + description: The country of the telephone number. + example: US + Line Type: + type: string + description: The line type of the telephone number. + example: Mobile + Line Provider: + type: string + description: The messaging service provider of the telephone number. + example: Verizon Wireless + Mobile Country Code: + type: string + description: The first half of the Home Network Identity (HNI). + example: '310' + Mobile Network Code: + type: string + description: The second half of the HNI. + example: '010' + tnLookupRequestError: + type: object + properties: + message: + type: string + description: A description of what validation error occurred. + example: example error message + publishPermissionsEnum: + type: string + enum: + - AUDIO + - VIDEO + deviceApiVersionEnum: + type: string + description: Optional field to define the device api version of this participant. + example: V3 + default: V3 + enum: + - V3 + session: + type: object + description: Session object. + properties: + id: + type: string + description: Unique id of the session. + example: 75c21163-e110-41bc-bd76-1bb428ec85d5 + tag: + type: string + description: User defined tag to associate with the session. + example: session1 + participant: + type: object + description: Participant object. + properties: + id: + type: string + description: Unique id of the participant. + readOnly: true + example: 320e2af6-13ec-498d-8b51-daba52c37853 + callbackUrl: + type: string + nullable: true + description: Full callback url to use for notifications about this participant. + example: https://example.com/callback + publishPermissions: + type: array + description: Defines if this participant can publish audio or video. + example: + - VIDEO + - AUDIO + uniqueItems: true + items: + $ref: '#/components/schemas/publishPermissionsEnum' + sessions: + type: array + description: |- + List of session ids this participant is associated with + + Capped to one + + Upon creation of a Participant, returns as an empty array. + example: + - 75c21163-e110-41bc-bd76-1bb428ec85d5 + readOnly: true + items: + type: string + subscriptions: + $ref: '#/components/schemas/subscriptions' + tag: + type: string + description: User defined tag to associate with the participant. + example: participant1 + deviceApiVersion: + $ref: '#/components/schemas/deviceApiVersionEnum' + createParticipantResponse: + type: object + description: Response generated when a Participant is created. + properties: + participant: + $ref: '#/components/schemas/participant' + token: + type: string + example: >- + eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiaWF0IjoxNTE2MjM5MDIyfQ.L8i6g3PfcHlioHCCPURC9pmXT7gdJpx3kOoyAfNUwCc + description: >- + Auth token for the returned participant. This should be passed to + the participant so that they can connect to the platform. + createParticipantRequest: + type: object + description: Create a participant request. + properties: + callbackUrl: + type: string + nullable: true + description: Full callback url to use for notifications about this participant. + example: https://example.com/callback + publishPermissions: + type: array + description: Defines if this participant can publish audio or video. + example: + - VIDEO + - AUDIO + uniqueItems: true + items: + $ref: '#/components/schemas/publishPermissionsEnum' + tag: + type: string + description: User defined tag to associate with the participant. + example: participant1 + deviceApiVersion: + $ref: '#/components/schemas/deviceApiVersionEnum' + subscriptions: + type: object + readOnly: true + properties: + sessionId: + type: string + description: >- + If present, and not overridden by the array of participants, it + represents the session the subscriptions are associated with. If + this is the only field, the subscriber will be subscribed to all + participants in the session (including any participants that are + later added to the session). Upon creation of a Participant, returns + as an empty object. + example: d8886aad-b956-4e1b-b2f4-d7c9f8162772 + participants: + type: array + description: >- + (optional) A list of participants in the session that will be + subscribed to. If present and not empty or null, this will + override any sessionId specified in the body. Returns empty if used + during the creation of a Participant. + example: + - participantId: 568749d5-04d5-483d-adf5-deac7dd3d521 + - participantId: 0275e47f-dd21-4cf0-a1e1-dfdc719e73a7 + streamAliases: + - alias_1 + - alias_2 + items: + $ref: '#/components/schemas/participantSubscription' + participantSubscription: + type: object + required: + - participantId + properties: + participantId: + type: string + description: The Participant the subscriber will be subscribed to + example: 568749d5-04d5-483d-adf5-deac7dd3d521 + streamAliases: + type: array + description: >- + (optional) An array of specific streamAliases owned by the + Participant that the subscriber will be subscribed to. Background: A + streamAlias is created by a WebRTC client when it connects and + declares a name for the related stream. The client is responsible + for informing the application of any created streamAliases to enable + the application to subscribe to specific streamAliases. Subscribing + to a `streamAlias` that does not exist is undefined. If the array is + empty all aliases are assumed. + example: + - alias_1 + - alias_2 + uniqueItems: true + items: + type: string + requestError: + type: object + properties: + error: + type: string + description: A message describing the error with your request. + example: Internal error + requestId: + type: string + description: The associated requestId from AWS. + example: 12af78d1-5f88-4917-925d-17c1ac8fda7a + unauthorizedRequest: + type: object + properties: + message: + type: string + description: Unauthorized + example: Unauthorized + forbiddenRequest: + type: object + properties: + message: + type: string + description: >- + The message containing the reason behind the request being + forbidden. + example: Missing Authentication Token + responses: + createMessageResponse: + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/message' + listMessagesResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/messagesList' + getMediaResponse: + description: OK + content: + application/octet-stream: + schema: + type: string + description: Successful Operation + format: binary + listMediaResponse: + description: OK + headers: + Continuation-Token: + description: Continuation token used to retrieve subsequent media. + schema: + type: string + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/media' + messagingBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + createMessageBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/createMessageRequestError' + messagingUnauthorizedError: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingForbiddenError: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingNotFoundError: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingInvalidMediaTypeError: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingTooManyRequestsError: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingInternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + createCallResponse: + description: Call Successfully Created + headers: + Location: + description: The URL for further interactions with this call + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/createCallResponse' + examples: + createCall Response: + $ref: '#/components/examples/createCallResponseExample' + getCallStateResponse: + description: Call found + content: + application/json: + schema: + $ref: '#/components/schemas/callState' + getStatisticsResponse: + description: Statistics Found + content: + application/json: + schema: + $ref: '#/components/schemas/accountStatistics' + listCallRecordingsResponse: + description: Recordings retrieved successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/callRecordingMetadata' + getCallRecordingResponse: + description: Recording found + content: + application/json: + schema: + $ref: '#/components/schemas/callRecordingMetadata' + downloadRecordingMediaResponse: + description: Media found + content: + audio/vnd.wave: + schema: + type: string + format: binary + audio/mpeg: + schema: + type: string + format: binary + getCallTranscriptionResponse: + description: Transcription found + content: + application/json: + schema: + $ref: '#/components/schemas/transcriptionList' + listConferencesResponse: + description: Conferences retrieved successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/conference' + examples: + listConferences Response: + $ref: '#/components/examples/listConferencesResponseExample' + getConferenceResponse: + description: Conferences retrieved successfully + content: + application/json: + schema: + $ref: '#/components/schemas/conference' + getConferenceMemberResponse: + description: Conference member found + content: + application/json: + schema: + $ref: '#/components/schemas/conferenceMember' + listConferenceRecordingsResponse: + description: Conference recordings retrieved successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/conferenceRecordingMetadata' + getConferenceRecordingResponse: + description: Conference recording found + content: + application/json: + schema: + $ref: '#/components/schemas/conferenceRecordingMetadata' + voiceBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + badRequestErrorExample: + $ref: '#/components/examples/voiceBadRequestErrorExample' + voiceUnauthorizedError: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + unauthorizedErrorExample: + $ref: '#/components/examples/voiceUnauthorizedErrorExample' + voiceForbiddenError: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + forbiddenErrorExample: + $ref: '#/components/examples/voiceForbiddenErrorExample' + voiceNotFoundError: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + notFoundErrorExample: + $ref: '#/components/examples/voiceNotFoundErrorExample' + voiceNotAllowedError: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + notAllowedErrorExample: + $ref: '#/components/examples/voiceNotAllowedErrorExample' + voiceConflictError: + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + conflictErrorExample: + $ref: '#/components/examples/voiceConflictErrorExample' + voiceUnsupportedMediaTypeError: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceUnsupportedMediaTypeErrorExample' + voiceTooManyRequestsError: + description: Too Many Requests + headers: + Retry-After: + description: When you should try your request again + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceTooManyRequestsErrorExample' + voiceInternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + internalServerErrorExample: + $ref: '#/components/examples/voiceInternalServerErrorExample' + voiceCodeResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/voiceCodeResponse' + messagingCodeResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/messagingCodeResponse' + verifyCodeResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/verifyCodeResponse' + mfaBadRequestError: + description: Bad Request + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaRequestError' + mfaUnauthorizedError: + description: Unauthorized + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaUnauthorizedRequestError' + mfaForbiddenError: + description: Forbidden + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaForbiddenRequestError' + mfaTooManyRequestsError: + description: Too Many Requests + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaRequestError' + mfaInternalServerError: + description: Internal Server Error + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaRequestError' + createLookupResponse: + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/createLookupResponse' + examples: + lookupResponseExample: + $ref: '#/components/examples/lookupInProgressExample' + getLookupResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/lookupStatus' + examples: + lookupInProgressExample: + $ref: '#/components/examples/lookupInProgressExample' + lookupFailedExample: + $ref: '#/components/examples/lookupFailedExample' + lookupSingleNumberCompleteExample: + $ref: '#/components/examples/lookupSingleNumberCompleteExample' + lookupMultipleNumbersCompleteExample: + $ref: '#/components/examples/lookupMultipleNumbersCompleteExample' + lookupMultipleNumbersPartialCompleteExample: + $ref: >- + #/components/examples/lookupMultipleNumbersPartialCompleteExample + lookupSingleNumberCompleteNoInfoExample: + $ref: '#/components/examples/lookupSingleNumberCompleteNoInfoExample' + tnLookupBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/tnLookupRequestError' + examples: + badRequest: + summary: Example Bad Request Error + value: + message: 'Some tns do not match e164 format: 1234' + tnLookupUnauthorizedError: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/tnLookupRequestError' + examples: + unauthorized: + summary: Example Unauthorized Error + value: + message: Unauthorized + tnLookupForbiddenError: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/tnLookupRequestError' + examples: + forbidden: + summary: Example Forbidden Error + value: + message: >- + Authorization header requires 'Credential' parameter. + Authorization header requires 'Signature' parameter. + Authorization header requires 'SignedHeaders' parameter. + Authorization header requires existence of either a + 'X-Amz-Date' or a 'Date' header. Authorization=Basic + Y2tvZloPTGhHgywYIzGlcGVlcGvvcGovYTIGIt==' + tnLookupMediaTypeError: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/tnLookupRequestError' + examples: + mediaType: + summary: Example Unsupported Media Type Error + value: + message: Content-Type must be application/json. + tnLookupTooManyRequestsError: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/tnLookupRequestError' + examples: + mediaType: + summary: Example Too Many Requests Error + value: + message: Too many requests. + tnLookupInternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/tnLookupRequestError' + examples: + mediaType: + summary: Example Internal Server Error Error + value: + message: Request has not been passed further. + createParticipantResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/createParticipantResponse' + getParticipantResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/participant' + sessionResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/session' + listSessionParticipantsResponse: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/participant' + getParticipantSubscriptionsResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/subscriptions' + webrtcBadRequestError: + description: Bad Request + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/requestError' + webrtcUnauthorizedError: + description: Unauthorized + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/unauthorizedRequest' + webrtcForbiddenError: + description: Forbidden + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/forbiddenRequest' + webrtcNotFoundError: + description: Not Found + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/requestError' + webrtcConflictError: + description: Conflict + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/requestError' + webrtcInternalServerError: + description: Internal Server Error + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/requestError' + parameters: + accountId: + in: path + name: accountId + required: true + schema: + type: string + description: Your Bandwidth Account ID. + example: '9900000' + mediaId: + in: path + name: mediaId + required: true + description: Media ID to retrieve. + example: 14762070468292kw2fuqty55yp2b2/0/bw.png + schema: + type: string + contentType: + in: header + name: Content-Type + style: simple + explode: false + description: The media type of the entity-body. + example: audio/wav + schema: + type: string + cacheControl: + in: header + name: Cache-Control + style: simple + explode: false + description: >- + General-header field is used to specify directives that MUST be obeyed + by all caching mechanisms along the request/response chain. + example: no-cache + schema: + type: string + continuationToken: + in: header + name: Continuation-Token + description: Continuation token used to retrieve subsequent media. + example: >- + 1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39 + schema: + type: string + messageId: + in: query + name: messageId + required: false + description: >- + The ID of the message to search for. Special characters need to be + encoded using URL encoding. Message IDs could come in different formats, + e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and + 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that + you must include at least one query parameter. + example: 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 + schema: + type: string + sourceTn: + in: query + name: sourceTn + required: false + description: >- + The phone number that sent the message. Accepted values are: a single + full phone number a comma separated list of full phone numbers (maximum + of 10) or a single partial phone number (minimum of 5 characters e.g. + '%2B1919'). + example: '%2B15554443333' + schema: + type: string + destinationTn: + in: query + name: destinationTn + required: false + description: >- + The phone number that received the message. Accepted values are: a + single full phone number a comma separated list of full phone numbers + (maximum of 10) or a single partial phone number (minimum of 5 + characters e.g. '%2B1919'). + example: '%2B15554443333' + schema: + type: string + messageStatus: + in: query + name: messageStatus + required: false + description: >- + The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED + DELIVERED ACCEPTED UNDELIVERED. + schema: + $ref: '#/components/schemas/messageStatusEnum' + messageDirection: + in: query + name: messageDirection + required: false + description: The direction of the message. One of INBOUND OUTBOUND. + schema: + $ref: '#/components/schemas/listMessageDirectionEnum' + carrierName: + in: query + name: carrierName + required: false + description: >- + The name of the carrier used for this message. Possible values include + but are not limited to Verizon and TMobile. Special characters need to + be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + example: Verizon + schema: + type: string + messageType: + in: query + name: messageType + required: false + description: The type of message. Either sms or mms. + schema: + $ref: '#/components/schemas/messageTypeEnum' + errorCode: + in: query + name: errorCode + required: false + description: The error code of the message. + example: 9902 + schema: + type: integer + fromDateTime: + in: query + name: fromDateTime + required: false + description: >- + The start of the date range to search in ISO 8601 format. Uses the + message receive time. The date range to search in is currently 14 days. + example: 2022-09-14T18:20:16.000Z + schema: + type: string + toDateTime: + in: query + name: toDateTime + required: false + description: >- + The end of the date range to search in ISO 8601 format. Uses the message + receive time. The date range to search in is currently 14 days. + example: 2022-09-14T18:20:16.000Z + schema: + type: string + sort: + in: query + name: sort + required: false + description: >- + The field and direction to sort by combined with a colon. Direction is + either asc or desc. + example: sourceTn:desc + schema: + type: string + pageToken: + in: query + name: pageToken + required: false + description: A base64 encoded value used for pagination of results. + example: gdEewhcJLQRB5 + schema: + type: string + limit: + in: query + name: limit + required: false + description: >- + The maximum records requested in search result. Default 100. The sum of + limit and after cannot be more than 10000. + schema: + type: integer + example: 50 + accountId1: + name: accountId + in: path + required: true + schema: + type: string + description: Your Bandwidth Account ID + example: '9900000' + callId: + name: callId + in: path + required: true + schema: + type: string + description: Programmable Voice API Call ID + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + recordingId: + name: recordingId + in: path + required: true + schema: + type: string + description: Programmable Voice API Recording ID + example: r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + conferenceId: + name: conferenceId + in: path + required: true + schema: + type: string + description: Programmable Voice API Conference ID + example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + memberId: + name: memberId + in: path + required: true + schema: + type: string + description: Programmable Voice API Conference Member ID + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + to: + name: to + in: query + required: false + schema: + type: string + description: Filter results by the `to` field. + example: '%2b19195551234' + from: + name: from + in: query + required: false + schema: + type: string + description: Filter results by the `from` field. + example: '%2b19195554321' + name: + name: name + in: query + required: false + schema: + type: string + description: Filter results by the `name` field. + example: my-custom-name + minCreatedTime: + name: minCreatedTime + in: query + required: false + schema: + type: string + description: >- + Filter results to conferences which have a `createdTime` after or at + `minCreatedTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + maxCreatedTime: + name: maxCreatedTime + in: query + required: false + schema: + type: string + description: >- + Filter results to conferences which have a `createdTime` before or at + `maxCreatedTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + minStartTime: + name: minStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to recordings which have a `startTime` after or including + `minStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + maxStartTime: + name: maxStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to recordings which have a `startTime` before + `maxStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + pageSize: + name: pageSize + in: query + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 1000 + default: 1000 + description: Specifies the max number of conferences that will be returned. + example: 500 + pageToken1: + name: pageToken + in: query + required: false + schema: + type: string + 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. + accountId2: + name: accountId + description: Bandwidth Account ID with Voice service enabled. + in: path + required: true + style: simple + explode: false + schema: + type: string + accountId3: + name: accountId + in: path + required: true + schema: + type: string + description: The ID of the Bandwidth account that the user belongs to. + example: '9900000' + requestId: + name: requestId + in: path + required: true + schema: + type: string + description: The phone number lookup request ID from Bandwidth. + example: 004223a0-8b17-41b1-bf81-20732adf5590 + accountId4: + name: accountId + in: path + description: Account ID + required: true + schema: + type: string + example: '9900000' + sessionId: + name: sessionId + in: path + description: Session ID + required: true + schema: + type: string + example: cb5054ee-a69b-41ac-9ab2-04d6370826b4 + participantId: + name: participantId + in: path + description: Participant ID + required: true + schema: + type: string + example: 62e0ecb9-0b1b-5115-aae4-4f36123d6bb1 + requestBodies: + createMessageRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/messageRequest' + required: true + uploadMediaRequest: + content: + application/json: + schema: + type: string + format: binary + application/ogg: + schema: + type: string + format: binary + application/pdf: + schema: + type: string + format: binary + application/rtf: + schema: + type: string + format: binary + application/zip: + schema: + type: string + format: binary + application/x-tar: + schema: + type: string + format: binary + application/xml: + schema: + type: string + format: binary + application/gzip: + schema: + type: string + format: binary + application/x-bzip2: + schema: + type: string + format: binary + application/x-gzip: + schema: + type: string + format: binary + application/smil: + schema: + type: string + format: binary + application/javascript: + schema: + type: string + format: binary + audio/mp4: + schema: + type: string + format: binary + audio/mpeg: + schema: + type: string + format: binary + audio/ogg: + schema: + type: string + format: binary + audio/flac: + schema: + type: string + format: binary + audio/webm: + schema: + type: string + format: binary + audio/wav: + schema: + type: string + format: binary + audio/amr: + schema: + type: string + format: binary + audio/3gpp: + schema: + type: string + format: binary + image/bmp: + schema: + type: string + format: binary + image/gif: + schema: + type: string + format: binary + image/jpeg: + schema: + type: string + format: binary + image/pjpeg: + schema: + type: string + format: binary + image/png: + schema: + type: string + format: binary + image/svg+xml: + schema: + type: string + format: binary + image/tiff: + schema: + type: string + format: binary + image/webp: + schema: + type: string + format: binary + image/x-icon: + schema: + type: string + format: binary + text/css: + schema: + type: string + format: binary + text/csv: + schema: + type: string + format: binary + text/calendar: + schema: + type: string + format: binary + text/plain: + schema: + type: string + format: binary + text/javascript: + schema: + type: string + format: binary + text/vcard: + schema: + type: string + format: binary + text/vnd.wap.wml: + schema: + type: string + format: binary + text/xml: + schema: + type: string + format: binary + video/avi: + schema: + type: string + format: binary + video/mp4: + schema: + type: string + format: binary + video/mpeg: + schema: + type: string + format: binary + video/ogg: + schema: + type: string + format: binary + video/quicktime: + schema: + type: string + format: binary + video/webm: + schema: + type: string + format: binary + video/x-ms-wmv: + schema: + type: string + format: binary + required: true + createCallRequest: + description: JSON object containing information to create an outbound call + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/createCall' + updateCallRequest: + description: >- + JSON object containing information to redirect an existing call to a new + BXML document + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateCall' + updateCallBxmlRequest: + required: true + content: + application/xml: + schema: + type: string + description: A valid BXML document to replace the call's current BXML. + examples: + speakSentence: + summary: Speak Sentence + value: |- + + + This is a test sentence. + + redirectUrl: + summary: Redirect + value: |- + + + + + updateCallRecordingRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateCallRecording' + transcribeRecordingRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/transcribeRecording' + updateConferenceRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateConference' + updateConferenceBxmlRequest: + required: true + content: + application/xml: + schema: + type: string + description: A valid BXML document to replace the call's current BXML. + examples: + stopRecording: + summary: Stop Recording + value: |- + + + + + updateConferenceMemberRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateConferenceMember' + codeRequest: + description: MFA code request body. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/codeRequest' + codeVerify: + description: MFA code verify request body. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/verifyCodeRequest' + createLookupRequest: + description: Phone number lookup request. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/lookupRequest' + examples: + singleNumberRequestExample: + $ref: '#/components/examples/singleNumberRequestExample' + multipleNumberRequestExample: + $ref: '#/components/examples/multipleNumberRequestExample' + createParticipantRequest: + description: Create participant request body. + content: + application/json: + schema: + $ref: '#/components/schemas/createParticipantRequest' + createSessionRequest: + description: Create session request body. + content: + application/json: + schema: + $ref: '#/components/schemas/session' + addParticipantToSessionRequest: + description: >- + The Body describes an optional set of subscriptions to apply to the + participant. + + + Calling this endpoint with no/empty body will only add the participant + to the session, and will not subscribe the Participant to any media. + + + The request body for this endpoint is OPTIONAL and provided as a + convenience to avoid additional calls to the Update Participant + Subscriptions endpoint. --- If a body is provided it will result in + direct control over what Participants are subscribed to. + + - if the participants Array is provided and not empty, that list of Participants will be subscribed To + - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session + - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/subscriptions' + updateParticipantSubscriptionsRequest: + description: >- + The body describes the desired subscriptions for the Participant. --- If + a body is provided it will result in direct control over what + Participants are subscribed to. + + - if the participants Array is provided and not empty, that list of Participants will be subscribed To + - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session + - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/subscriptions' + securitySchemes: + Basic: + type: http + scheme: basic + 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==` + examples: + createCallResponseExample: + summary: Example of a createCall Response + value: + applicationId: 04e88489-df02-4e34-a0ee-27a91849555f + accountId: '9900000' + callId: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + to: '+19195551234' + from: '+19195554312' + enqueuedTime: '2022-06-16T13:15:07.160Z' + callUrl: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + callTimeout: 30 + callbackTimeout: 15 + tag: My custom tag value + answerMethod: POST + answerUrl: https://myServer.com/bandwidth/webhooks/answer + answerFallbackMethod: POST + disconnectMethod: POST + disconnectUrl: https://myServer.com/bandwidth/webhooks/disconnect + username: mySecretUsername + password: '*****' + fallbackUsername: mySecretUsername + fallbackPassword: '*****' + priority: 5 + listConferencesResponseExample: + summary: Example of a listConferences Response + value: + - id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + name: my-conference-name + createdTime: '2022-06-17T22:19:40.375Z' + completedTime: '2022-06-17T22:20:00.000Z' + conferenceEventUrl: https://myServer.com/bandwidth/webhooks/conferenceEvent + conferenceEventMethod: POST + tag: my custom tag + voiceBadRequestErrorExample: + summary: Example of a Bad Request (400) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed' + voiceUnauthorizedErrorExample: + summary: Example of an Unauthorized (401) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed' + voiceForbiddenErrorExample: + summary: Example of a Forbidden (403) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed' + voiceNotFoundErrorExample: + summary: Example of a Not Found (404) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed' + voiceNotAllowedErrorExample: + summary: Example of a Not Allowed (405) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed' + voiceConflictErrorExample: + summary: Example of a Conflict (409) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed' + voiceUnsupportedMediaTypeErrorExample: + summary: Example of an Unsupported Media Type (415) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed' + voiceTooManyRequestsErrorExample: + summary: Example of a Too Many Requests (429) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed' + voiceInternalServerErrorExample: + summary: Example of an Internal Server (500) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed' + singleNumberRequestExample: + summary: Example Number Lookup Request for One Number + value: + tns: + - '+19195551234' + multipleNumberRequestExample: + summary: Example Number Lookup Request for Multiple Numbers + value: + tns: + - '+19195551234' + - '+19195554321' + lookupInProgressExample: + summary: Example Lookup In Progress Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: IN_PROGRESS + lookupFailedExample: + summary: Example Lookup Failed Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: FAILED + failedTelephoneNumbers: + - '+191955512345' + lookupSingleNumberCompleteExample: + summary: Example Single Number Lookup Complete Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + result: + - 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' + lookupMultipleNumbersCompleteExample: + summary: Example Multiple Numbers Lookup Complete Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + result: + - 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' + - Response Code: 0 + Message: NOERROR + E.164 Format: '+19195554321' + Formatted: (919) 555-4321 + Country: US + Line Type: Mobile + Line Provider: T-Mobile USA + Mobile Country Code: '310' + Mobile Network Code: '160' + lookupMultipleNumbersPartialCompleteExample: + summary: Example Multiple Numbers Lookup Partial Complete Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: PARTIAL_COMPLETE + result: + - 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' + failedTelephoneNumbers: + - '+191955512345' + lookupSingleNumberCompleteNoInfoExample: + summary: Example Single Number Lookup Complete with No Information Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + result: + - Response Code: 3 + Message: NXDOMAIN + E.164 Format: '+19195550000' + Formatted: (919) 555-0000 + Country: US \ No newline at end of file diff --git a/docs/AccountStatistics.md b/docs/AccountStatistics.md new file mode 100644 index 00000000..7786deb4 --- /dev/null +++ b/docs/AccountStatistics.md @@ -0,0 +1,20 @@ +# Bandwidth::AccountStatistics + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **current_call_queue_size** | **Integer** | The number of calls currently enqueued. | [optional] | +| **max_call_queue_size** | **Integer** | The maximum size of the queue before outgoing calls start being rejected. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::AccountStatistics.new( + current_call_queue_size: 0, + max_call_queue_size: 900 +) +``` + diff --git a/docs/AnswerCallback.md b/docs/AnswerCallback.md new file mode 100644 index 00000000..81d8d416 --- /dev/null +++ b/docs/AnswerCallback.md @@ -0,0 +1,44 @@ +# Bandwidth::AnswerCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **machine_detection_result** | **String** | (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::AnswerCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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: null +) +``` + diff --git a/docs/BridgeCompleteCallback.md b/docs/BridgeCompleteCallback.md new file mode 100644 index 00000000..3d3f4497 --- /dev/null +++ b/docs/BridgeCompleteCallback.md @@ -0,0 +1,48 @@ +# Bandwidth::BridgeCompleteCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] | +| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] | +| **error_id** | **String** | Bandwidth's internal id that references the error event. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::BridgeCompleteCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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 +) +``` + diff --git a/docs/BridgeTargetCompleteCallback.md b/docs/BridgeTargetCompleteCallback.md new file mode 100644 index 00000000..ac369e4a --- /dev/null +++ b/docs/BridgeTargetCompleteCallback.md @@ -0,0 +1,42 @@ +# Bandwidth::BridgeTargetCompleteCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::BridgeTargetCompleteCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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 +) +``` + diff --git a/docs/CallDirectionEnum.md b/docs/CallDirectionEnum.md new file mode 100644 index 00000000..be53c1e2 --- /dev/null +++ b/docs/CallDirectionEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::CallDirectionEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CallDirectionEnum.new() +``` + diff --git a/docs/CallRecordingMetadata.md b/docs/CallRecordingMetadata.md new file mode 100644 index 00000000..a099923c --- /dev/null +++ b/docs/CallRecordingMetadata.md @@ -0,0 +1,52 @@ +# Bandwidth::CallRecordingMetadata + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **account_id** | **String** | The user account associated with the call. | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **parent_call_id** | **String** | (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** | **String** | The unique ID of this recording | [optional] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **from** | **String** | 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** | **String** | 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_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] | +| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **channels** | **Integer** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] | +| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] | +| **status** | **String** | 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** | **String** | 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] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CallRecordingMetadata.new( + 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, + from: +15555555555, + transfer_caller_id: +15555555555, + transfer_to: +15555555555), + duration: PT13.67S, + direction: null, + channels: 1, + start_time: 2022-06-17T22:19:40.375Z, + end_time: 2022-06-17T22:20Z, + file_format: null, + 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: null +) +``` + diff --git a/docs/CallState.md b/docs/CallState.md new file mode 100644 index 00000000..536c71d9 --- /dev/null +++ b/docs/CallState.md @@ -0,0 +1,52 @@ +# Bandwidth::CallState + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **application_id** | **String** | The application id associated with the call. | [optional] | +| **account_id** | **String** | The account id associated with the call. | [optional] | +| **call_id** | **String** | The programmable voice API call ID. | [optional] | +| **parent_call_id** | **String** | The A-leg call id, set only if this call is the B-leg of a [`<Transfer>`](/docs/voice/bxml/transfer). | [optional] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI | [optional] | +| **from** | **String** | The phone number that made the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **state** | **String** | The current state of the call. Current possible values are `queued`, `initiated`, `answered` and `disconnected`. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] | +| **stir_shaken** | **Hash<String, String>** | For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken) | [optional] | +| **identity** | **String** | The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header. | [optional] | +| **enqueued_time** | **Time** | The time this call was placed in queue. | [optional] | +| **start_time** | **Time** | The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue. | [optional] | +| **answer_time** | **Time** | Populated once the call has been answered, with the time in ISO 8601 format. | [optional] | +| **end_time** | **Time** | Populated once the call has ended, with the time in ISO 8601 format. | [optional] | +| **disconnect_cause** | **String** | | Cause | Description | |:------|:------------| | `hangup`| One party hung up the call, a [`<Hangup>`](../../bxml/verbs/hangup.md) verb was executed, or there was no more BXML to execute; it indicates that the call ended normally. | | `busy` | Callee was busy. | | `timeout` | Call wasn't answered before the `callTimeout` was reached. | | `cancel` | Call was cancelled by its originator while it was ringing. | | `rejected` | Call was rejected by the callee. | | `callback-error` | BXML callback couldn't be delivered to your callback server. | | `invalid-bxml` | Invalid BXML was returned in response to a callback. | | `application-error` | An unsupported action was tried on the call, e.g. trying to play a .ogg audio. | | `account-limit` | Account rate limits were reached. | | `node-capacity-exceeded` | System maximum capacity was reached. | | `error` | Some error not described in any of the other causes happened on the call. | | `unknown` | Unknown error happened on the call. | Note: This list is not exhaustive and other values can appear in the future. | [optional] | +| **error_message** | **String** | Populated only if the call ended with an error, with text explaining the reason. | [optional] | +| **error_id** | **String** | Populated only if the call ended with an error, with a Bandwidth internal id that references the error event. | [optional] | +| **last_update** | **Time** | The last time the call had a state update, in ISO 8601 format. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CallState.new( + 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, + from: 19195554321, + direction: null, + state: disconnected, + stir_shaken: {"verstat":"TN-Verification-Passed","attestationIndicator":"A","originatingId":"abc123"}, + identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=<https://bw-shaken-cert-pub.s3.amazonaws.com/bandwidth-shaken-cert_20230716.pem>;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: null, + error_message: null, + error_id: null, + last_update: 2022-06-16T13:15:18.314Z +) +``` + diff --git a/docs/CallStateEnum.md b/docs/CallStateEnum.md new file mode 100644 index 00000000..483b4a8c --- /dev/null +++ b/docs/CallStateEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::CallStateEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CallStateEnum.new() +``` + diff --git a/docs/CallbackMethodEnum.md b/docs/CallbackMethodEnum.md new file mode 100644 index 00000000..5f8a72bb --- /dev/null +++ b/docs/CallbackMethodEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::CallbackMethodEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CallbackMethodEnum.new() +``` + diff --git a/docs/CallsApi.md b/docs/CallsApi.md new file mode 100644 index 00000000..48a9cbb3 --- /dev/null +++ b/docs/CallsApi.md @@ -0,0 +1,304 @@ +# Bandwidth::CallsApi + +All URIs are relative to *http://localhost* + +| 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 | +| [**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 | + + +## create_call + +> create_call(account_id, create_call) + +Create Call + +Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. Please note: Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::CallsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+19195554321', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.com/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call + +begin + # Create Call + result = api_instance.create_call(account_id, create_call) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling CallsApi->create_call: #{e}" +end +``` + +#### Using the create_call_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_call_with_http_info(account_id, create_call) + +```ruby +begin + # Create Call + data, status_code, headers = api_instance.create_call_with_http_info(account_id, create_call) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling CallsApi->create_call_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **create_call** | [**CreateCall**](CreateCall.md) | JSON object containing information to create an outbound call | | + +### Return type + +[**CreateCallResponse**](CreateCallResponse.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## get_call_state + +> get_call_state(account_id, call_id) + +Get Call State Information + +Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: 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 HTTP 404 response. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::CallsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID + +begin + # Get Call State Information + result = api_instance.get_call_state(account_id, call_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling CallsApi->get_call_state: #{e}" +end +``` + +#### Using the get_call_state_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_call_state_with_http_info(account_id, call_id) + +```ruby +begin + # Get Call State Information + data, status_code, headers = api_instance.get_call_state_with_http_info(account_id, call_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling CallsApi->get_call_state_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | + +### Return type + +[**CallState**](CallState.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_call + +> update_call(account_id, call_id, update_call) + +Update Call + +Interrupts and redirects a call to a different URL that should return a BXML document. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::CallsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +update_call = Bandwidth::UpdateCall.new # UpdateCall | JSON object containing information to redirect an existing call to a new BXML document + +begin + # Update Call + api_instance.update_call(account_id, call_id, update_call) +rescue Bandwidth::ApiError => e + puts "Error when calling CallsApi->update_call: #{e}" +end +``` + +#### Using the update_call_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_call_with_http_info(account_id, call_id, update_call) + +```ruby +begin + # Update Call + data, status_code, headers = api_instance.update_call_with_http_info(account_id, call_id, update_call) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling CallsApi->update_call_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | +| **update_call** | [**UpdateCall**](UpdateCall.md) | JSON object containing information to redirect an existing call to a new BXML document | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_call_bxml + +> update_call_bxml(account_id, call_id, body) + +Update Call BXML + +Interrupts and replaces an active call's BXML document. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::CallsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +body = ' + + This is a test sentence. +' # String | + +begin + # Update Call BXML + api_instance.update_call_bxml(account_id, call_id, body) +rescue Bandwidth::ApiError => e + puts "Error when calling CallsApi->update_call_bxml: #{e}" +end +``` + +#### Using the update_call_bxml_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_call_bxml_with_http_info(account_id, call_id, body) + +```ruby +begin + # Update Call BXML + data, status_code, headers = api_instance.update_call_bxml_with_http_info(account_id, call_id, body) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling CallsApi->update_call_bxml_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | +| **body** | **String** | | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/xml +- **Accept**: application/json + diff --git a/docs/CodeRequest.md b/docs/CodeRequest.md new file mode 100644 index 00000000..c9070ceb --- /dev/null +++ b/docs/CodeRequest.md @@ -0,0 +1,28 @@ +# Bandwidth::CodeRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **to** | **String** | The phone number to send the mfa code to. | | +| **from** | **String** | The application phone number, the sender of the mfa code. | | +| **application_id** | **String** | The application unique ID, obtained from Bandwidth. | | +| **scope** | **String** | An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\". | [optional] | +| **message** | **String** | The message format of the mfa code. There are three values that the system will replace \"{CODE}\", \"{NAME}\", \"{SCOPE}\". The \"{SCOPE}\" and \"{NAME} value template are optional, while \"{CODE}\" must be supplied. As the name would suggest, code will be replace with the actual mfa code. Name is replaced with the application name, configured during provisioning of mfa. The scope value is the same value sent during the call and partitioned by the server. | | +| **digits** | **Integer** | The number of digits for your mfa code. The valid number ranges from 2 to 8, inclusively. | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CodeRequest.new( + to: +19195551234, + from: +19195554321, + application_id: 66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1, + scope: 2FA, + message: Your temporary {NAME} {SCOPE} code is {CODE}, + digits: 6 +) +``` + diff --git a/docs/Conference.md b/docs/Conference.md new file mode 100644 index 00000000..bbc8cc09 --- /dev/null +++ b/docs/Conference.md @@ -0,0 +1,32 @@ +# Bandwidth::Conference + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The Bandwidth-generated conference ID | [optional] | +| **name** | **String** | The name of the conference, as specified by your application | [optional] | +| **created_time** | **Time** | The time the conference was initiated, in ISO 8601 format. | [optional] | +| **completed_time** | **Time** | The time the conference was terminated, in ISO 8601 format. | [optional] | +| **conference_event_url** | **String** | The URL to send the conference-related events. | [optional] | +| **conference_event_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] | +| **tag** | **String** | The custom string attached to the conference that will be sent with callbacks. | [optional] | +| **active_members** | [**Array<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] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Conference.new( + 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.com/bandwidth/webhooks/conferenceEvent, + conference_event_method: null, + tag: my custom tag, + active_members: null +) +``` + diff --git a/docs/ConferenceCompletedCallback.md b/docs/ConferenceCompletedCallback.md new file mode 100644 index 00000000..4d70217b --- /dev/null +++ b/docs/ConferenceCompletedCallback.md @@ -0,0 +1,26 @@ +# Bandwidth::ConferenceCompletedCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | +| **name** | **String** | The user-specified name of the conference that was recorded | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ConferenceCompletedCallback.new( + event_type: bridgeComplete, + event_time: null, + conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9, + name: my-conference-name, + tag: exampleTag +) +``` + diff --git a/docs/ConferenceCreatedCallback.md b/docs/ConferenceCreatedCallback.md new file mode 100644 index 00000000..9347499b --- /dev/null +++ b/docs/ConferenceCreatedCallback.md @@ -0,0 +1,26 @@ +# Bandwidth::ConferenceCreatedCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | +| **name** | **String** | The user-specified name of the conference that was recorded | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ConferenceCreatedCallback.new( + event_type: bridgeComplete, + event_time: null, + conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9, + name: my-conference-name, + tag: exampleTag +) +``` + diff --git a/docs/ConferenceMember.md b/docs/ConferenceMember.md new file mode 100644 index 00000000..6948cfc4 --- /dev/null +++ b/docs/ConferenceMember.md @@ -0,0 +1,28 @@ +# Bandwidth::ConferenceMember + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | +| **member_url** | **String** | A URL that may be used to retrieve information about or update the state of this conference member. This is the URL of this member's [Get Conference Member](/apis/voice/#operation/getConferenceMember) endpoint and [Modify Conference Member](/apis/voice/#operation/updateConferenceMember) endpoint. | [optional] | +| **mute** | **Boolean** | Whether or not this member is currently muted. Members who are muted are still able to hear other participants. If used in a PUT request, updates this member's mute status. Has no effect if omitted. | [optional] | +| **hold** | **Boolean** | Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. If used in a PUT request, updates this member's hold status. Has no effect if omitted. | [optional] | +| **call_ids_to_coach** | **Array<String>** | If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. If present in a PUT request, modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ConferenceMember.new( + 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"] +) +``` + diff --git a/docs/ConferenceMemberExitCallback.md b/docs/ConferenceMemberExitCallback.md new file mode 100644 index 00000000..3e978445 --- /dev/null +++ b/docs/ConferenceMemberExitCallback.md @@ -0,0 +1,32 @@ +# Bandwidth::ConferenceMemberExitCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | +| **name** | **String** | The user-specified name of the conference that was recorded | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ConferenceMemberExitCallback.new( + event_type: bridgeComplete, + event_time: null, + conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9, + name: my-conference-name, + from: +15555555555, + to: +15555555555, + call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + tag: exampleTag +) +``` + diff --git a/docs/ConferenceMemberJoinCallback.md b/docs/ConferenceMemberJoinCallback.md new file mode 100644 index 00000000..06c220a8 --- /dev/null +++ b/docs/ConferenceMemberJoinCallback.md @@ -0,0 +1,32 @@ +# Bandwidth::ConferenceMemberJoinCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | +| **name** | **String** | The user-specified name of the conference that was recorded | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ConferenceMemberJoinCallback.new( + event_type: bridgeComplete, + event_time: null, + conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9, + name: my-conference-name, + from: +15555555555, + to: +15555555555, + call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + tag: exampleTag +) +``` + diff --git a/docs/ConferenceRecordingAvailableCallback.md b/docs/ConferenceRecordingAvailableCallback.md new file mode 100644 index 00000000..b5ea5228 --- /dev/null +++ b/docs/ConferenceRecordingAvailableCallback.md @@ -0,0 +1,44 @@ +# Bandwidth::ConferenceRecordingAvailableCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | +| **name** | **String** | The user-specified name of the conference that was recorded | [optional] | +| **account_id** | **String** | The user account associated with the call. | [optional] | +| **recording_id** | **String** | The unique ID of this recording | [optional] | +| **channels** | **Integer** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] | +| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] | +| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] | +| **media_url** | **String** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **status** | **String** | 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] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ConferenceRecordingAvailableCallback.new( + event_type: bridgeComplete, + event_time: null, + 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: null, + 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 +) +``` + diff --git a/docs/ConferenceRecordingMetadata.md b/docs/ConferenceRecordingMetadata.md new file mode 100644 index 00000000..effcaea7 --- /dev/null +++ b/docs/ConferenceRecordingMetadata.md @@ -0,0 +1,38 @@ +# Bandwidth::ConferenceRecordingMetadata + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | The user account associated with the call. | [optional] | +| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | +| **name** | **String** | The user-specified name of the conference that was recorded | [optional] | +| **recording_id** | **String** | The unique ID of this recording | [optional] | +| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] | +| **channels** | **Integer** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] | +| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] | +| **status** | **String** | 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** | **String** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ConferenceRecordingMetadata.new( + 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: null, + 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 +) +``` + diff --git a/docs/ConferenceRedirectCallback.md b/docs/ConferenceRedirectCallback.md new file mode 100644 index 00000000..986285fc --- /dev/null +++ b/docs/ConferenceRedirectCallback.md @@ -0,0 +1,26 @@ +# Bandwidth::ConferenceRedirectCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | +| **name** | **String** | The user-specified name of the conference that was recorded | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ConferenceRedirectCallback.new( + event_type: bridgeComplete, + event_time: null, + conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9, + name: my-conference-name, + tag: exampleTag +) +``` + diff --git a/docs/ConferenceStateEnum.md b/docs/ConferenceStateEnum.md new file mode 100644 index 00000000..fac69498 --- /dev/null +++ b/docs/ConferenceStateEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::ConferenceStateEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ConferenceStateEnum.new() +``` + diff --git a/docs/ConferencesApi.md b/docs/ConferencesApi.md new file mode 100644 index 00000000..af0c8c84 --- /dev/null +++ b/docs/ConferencesApi.md @@ -0,0 +1,688 @@ +# Bandwidth::ConferencesApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**download_conference_recording**](ConferencesApi.md#download_conference_recording) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media | Download Conference Recording | +| [**get_conference**](ConferencesApi.md#get_conference) | **GET** /accounts/{accountId}/conferences/{conferenceId} | Get Conference Information | +| [**get_conference_member**](ConferencesApi.md#get_conference_member) | **GET** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Get Conference Member | +| [**get_conference_recording**](ConferencesApi.md#get_conference_recording) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId} | Get Conference Recording Information | +| [**list_conference_recordings**](ConferencesApi.md#list_conference_recordings) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings | Get Conference Recordings | +| [**list_conferences**](ConferencesApi.md#list_conferences) | **GET** /accounts/{accountId}/conferences | Get Conferences | +| [**update_conference**](ConferencesApi.md#update_conference) | **POST** /accounts/{accountId}/conferences/{conferenceId} | Update Conference | +| [**update_conference_bxml**](ConferencesApi.md#update_conference_bxml) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/bxml | Update Conference BXML | +| [**update_conference_member**](ConferencesApi.md#update_conference_member) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Update Conference Member | + + +## download_conference_recording + +> File download_conference_recording(account_id, conference_id, recording_id) + +Download Conference Recording + +Downloads the specified recording file. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ConferencesApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID + +begin + # Download Conference Recording + result = api_instance.download_conference_recording(account_id, conference_id, recording_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->download_conference_recording: #{e}" +end +``` + +#### Using the download_conference_recording_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> download_conference_recording_with_http_info(account_id, conference_id, recording_id) + +```ruby +begin + # Download Conference Recording + data, status_code, headers = api_instance.download_conference_recording_with_http_info(account_id, conference_id, recording_id) + p status_code # => 2xx + p headers # => { ... } + p data # => File +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->download_conference_recording_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **conference_id** | **String** | Programmable Voice API Conference ID | | +| **recording_id** | **String** | Programmable Voice API Recording ID | | + +### Return type + +**File** + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: audio/vnd.wave, audio/mpeg, application/json + + +## get_conference + +> get_conference(account_id, conference_id) + +Get Conference Information + +Returns information about the specified conference. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ConferencesApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID + +begin + # Get Conference Information + result = api_instance.get_conference(account_id, conference_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->get_conference: #{e}" +end +``` + +#### Using the get_conference_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_conference_with_http_info(account_id, conference_id) + +```ruby +begin + # Get Conference Information + data, status_code, headers = api_instance.get_conference_with_http_info(account_id, conference_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->get_conference_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **conference_id** | **String** | Programmable Voice API Conference ID | | + +### Return type + +[**Conference**](Conference.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_conference_member + +> get_conference_member(account_id, conference_id, member_id) + +Get Conference Member + +Returns information about the specified conference member. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ConferencesApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID +member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Conference Member ID + +begin + # Get Conference Member + result = api_instance.get_conference_member(account_id, conference_id, member_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->get_conference_member: #{e}" +end +``` + +#### Using the get_conference_member_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_conference_member_with_http_info(account_id, conference_id, member_id) + +```ruby +begin + # Get Conference Member + data, status_code, headers = api_instance.get_conference_member_with_http_info(account_id, conference_id, member_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->get_conference_member_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **conference_id** | **String** | Programmable Voice API Conference ID | | +| **member_id** | **String** | Programmable Voice API Conference Member ID | | + +### Return type + +[**ConferenceMember**](ConferenceMember.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_conference_recording + +> get_conference_recording(account_id, conference_id, recording_id) + +Get Conference Recording Information + +Returns metadata for the specified recording. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ConferencesApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID + +begin + # Get Conference Recording Information + result = api_instance.get_conference_recording(account_id, conference_id, recording_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->get_conference_recording: #{e}" +end +``` + +#### Using the get_conference_recording_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_conference_recording_with_http_info(account_id, conference_id, recording_id) + +```ruby +begin + # Get Conference Recording Information + data, status_code, headers = api_instance.get_conference_recording_with_http_info(account_id, conference_id, recording_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->get_conference_recording_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **conference_id** | **String** | Programmable Voice API Conference ID | | +| **recording_id** | **String** | Programmable Voice API Recording ID | | + +### Return type + +[**ConferenceRecordingMetadata**](ConferenceRecordingMetadata.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_conference_recordings + +> > list_conference_recordings(account_id, conference_id) + +Get Conference Recordings + +Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ConferencesApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID + +begin + # Get Conference Recordings + result = api_instance.list_conference_recordings(account_id, conference_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->list_conference_recordings: #{e}" +end +``` + +#### Using the list_conference_recordings_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_conference_recordings_with_http_info(account_id, conference_id) + +```ruby +begin + # Get Conference Recordings + data, status_code, headers = api_instance.list_conference_recordings_with_http_info(account_id, conference_id) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->list_conference_recordings_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **conference_id** | **String** | Programmable Voice API Conference ID | | + +### Return type + +[**Array<ConferenceRecordingMetadata>**](ConferenceRecordingMetadata.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_conferences + +> > list_conferences(account_id, opts) + +Get Conferences + +Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences 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 conference records. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ConferencesApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +opts = { + name: 'my-custom-name', # String | Filter results by the `name` field. + min_created_time: '2022-06-21T19:13:21Z', # String | Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). + max_created_time: '2022-06-21T19:13:21Z', # String | Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). + page_size: 500, # Integer | Specifies the max number of conferences that will be returned. + page_token: 'page_token_example' # String | Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. +} + +begin + # Get Conferences + result = api_instance.list_conferences(account_id, opts) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->list_conferences: #{e}" +end +``` + +#### Using the list_conferences_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_conferences_with_http_info(account_id, opts) + +```ruby +begin + # Get Conferences + data, status_code, headers = api_instance.list_conferences_with_http_info(account_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->list_conferences_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **name** | **String** | Filter results by the `name` field. | [optional] | +| **min_created_time** | **String** | Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). | [optional] | +| **max_created_time** | **String** | Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). | [optional] | +| **page_size** | **Integer** | Specifies the max number of conferences that will be returned. | [optional][default to 1000] | +| **page_token** | **String** | 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 + +[**Array<Conference>**](Conference.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_conference + +> update_conference(account_id, conference_id, update_conference) + +Update Conference + +Update the conference state. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ConferencesApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID +update_conference = Bandwidth::UpdateConference.new # UpdateConference | + +begin + # Update Conference + api_instance.update_conference(account_id, conference_id, update_conference) +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->update_conference: #{e}" +end +``` + +#### Using the update_conference_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_conference_with_http_info(account_id, conference_id, update_conference) + +```ruby +begin + # Update Conference + data, status_code, headers = api_instance.update_conference_with_http_info(account_id, conference_id, update_conference) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->update_conference_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **conference_id** | **String** | Programmable Voice API Conference ID | | +| **update_conference** | [**UpdateConference**](UpdateConference.md) | | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_conference_bxml + +> update_conference_bxml(account_id, conference_id, body) + +Update Conference BXML + +Update the conference BXML document. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ConferencesApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID +body = ' + + +' # String | + +begin + # Update Conference BXML + api_instance.update_conference_bxml(account_id, conference_id, body) +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->update_conference_bxml: #{e}" +end +``` + +#### Using the update_conference_bxml_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_conference_bxml_with_http_info(account_id, conference_id, body) + +```ruby +begin + # Update Conference BXML + data, status_code, headers = api_instance.update_conference_bxml_with_http_info(account_id, conference_id, body) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->update_conference_bxml_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **conference_id** | **String** | Programmable Voice API Conference ID | | +| **body** | **String** | | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/xml +- **Accept**: application/json + + +## update_conference_member + +> update_conference_member(account_id, conference_id, member_id, update_conference_member) + +Update Conference Member + +Updates settings for a particular conference member. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ConferencesApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID +member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Conference Member ID +update_conference_member = Bandwidth::UpdateConferenceMember.new # UpdateConferenceMember | + +begin + # Update Conference Member + api_instance.update_conference_member(account_id, conference_id, member_id, update_conference_member) +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->update_conference_member: #{e}" +end +``` + +#### Using the update_conference_member_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member) + +```ruby +begin + # Update Conference Member + data, status_code, headers = api_instance.update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling ConferencesApi->update_conference_member_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **conference_id** | **String** | Programmable Voice API Conference ID | | +| **member_id** | **String** | Programmable Voice API Conference Member ID | | +| **update_conference_member** | [**UpdateConferenceMember**](UpdateConferenceMember.md) | | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/CreateCall.md b/docs/CreateCall.md new file mode 100644 index 00000000..8e7d7750 --- /dev/null +++ b/docs/CreateCall.md @@ -0,0 +1,54 @@ +# Bandwidth::CreateCall + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **to** | **String** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.com`)). | | +| **from** | **String** | 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`). | | +| **uui** | **String** | 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** | **String** | The id of the application associated with the `from` number. | | +| **answer_url** | **String** | 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][default to 'POST'] | +| **username** | **String** | Basic auth username. | [optional] | +| **password** | **String** | Basic auth password. | [optional] | +| **answer_fallback_url** | **String** | 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][default to 'POST'] | +| **fallback_username** | **String** | Basic auth username. | [optional] | +| **fallback_password** | **String** | Basic auth password. | [optional] | +| **disconnect_url** | **String** | 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][default to '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] | +| **priority** | **Integer** | 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. | [optional][default to 5] | +| **tag** | **String** | A custom string that will be sent with all webhooks for this call unless overwritten by a future <a href='/docs/voice/bxml/tag'>`<Tag>`</a> verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CreateCall.new( + to: +19195551234, + from: +19195554321, + uui: eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ=;encoding=base64, + application_id: 1234-qwer-5679-tyui, + answer_url: https://www.myCallbackServer.com/webhooks/answer, + answer_method: null, + username: mySecretUsername, + password: mySecretPassword1!, + answer_fallback_url: https://www.myFallbackServer.com/webhooks/answer, + answer_fallback_method: null, + fallback_username: mySecretUsername, + fallback_password: mySecretPassword1!, + disconnect_url: null, + disconnect_method: null, + call_timeout: null, + callback_timeout: null, + machine_detection: null, + priority: null, + tag: null +) +``` + diff --git a/docs/CreateCallResponse.md b/docs/CreateCallResponse.md new file mode 100644 index 00000000..e76e6599 --- /dev/null +++ b/docs/CreateCallResponse.md @@ -0,0 +1,58 @@ +# Bandwidth::CreateCallResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **application_id** | **String** | The id of the application associated with the `from` number. | | +| **account_id** | **String** | The bandwidth account ID associated with the call | | +| **call_id** | **String** | Programmable Voice API Call ID | | +| **to** | **String** | Recipient of the outgoing call | | +| **from** | **String** | Phone number that created the outbound call | | +| **enqueued_time** | **Time** | Time the call was accepted into the queue | [optional] | +| **call_url** | **String** | The URL to update call state | | +| **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** | **String** | Custom tag value | [optional] | +| **answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [default to 'POST'] | +| **answer_url** | **String** | URL to deliver the `answer` event webhook. | | +| **answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] | +| **answer_fallback_url** | **String** | Fallback URL to deliver the `answer` event webhook. | [optional] | +| **disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [default to 'POST'] | +| **disconnect_url** | **String** | URL to deliver the `disconnect` event webhook. | [optional] | +| **username** | **String** | Basic auth username. | [optional] | +| **password** | **String** | Basic auth password. | [optional] | +| **fallback_username** | **String** | Basic auth username. | [optional] | +| **fallback_password** | **String** | Basic auth password. | [optional] | +| **priority** | **Float** | The priority of this call over other calls from your account. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CreateCallResponse.new( + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + account_id: 9900000, + call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + to: +19195551234, + 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: null, + answer_url: https://myServer.com/bandwidth/webhooks/answer, + answer_fallback_method: null, + answer_fallback_url: https://myFallbackServer.com/bandwidth/webhooks/answer, + disconnect_method: null, + disconnect_url: https://myServer.com/bandwidth/webhooks/disconnect, + username: mySecretUsername, + password: mySecretPassword1!, + fallback_username: mySecretUsername, + fallback_password: mySecretPassword1!, + priority: 5 +) +``` + diff --git a/docs/CreateLookupResponse.md b/docs/CreateLookupResponse.md new file mode 100644 index 00000000..dae614e2 --- /dev/null +++ b/docs/CreateLookupResponse.md @@ -0,0 +1,20 @@ +# Bandwidth::CreateLookupResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_id** | **String** | The phone number lookup request ID from Bandwidth. | [optional] | +| **status** | [**LookupStatusEnum**](LookupStatusEnum.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CreateLookupResponse.new( + request_id: null, + status: null +) +``` + diff --git a/docs/CreateMessageRequestError.md b/docs/CreateMessageRequestError.md new file mode 100644 index 00000000..fd6aee11 --- /dev/null +++ b/docs/CreateMessageRequestError.md @@ -0,0 +1,22 @@ +# Bandwidth::CreateMessageRequestError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | | | +| **description** | **String** | | | +| **field_errors** | [**Array<FieldError>**](FieldError.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CreateMessageRequestError.new( + type: null, + description: null, + field_errors: null +) +``` + diff --git a/docs/CreateParticipantRequest.md b/docs/CreateParticipantRequest.md new file mode 100644 index 00000000..9e3d2159 --- /dev/null +++ b/docs/CreateParticipantRequest.md @@ -0,0 +1,24 @@ +# Bandwidth::CreateParticipantRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **callback_url** | **String** | Full callback url to use for notifications about this participant. | [optional] | +| **publish_permissions** | [**Array<PublishPermissionsEnum>**](PublishPermissionsEnum.md) | Defines if this participant can publish audio or video. | [optional] | +| **tag** | **String** | User defined tag to associate with the participant. | [optional] | +| **device_api_version** | [**DeviceApiVersionEnum**](DeviceApiVersionEnum.md) | | [optional][default to 'V3'] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CreateParticipantRequest.new( + callback_url: https://example.com/callback, + publish_permissions: ["VIDEO","AUDIO"], + tag: participant1, + device_api_version: null +) +``` + diff --git a/docs/CreateParticipantResponse.md b/docs/CreateParticipantResponse.md new file mode 100644 index 00000000..03f94266 --- /dev/null +++ b/docs/CreateParticipantResponse.md @@ -0,0 +1,20 @@ +# Bandwidth::CreateParticipantResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **participant** | [**Participant**](Participant.md) | | [optional] | +| **token** | **String** | Auth token for the returned participant. This should be passed to the participant so that they can connect to the platform. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CreateParticipantResponse.new( + participant: null, + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiaWF0IjoxNTE2MjM5MDIyfQ.L8i6g3PfcHlioHCCPURC9pmXT7gdJpx3kOoyAfNUwCc +) +``` + diff --git a/docs/DeferredResult.md b/docs/DeferredResult.md new file mode 100644 index 00000000..602bcacc --- /dev/null +++ b/docs/DeferredResult.md @@ -0,0 +1,20 @@ +# Bandwidth::DeferredResult + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **result** | **Object** | | [optional] | +| **set_or_expired** | **Boolean** | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::DeferredResult.new( + result: null, + set_or_expired: null +) +``` + diff --git a/docs/DeviceApiVersionEnum.md b/docs/DeviceApiVersionEnum.md new file mode 100644 index 00000000..30970c47 --- /dev/null +++ b/docs/DeviceApiVersionEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::DeviceApiVersionEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::DeviceApiVersionEnum.new() +``` + diff --git a/docs/DisconenctCallback.md b/docs/DisconenctCallback.md new file mode 100644 index 00000000..a0f462d6 --- /dev/null +++ b/docs/DisconenctCallback.md @@ -0,0 +1,50 @@ +# Bandwidth::DisconenctCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] | +| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] | +| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] | +| **error_id** | **String** | Bandwidth's internal id that references the error event. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::DisconenctCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + direction: null, + 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 +) +``` + diff --git a/docs/Diversion.md b/docs/Diversion.md new file mode 100644 index 00000000..e7c81b08 --- /dev/null +++ b/docs/Diversion.md @@ -0,0 +1,30 @@ +# Bandwidth::Diversion + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **reason** | **String** | The reason for the diversion. Common values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away. | [optional] | +| **privacy** | **String** | off or full | [optional] | +| **screen** | **String** | No if the number was provided by the user, yes if the number was provided by the network | [optional] | +| **counter** | **String** | The number of diversions that have occurred | [optional] | +| **limit** | **String** | The maximum number of diversions allowed for this session | [optional] | +| **unknown** | **String** | The normal list of values is not exhaustive. Your application must be tolerant of unlisted keys and unlisted values of those keys. | [optional] | +| **orig_to** | **String** | Always present. Indicates the last telephone number that the call was diverted from. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Diversion.new( + reason: unavailable, + privacy: off, + screen: no, + counter: 2, + limit: 3, + unknown: unknownValue, + orig_to: +15558884444 +) +``` + diff --git a/docs/DtmfCallback.md b/docs/DtmfCallback.md new file mode 100644 index 00000000..896d0b60 --- /dev/null +++ b/docs/DtmfCallback.md @@ -0,0 +1,50 @@ +# Bandwidth::DtmfCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **digit** | **String** | The digit collected in the call. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **parent_call_id** | **String** | (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** | **String** | 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_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::DtmfCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + direction: null, + 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 +) +``` + diff --git a/docs/FieldError.md b/docs/FieldError.md new file mode 100644 index 00000000..fbd0167e --- /dev/null +++ b/docs/FieldError.md @@ -0,0 +1,20 @@ +# Bandwidth::FieldError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **field_name** | **String** | The name of the field that contains the error | [optional] | +| **description** | **String** | The error associated with the field | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::FieldError.new( + field_name: from, + description: '+invalid' must be replaced with a valid E164 formatted telephone number +) +``` + diff --git a/docs/FileFormatEnum.md b/docs/FileFormatEnum.md new file mode 100644 index 00000000..d3b2dd44 --- /dev/null +++ b/docs/FileFormatEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::FileFormatEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::FileFormatEnum.new() +``` + diff --git a/docs/ForbiddenRequest.md b/docs/ForbiddenRequest.md new file mode 100644 index 00000000..ab75cf43 --- /dev/null +++ b/docs/ForbiddenRequest.md @@ -0,0 +1,18 @@ +# Bandwidth::ForbiddenRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message** | **String** | The message containing the reason behind the request being forbidden. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ForbiddenRequest.new( + message: Missing Authentication Token +) +``` + diff --git a/docs/GatherCallback.md b/docs/GatherCallback.md new file mode 100644 index 00000000..56fe3247 --- /dev/null +++ b/docs/GatherCallback.md @@ -0,0 +1,52 @@ +# Bandwidth::GatherCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **digits** | **String** | (optional) The digits, letters, and/or symbols entered by the user. The string is empty if a timeout occurred before any buttons were pressed. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **parent_call_id** | **String** | (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** | **String** | (optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed. | [optional] | +| **transfer_caller_id** | **String** | 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_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::GatherCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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 +) +``` + diff --git a/docs/InitiateCallback.md b/docs/InitiateCallback.md new file mode 100644 index 00000000..2ca35c7a --- /dev/null +++ b/docs/InitiateCallback.md @@ -0,0 +1,40 @@ +# Bandwidth::InitiateCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **diversion** | [**Diversion**](Diversion.md) | | [optional] | +| **stir_shaken** | [**StirShaken**](StirShaken.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::InitiateCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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: null, + stir_shaken: null +) +``` + diff --git a/docs/ListMessageDirectionEnum.md b/docs/ListMessageDirectionEnum.md new file mode 100644 index 00000000..c1f6d09b --- /dev/null +++ b/docs/ListMessageDirectionEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::ListMessageDirectionEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ListMessageDirectionEnum.new() +``` + diff --git a/docs/ListMessageItem.md b/docs/ListMessageItem.md new file mode 100644 index 00000000..c78ae363 --- /dev/null +++ b/docs/ListMessageItem.md @@ -0,0 +1,48 @@ +# Bandwidth::ListMessageItem + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message_id** | **String** | The message id | [optional] | +| **account_id** | **String** | The account id associated with this message. | [optional] | +| **source_tn** | **String** | The source phone number of the message. | [optional] | +| **destination_tn** | **String** | The recipient phone number of the message. | [optional] | +| **message_status** | [**MessageStatusEnum**](MessageStatusEnum.md) | | [optional] | +| **message_direction** | [**ListMessageDirectionEnum**](ListMessageDirectionEnum.md) | | [optional] | +| **message_type** | [**MessageTypeEnum**](MessageTypeEnum.md) | | [optional] | +| **segment_count** | **Integer** | The number of segments the message was sent as. | [optional] | +| **error_code** | **Integer** | The numeric error code of the message. | [optional] | +| **receive_time** | **String** | The ISO 8601 datetime of the message. | [optional] | +| **carrier_name** | **String** | The name of the carrier. Not currently supported for MMS coming soon. | [optional] | +| **message_size** | **Integer** | The size of the message including message content and headers. | [optional] | +| **message_length** | **Integer** | The length of the message content. | [optional] | +| **attachment_count** | **Integer** | The number of attachments the message has. | [optional] | +| **recipient_count** | **Integer** | The number of recipients the message has. | [optional] | +| **campaign_class** | **String** | The campaign class of the message if it has one. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ListMessageItem.new( + message_id: 1589228074636lm4k2je7j7jklbn2, + account_id: 9900000, + source_tn: +15554443333, + destination_tn: +15554442222, + message_status: null, + message_direction: null, + message_type: null, + segment_count: 1, + error_code: 9902, + receive_time: 2020-04-07T14:03:07.000Z, + carrier_name: other, + message_size: 27, + message_length: 18, + attachment_count: 1, + recipient_count: 1, + campaign_class: T +) +``` + diff --git a/docs/LookupRequest.md b/docs/LookupRequest.md new file mode 100644 index 00000000..566786c8 --- /dev/null +++ b/docs/LookupRequest.md @@ -0,0 +1,18 @@ +# Bandwidth::LookupRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **tns** | **Array<String>** | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::LookupRequest.new( + tns: null +) +``` + diff --git a/docs/LookupResult.md b/docs/LookupResult.md new file mode 100644 index 00000000..647963b8 --- /dev/null +++ b/docs/LookupResult.md @@ -0,0 +1,34 @@ +# Bandwidth::LookupResult + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **response_code** | **Integer** | Our vendor's response code. | [optional] | +| **message** | **String** | Message associated with the response code. | [optional] | +| **e_164_format** | **String** | The telephone number in E.164 format. | [optional] | +| **formatted** | **String** | The formatted version of the telephone number. | [optional] | +| **country** | **String** | The country of the telephone number. | [optional] | +| **line_type** | **String** | The line type of the telephone number. | [optional] | +| **line_provider** | **String** | The messaging service provider of the telephone number. | [optional] | +| **mobile_country_code** | **String** | The first half of the Home Network Identity (HNI). | [optional] | +| **mobile_network_code** | **String** | The second half of the HNI. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::LookupResult.new( + 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 +) +``` + diff --git a/docs/LookupStatus.md b/docs/LookupStatus.md new file mode 100644 index 00000000..4864c861 --- /dev/null +++ b/docs/LookupStatus.md @@ -0,0 +1,24 @@ +# Bandwidth::LookupStatus + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_id** | **String** | The requestId. | [optional] | +| **status** | [**LookupStatusEnum**](LookupStatusEnum.md) | | [optional] | +| **result** | [**Array<LookupResult>**](LookupResult.md) | The carrier information results for the specified telephone number. | [optional] | +| **failed_telephone_numbers** | **Array<String>** | The telephone numbers whose lookup failed. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::LookupStatus.new( + request_id: 004223a0-8b17-41b1-bf81-20732adf5590, + status: null, + result: null, + failed_telephone_numbers: ["+191955512345"] +) +``` + diff --git a/docs/LookupStatusEnum.md b/docs/LookupStatusEnum.md new file mode 100644 index 00000000..f3dbe4d0 --- /dev/null +++ b/docs/LookupStatusEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::LookupStatusEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::LookupStatusEnum.new() +``` + diff --git a/docs/MFAApi.md b/docs/MFAApi.md new file mode 100644 index 00000000..4e626261 --- /dev/null +++ b/docs/MFAApi.md @@ -0,0 +1,226 @@ +# Bandwidth::MFAApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**generate_messaging_code**](MFAApi.md#generate_messaging_code) | **POST** /accounts/{accountId}/code/messaging | Messaging Authentication Code | +| [**generate_voice_code**](MFAApi.md#generate_voice_code) | **POST** /accounts/{accountId}/code/voice | Voice Authentication Code | +| [**verify_code**](MFAApi.md#verify_code) | **POST** /accounts/{accountId}/code/verify | Verify Authentication Code | + + +## generate_messaging_code + +> generate_messaging_code(account_id, code_request) + +Messaging Authentication Code + +Send an MFA code via text message (SMS). + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::MFAApi.new +account_id = 'account_id_example' # String | Bandwidth Account ID with Voice service enabled. +code_request = Bandwidth::CodeRequest.new({to: '+19195551234', from: '+19195554321', application_id: '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', message: 'Your temporary {NAME} {SCOPE} code is {CODE}', digits: 6}) # CodeRequest | MFA code request body. + +begin + # Messaging Authentication Code + result = api_instance.generate_messaging_code(account_id, code_request) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling MFAApi->generate_messaging_code: #{e}" +end +``` + +#### Using the generate_messaging_code_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> generate_messaging_code_with_http_info(account_id, code_request) + +```ruby +begin + # Messaging Authentication Code + data, status_code, headers = api_instance.generate_messaging_code_with_http_info(account_id, code_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling MFAApi->generate_messaging_code_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Bandwidth Account ID with Voice service enabled. | | +| **code_request** | [**CodeRequest**](CodeRequest.md) | MFA code request body. | | + +### Return type + +[**MessagingCodeResponse**](MessagingCodeResponse.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## generate_voice_code + +> generate_voice_code(account_id, code_request) + +Voice Authentication Code + +Send an MFA Code via a phone call. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::MFAApi.new +account_id = 'account_id_example' # String | Bandwidth Account ID with Voice service enabled. +code_request = Bandwidth::CodeRequest.new({to: '+19195551234', from: '+19195554321', application_id: '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', message: 'Your temporary {NAME} {SCOPE} code is {CODE}', digits: 6}) # CodeRequest | MFA code request body. + +begin + # Voice Authentication Code + result = api_instance.generate_voice_code(account_id, code_request) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling MFAApi->generate_voice_code: #{e}" +end +``` + +#### Using the generate_voice_code_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> generate_voice_code_with_http_info(account_id, code_request) + +```ruby +begin + # Voice Authentication Code + data, status_code, headers = api_instance.generate_voice_code_with_http_info(account_id, code_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling MFAApi->generate_voice_code_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Bandwidth Account ID with Voice service enabled. | | +| **code_request** | [**CodeRequest**](CodeRequest.md) | MFA code request body. | | + +### Return type + +[**VoiceCodeResponse**](VoiceCodeResponse.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## verify_code + +> verify_code(account_id, verify_code_request) + +Verify Authentication Code + +Verify a previously sent MFA code. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::MFAApi.new +account_id = 'account_id_example' # String | Bandwidth Account ID with Voice service enabled. +verify_code_request = Bandwidth::VerifyCodeRequest.new({to: '+19195551234', expiration_time_in_minutes: 3, code: '123456'}) # VerifyCodeRequest | MFA code verify request body. + +begin + # Verify Authentication Code + result = api_instance.verify_code(account_id, verify_code_request) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling MFAApi->verify_code: #{e}" +end +``` + +#### Using the verify_code_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> verify_code_with_http_info(account_id, verify_code_request) + +```ruby +begin + # Verify Authentication Code + data, status_code, headers = api_instance.verify_code_with_http_info(account_id, verify_code_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling MFAApi->verify_code_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Bandwidth Account ID with Voice service enabled. | | +| **verify_code_request** | [**VerifyCodeRequest**](VerifyCodeRequest.md) | MFA code verify request body. | | + +### Return type + +[**VerifyCodeResponse**](VerifyCodeResponse.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/MachineDetectionCompleteCallback.md b/docs/MachineDetectionCompleteCallback.md new file mode 100644 index 00000000..fc7e364c --- /dev/null +++ b/docs/MachineDetectionCompleteCallback.md @@ -0,0 +1,44 @@ +# Bandwidth::MachineDetectionCompleteCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **machine_detection_result** | **String** | (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MachineDetectionCompleteCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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: null +) +``` + diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md new file mode 100644 index 00000000..58f11dfa --- /dev/null +++ b/docs/MachineDetectionConfiguration.md @@ -0,0 +1,46 @@ +# Bandwidth::MachineDetectionConfiguration + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **mode** | [**MachineDetectionModeEnum**](MachineDetectionModeEnum.md) | | [optional][default to '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] | +| **speech_end_threshold** | **Float** | Amount of silence (in seconds) before assuming the callee has finished speaking. | [optional][default to 5] | +| **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** | **Boolean** | 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** | **String** | The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode. | [optional] | +| **callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] | +| **username** | **String** | Basic auth username. | [optional] | +| **password** | **String** | Basic auth password. | [optional] | +| **fallback_url** | **String** | 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][default to 'POST'] | +| **fallback_username** | **String** | Basic auth username. | [optional] | +| **fallback_password** | **String** | Basic auth password. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MachineDetectionConfiguration.new( + mode: null, + 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.com/bandwidth/webhooks/machineDetectionComplete, + callback_method: null, + username: mySecretUsername, + password: mySecretPassword1!, + fallback_url: https://myFallbackServer.com/bandwidth/webhooks/machineDetectionComplete, + fallback_method: null, + fallback_username: mySecretUsername, + fallback_password: mySecretPassword1! +) +``` + diff --git a/docs/MachineDetectionModeEnum.md b/docs/MachineDetectionModeEnum.md new file mode 100644 index 00000000..3e9f9b4f --- /dev/null +++ b/docs/MachineDetectionModeEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::MachineDetectionModeEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MachineDetectionModeEnum.new() +``` + diff --git a/docs/Media.md b/docs/Media.md new file mode 100644 index 00000000..73427243 --- /dev/null +++ b/docs/Media.md @@ -0,0 +1,22 @@ +# Bandwidth::Media + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **content** | **String** | | [optional] | +| **content_length** | **Integer** | | [optional] | +| **media_name** | **String** | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Media.new( + content: null, + content_length: null, + media_name: null +) +``` + diff --git a/docs/MediaApi.md b/docs/MediaApi.md new file mode 100644 index 00000000..e1d3938c --- /dev/null +++ b/docs/MediaApi.md @@ -0,0 +1,307 @@ +# Bandwidth::MediaApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**delete_media**](MediaApi.md#delete_media) | **DELETE** /users/{accountId}/media/{mediaId} | Delete Media | +| [**get_media**](MediaApi.md#get_media) | **GET** /users/{accountId}/media/{mediaId} | Get Media | +| [**list_media**](MediaApi.md#list_media) | **GET** /users/{accountId}/media | List Media | +| [**upload_media**](MediaApi.md#upload_media) | **PUT** /users/{accountId}/media/{mediaId} | Upload Media | + + +## delete_media + +> delete_media(account_id, media_id) + +Delete Media + +Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::MediaApi.new +account_id = '9900000' # String | Your Bandwidth Account ID. +media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # String | Media ID to retrieve. + +begin + # Delete Media + api_instance.delete_media(account_id, media_id) +rescue Bandwidth::ApiError => e + puts "Error when calling MediaApi->delete_media: #{e}" +end +``` + +#### Using the delete_media_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_media_with_http_info(account_id, media_id) + +```ruby +begin + # Delete Media + data, status_code, headers = api_instance.delete_media_with_http_info(account_id, media_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling MediaApi->delete_media_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **media_id** | **String** | Media ID to retrieve. | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_media + +> File get_media(account_id, media_id) + +Get Media + +Downloads a media file you previously uploaded. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::MediaApi.new +account_id = '9900000' # String | Your Bandwidth Account ID. +media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # String | Media ID to retrieve. + +begin + # Get Media + result = api_instance.get_media(account_id, media_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling MediaApi->get_media: #{e}" +end +``` + +#### Using the get_media_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> get_media_with_http_info(account_id, media_id) + +```ruby +begin + # Get Media + data, status_code, headers = api_instance.get_media_with_http_info(account_id, media_id) + p status_code # => 2xx + p headers # => { ... } + p data # => File +rescue Bandwidth::ApiError => e + puts "Error when calling MediaApi->get_media_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **media_id** | **String** | Media ID to retrieve. | | + +### Return type + +**File** + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream, application/json + + +## list_media + +> > list_media(account_id, opts) + +List Media + +Gets a list of your media files. No query parameters are supported. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::MediaApi.new +account_id = '9900000' # String | Your Bandwidth Account ID. +opts = { + continuation_token: '1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39' # String | Continuation token used to retrieve subsequent media. +} + +begin + # List Media + result = api_instance.list_media(account_id, opts) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling MediaApi->list_media: #{e}" +end +``` + +#### Using the list_media_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_media_with_http_info(account_id, opts) + +```ruby +begin + # List Media + data, status_code, headers = api_instance.list_media_with_http_info(account_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue Bandwidth::ApiError => e + puts "Error when calling MediaApi->list_media_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **continuation_token** | **String** | Continuation token used to retrieve subsequent media. | [optional] | + +### Return type + +[**Array<Media>**](Media.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## upload_media + +> upload_media(account_id, media_id, body, opts) + +Upload Media + +Upload a file. You may add headers to the request in order to provide some control to your media file. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::MediaApi.new +account_id = '9900000' # String | Your Bandwidth Account ID. +media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # String | Media ID to retrieve. +body = File.new('/path/to/some/file') # File | +opts = { + content_type: 'audio/wav', # String | The media type of the entity-body. + cache_control: 'no-cache' # String | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. +} + +begin + # Upload Media + api_instance.upload_media(account_id, media_id, body, opts) +rescue Bandwidth::ApiError => e + puts "Error when calling MediaApi->upload_media: #{e}" +end +``` + +#### Using the upload_media_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> upload_media_with_http_info(account_id, media_id, body, opts) + +```ruby +begin + # Upload Media + data, status_code, headers = api_instance.upload_media_with_http_info(account_id, media_id, body, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling MediaApi->upload_media_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **media_id** | **String** | Media ID to retrieve. | | +| **body** | **File** | | | +| **content_type** | **String** | The media type of the entity-body. | [optional] | +| **cache_control** | **String** | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json, application/ogg, application/pdf, application/rtf, application/zip, application/x-tar, application/xml, application/gzip, application/x-bzip2, application/x-gzip, application/smil, application/javascript, audio/mp4, audio/mpeg, audio/ogg, audio/flac, audio/webm, audio/wav, audio/amr, audio/3gpp, image/bmp, image/gif, image/jpeg, image/pjpeg, image/png, image/svg+xml, image/tiff, image/webp, image/x-icon, text/css, text/csv, text/calendar, text/plain, text/javascript, text/vcard, text/vnd.wap.wml, text/xml, video/avi, video/mp4, video/mpeg, video/ogg, video/quicktime, video/webm, video/x-ms-wmv +- **Accept**: application/json + diff --git a/docs/Message.md b/docs/Message.md new file mode 100644 index 00000000..1aec01a6 --- /dev/null +++ b/docs/Message.md @@ -0,0 +1,40 @@ +# Bandwidth::Message + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The id of the message. | [optional] | +| **owner** | **String** | The Bandwidth phone number associated with the message. | [optional] | +| **application_id** | **String** | The application ID associated with the message. | [optional] | +| **time** | **String** | The datetime stamp of the message in ISO 8601 | [optional] | +| **segment_count** | **Integer** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] | +| **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | [optional] | +| **to** | **Array<String>** | The phone number recipients of the message. | [optional] | +| **from** | **String** | The phone number the message was sent from. | [optional] | +| **media** | **Array<String>** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] | +| **text** | **String** | The contents of the message. | [optional] | +| **tag** | **String** | The custom string set by the user. | [optional] | +| **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Message.new( + id: 1589228074636lm4k2je7j7jklbn2, + owner: +15554443333, + application_id: 93de2206-9669-4e07-948d-329f4b722ee2, + time: 2022-09-14T18:20:16.000Z, + segment_count: 2, + direction: null, + to: ["+15552223333"], + from: +15553332222, + media: ["https://dev.bandwidth.com/images/bandwidth-logo.png"], + text: Hello world, + tag: custom tag, + priority: null +) +``` + diff --git a/docs/MessageDirectionEnum.md b/docs/MessageDirectionEnum.md new file mode 100644 index 00000000..c79aeb2b --- /dev/null +++ b/docs/MessageDirectionEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::MessageDirectionEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessageDirectionEnum.new() +``` + diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md new file mode 100644 index 00000000..f41af03f --- /dev/null +++ b/docs/MessageRequest.md @@ -0,0 +1,32 @@ +# Bandwidth::MessageRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **application_id** | **String** | The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. | | +| **to** | **Array<String>** | The phone number(s) the message should be sent to in E164 format. | | +| **from** | **String** | One of your telephone numbers the message should come from in E164 format. | | +| **text** | **String** | The contents of the text message. Must be 2048 characters or less. | [optional] | +| **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. | [optional] | +| **tag** | **String** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] | +| **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | +| **expiration** | **String** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessageRequest.new( + application_id: 93de2206-9669-4e07-948d-329f4b722ee2, + to: ["+15554443333","+15552223333"], + 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: null, + expiration: 2021-02-01T11:29:18-05:00 +) +``` + diff --git a/docs/MessageStatusEnum.md b/docs/MessageStatusEnum.md new file mode 100644 index 00000000..4e9f67e4 --- /dev/null +++ b/docs/MessageStatusEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::MessageStatusEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessageStatusEnum.new() +``` + diff --git a/docs/MessageTypeEnum.md b/docs/MessageTypeEnum.md new file mode 100644 index 00000000..325d06ca --- /dev/null +++ b/docs/MessageTypeEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::MessageTypeEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessageTypeEnum.new() +``` + diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md new file mode 100644 index 00000000..2c6bbe96 --- /dev/null +++ b/docs/MessagesApi.md @@ -0,0 +1,179 @@ +# Bandwidth::MessagesApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_message**](MessagesApi.md#create_message) | **POST** /users/{accountId}/messages | Create Message | +| [**list_messages**](MessagesApi.md#list_messages) | **GET** /users/{accountId}/messages | List Messages | + + +## create_message + +> create_message(account_id, message_request) + +Create Message + +Endpoint for sending text messages and picture messages using V2 messaging. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::MessagesApi.new +account_id = '9900000' # String | Your Bandwidth Account ID. +message_request = Bandwidth::MessageRequest.new({application_id: '93de2206-9669-4e07-948d-329f4b722ee2', to: ["+15554443333", "+15552223333"], from: '+15551113333'}) # MessageRequest | + +begin + # Create Message + result = api_instance.create_message(account_id, message_request) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling MessagesApi->create_message: #{e}" +end +``` + +#### Using the create_message_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_message_with_http_info(account_id, message_request) + +```ruby +begin + # Create Message + data, status_code, headers = api_instance.create_message_with_http_info(account_id, message_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling MessagesApi->create_message_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **message_request** | [**MessageRequest**](MessageRequest.md) | | | + +### Return type + +[**Message**](Message.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## list_messages + +> list_messages(account_id, opts) + +List Messages + +Returns a list of messages based on query parameters. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::MessagesApi.new +account_id = '9900000' # String | Your Bandwidth Account ID. +opts = { + message_id: '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6', # String | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + source_tn: '%2B15554443333', # String | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + destination_tn: '%2B15554443333', # String | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + message_status: Bandwidth::MessageStatusEnum::RECEIVED, # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + message_direction: Bandwidth::ListMessageDirectionEnum::INBOUND, # ListMessageDirectionEnum | The direction of the message. One of INBOUND OUTBOUND. + carrier_name: 'Verizon', # String | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + message_type: Bandwidth::MessageTypeEnum::SMS, # MessageTypeEnum | The type of message. Either sms or mms. + error_code: 9902, # Integer | The error code of the message. + from_date_time: '2022-09-14T18:20:16.000Z', # String | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + to_date_time: '2022-09-14T18:20:16.000Z', # String | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + sort: 'sourceTn:desc', # String | The field and direction to sort by combined with a colon. Direction is either asc or desc. + page_token: 'gdEewhcJLQRB5', # String | A base64 encoded value used for pagination of results. + limit: 50 # Integer | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. +} + +begin + # List Messages + result = api_instance.list_messages(account_id, opts) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling MessagesApi->list_messages: #{e}" +end +``` + +#### Using the list_messages_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_messages_with_http_info(account_id, opts) + +```ruby +begin + # List Messages + data, status_code, headers = api_instance.list_messages_with_http_info(account_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling MessagesApi->list_messages_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **message_id** | **String** | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] | +| **source_tn** | **String** | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] | +| **destination_tn** | **String** | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] | +| **message_status** | [**MessageStatusEnum**](.md) | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] | +| **message_direction** | [**ListMessageDirectionEnum**](.md) | The direction of the message. One of INBOUND OUTBOUND. | [optional] | +| **carrier_name** | **String** | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] | +| **message_type** | [**MessageTypeEnum**](.md) | The type of message. Either sms or mms. | [optional] | +| **error_code** | **Integer** | The error code of the message. | [optional] | +| **from_date_time** | **String** | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | +| **to_date_time** | **String** | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | +| **sort** | **String** | The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional] | +| **page_token** | **String** | A base64 encoded value used for pagination of results. | [optional] | +| **limit** | **Integer** | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] | + +### Return type + +[**MessagesList**](MessagesList.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/MessagesList.md b/docs/MessagesList.md new file mode 100644 index 00000000..515acb80 --- /dev/null +++ b/docs/MessagesList.md @@ -0,0 +1,22 @@ +# Bandwidth::MessagesList + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **total_count** | **Integer** | Total number of messages matched by the search. | [optional] | +| **page_info** | [**PageInfo**](PageInfo.md) | | [optional] | +| **messages** | [**Array<ListMessageItem>**](ListMessageItem.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessagesList.new( + total_count: 100, + page_info: null, + messages: null +) +``` + diff --git a/docs/MessagingCodeResponse.md b/docs/MessagingCodeResponse.md new file mode 100644 index 00000000..0f1d7930 --- /dev/null +++ b/docs/MessagingCodeResponse.md @@ -0,0 +1,18 @@ +# Bandwidth::MessagingCodeResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message_id** | **String** | Messaging API Message ID. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessagingCodeResponse.new( + message_id: 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 +) +``` + diff --git a/docs/MessagingRequestError.md b/docs/MessagingRequestError.md new file mode 100644 index 00000000..26ec1624 --- /dev/null +++ b/docs/MessagingRequestError.md @@ -0,0 +1,20 @@ +# Bandwidth::MessagingRequestError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | | | +| **description** | **String** | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessagingRequestError.new( + type: null, + description: null +) +``` + diff --git a/docs/MfaForbiddenRequestError.md b/docs/MfaForbiddenRequestError.md new file mode 100644 index 00000000..4e311511 --- /dev/null +++ b/docs/MfaForbiddenRequestError.md @@ -0,0 +1,18 @@ +# Bandwidth::MfaForbiddenRequestError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message** | **String** | The message containing the reason behind the request being forbidden. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MfaForbiddenRequestError.new( + message: Missing Authentication Token +) +``` + diff --git a/docs/MfaRequestError.md b/docs/MfaRequestError.md new file mode 100644 index 00000000..6fd9adbe --- /dev/null +++ b/docs/MfaRequestError.md @@ -0,0 +1,20 @@ +# Bandwidth::MfaRequestError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **error** | **String** | A message describing the error with your request. | [optional] | +| **request_id** | **String** | The associated requestId from AWS. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MfaRequestError.new( + error: 400 Request is malformed or invalid, + request_id: 354cc8a3-6701-461e-8fa7-8671703dd898 +) +``` + diff --git a/docs/MfaUnauthorizedRequestError.md b/docs/MfaUnauthorizedRequestError.md new file mode 100644 index 00000000..c1dec158 --- /dev/null +++ b/docs/MfaUnauthorizedRequestError.md @@ -0,0 +1,18 @@ +# Bandwidth::MfaUnauthorizedRequestError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message** | **String** | Unauthorized | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MfaUnauthorizedRequestError.new( + message: Unauthorized +) +``` + diff --git a/docs/PageInfo.md b/docs/PageInfo.md new file mode 100644 index 00000000..8a0a864d --- /dev/null +++ b/docs/PageInfo.md @@ -0,0 +1,24 @@ +# Bandwidth::PageInfo + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **prev_page** | **String** | The link to the previous page for pagination. | [optional] | +| **next_page** | **String** | The link to the next page for pagination. | [optional] | +| **prev_page_token** | **String** | The isolated pagination token for the previous page. | [optional] | +| **next_page_token** | **String** | The isolated pagination token for the next page. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::PageInfo.new( + 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 +) +``` + diff --git a/docs/Participant.md b/docs/Participant.md new file mode 100644 index 00000000..4d57b803 --- /dev/null +++ b/docs/Participant.md @@ -0,0 +1,30 @@ +# Bandwidth::Participant + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique id of the participant. | [optional][readonly] | +| **callback_url** | **String** | Full callback url to use for notifications about this participant. | [optional] | +| **publish_permissions** | [**Array<PublishPermissionsEnum>**](PublishPermissionsEnum.md) | Defines if this participant can publish audio or video. | [optional] | +| **sessions** | **Array<String>** | List of session ids this participant is associated with Capped to one Upon creation of a Participant, returns as an empty array. | [optional][readonly] | +| **subscriptions** | [**Subscriptions**](Subscriptions.md) | | [optional] | +| **tag** | **String** | User defined tag to associate with the participant. | [optional] | +| **device_api_version** | [**DeviceApiVersionEnum**](DeviceApiVersionEnum.md) | | [optional][default to 'V3'] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Participant.new( + id: 320e2af6-13ec-498d-8b51-daba52c37853, + callback_url: https://example.com/callback, + publish_permissions: ["VIDEO","AUDIO"], + sessions: ["75c21163-e110-41bc-bd76-1bb428ec85d5"], + subscriptions: null, + tag: participant1, + device_api_version: null +) +``` + diff --git a/docs/ParticipantSubscription.md b/docs/ParticipantSubscription.md new file mode 100644 index 00000000..913d50dc --- /dev/null +++ b/docs/ParticipantSubscription.md @@ -0,0 +1,20 @@ +# Bandwidth::ParticipantSubscription + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **participant_id** | **String** | The Participant the subscriber will be subscribed to | | +| **stream_aliases** | **Array<String>** | (optional) An array of specific streamAliases owned by the Participant that the subscriber will be subscribed to. Background: A streamAlias is created by a WebRTC client when it connects and declares a name for the related stream. The client is responsible for informing the application of any created streamAliases to enable the application to subscribe to specific streamAliases. Subscribing to a `streamAlias` that does not exist is undefined. If the array is empty all aliases are assumed. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ParticipantSubscription.new( + participant_id: 568749d5-04d5-483d-adf5-deac7dd3d521, + stream_aliases: ["alias_1","alias_2"] +) +``` + diff --git a/docs/ParticipantsApi.md b/docs/ParticipantsApi.md new file mode 100644 index 00000000..3b18501d --- /dev/null +++ b/docs/ParticipantsApi.md @@ -0,0 +1,227 @@ +# Bandwidth::ParticipantsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_participant**](ParticipantsApi.md#create_participant) | **POST** /accounts/{accountId}/participants | Create Participant | +| [**delete_participant**](ParticipantsApi.md#delete_participant) | **DELETE** /accounts/{accountId}/participants/{participantId} | Delete Participant | +| [**get_participant**](ParticipantsApi.md#get_participant) | **GET** /accounts/{accountId}/participants/{participantId} | Get Participant | + + +## create_participant + +> create_participant(account_id, opts) + +Create Participant + +Create a new participant under this account. Participants are idempotent, so relevant parameters must be set in this function if desired. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ParticipantsApi.new +account_id = '9900000' # String | Account ID +opts = { + create_participant_request: Bandwidth::CreateParticipantRequest.new # CreateParticipantRequest | Create participant request body. +} + +begin + # Create Participant + result = api_instance.create_participant(account_id, opts) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling ParticipantsApi->create_participant: #{e}" +end +``` + +#### Using the create_participant_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_participant_with_http_info(account_id, opts) + +```ruby +begin + # Create Participant + data, status_code, headers = api_instance.create_participant_with_http_info(account_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling ParticipantsApi->create_participant_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Account ID | | +| **create_participant_request** | [**CreateParticipantRequest**](CreateParticipantRequest.md) | Create participant request body. | [optional] | + +### Return type + +[**CreateParticipantResponse**](CreateParticipantResponse.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_participant + +> delete_participant(account_id, participant_id) + +Delete Participant + +Delete participant by ID. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ParticipantsApi.new +account_id = '9900000' # String | Account ID +participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID + +begin + # Delete Participant + api_instance.delete_participant(account_id, participant_id) +rescue Bandwidth::ApiError => e + puts "Error when calling ParticipantsApi->delete_participant: #{e}" +end +``` + +#### Using the delete_participant_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_participant_with_http_info(account_id, participant_id) + +```ruby +begin + # Delete Participant + data, status_code, headers = api_instance.delete_participant_with_http_info(account_id, participant_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling ParticipantsApi->delete_participant_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Account ID | | +| **participant_id** | **String** | Participant ID | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_participant + +> get_participant(account_id, participant_id) + +Get Participant + +Get participant by ID. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::ParticipantsApi.new +account_id = '9900000' # String | Account ID +participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID + +begin + # Get Participant + result = api_instance.get_participant(account_id, participant_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling ParticipantsApi->get_participant: #{e}" +end +``` + +#### Using the get_participant_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_participant_with_http_info(account_id, participant_id) + +```ruby +begin + # Get Participant + data, status_code, headers = api_instance.get_participant_with_http_info(account_id, participant_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling ParticipantsApi->get_participant_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Account ID | | +| **participant_id** | **String** | Participant ID | | + +### Return type + +[**Participant**](Participant.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/PhoneNumberLookupApi.md b/docs/PhoneNumberLookupApi.md new file mode 100644 index 00000000..297ab2dd --- /dev/null +++ b/docs/PhoneNumberLookupApi.md @@ -0,0 +1,153 @@ +# Bandwidth::PhoneNumberLookupApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_lookup**](PhoneNumberLookupApi.md#create_lookup) | **POST** /accounts/{accountId}/tnlookup | Create Lookup | +| [**get_lookup_status**](PhoneNumberLookupApi.md#get_lookup_status) | **GET** /accounts/{accountId}/tnlookup/{requestId} | Get Lookup Request Status | + + +## create_lookup + +> create_lookup(account_id, lookup_request) + +Create Lookup + +Create a Phone Number Lookup Request. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::PhoneNumberLookupApi.new +account_id = '9900000' # String | The ID of the Bandwidth account that the user belongs to. +lookup_request = Bandwidth::LookupRequest.new({tns: ['tns_example']}) # LookupRequest | Phone number lookup request. + +begin + # Create Lookup + result = api_instance.create_lookup(account_id, lookup_request) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling PhoneNumberLookupApi->create_lookup: #{e}" +end +``` + +#### Using the create_lookup_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_lookup_with_http_info(account_id, lookup_request) + +```ruby +begin + # Create Lookup + data, status_code, headers = api_instance.create_lookup_with_http_info(account_id, lookup_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling PhoneNumberLookupApi->create_lookup_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | The ID of the Bandwidth account that the user belongs to. | | +| **lookup_request** | [**LookupRequest**](LookupRequest.md) | Phone number lookup request. | | + +### Return type + +[**CreateLookupResponse**](CreateLookupResponse.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## get_lookup_status + +> get_lookup_status(account_id, request_id) + +Get Lookup Request Status + +Get an existing Phone Number Lookup Request. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::PhoneNumberLookupApi.new +account_id = '9900000' # String | The ID of the Bandwidth account that the user belongs to. +request_id = '004223a0-8b17-41b1-bf81-20732adf5590' # String | The phone number lookup request ID from Bandwidth. + +begin + # Get Lookup Request Status + result = api_instance.get_lookup_status(account_id, request_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling PhoneNumberLookupApi->get_lookup_status: #{e}" +end +``` + +#### Using the get_lookup_status_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_lookup_status_with_http_info(account_id, request_id) + +```ruby +begin + # Get Lookup Request Status + data, status_code, headers = api_instance.get_lookup_status_with_http_info(account_id, request_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling PhoneNumberLookupApi->get_lookup_status_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | The ID of the Bandwidth account that the user belongs to. | | +| **request_id** | **String** | The phone number lookup request ID from Bandwidth. | | + +### Return type + +[**LookupStatus**](LookupStatus.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/PriorityEnum.md b/docs/PriorityEnum.md new file mode 100644 index 00000000..34dab6d7 --- /dev/null +++ b/docs/PriorityEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::PriorityEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::PriorityEnum.new() +``` + diff --git a/docs/PublishPermissionsEnum.md b/docs/PublishPermissionsEnum.md new file mode 100644 index 00000000..6b103580 --- /dev/null +++ b/docs/PublishPermissionsEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::PublishPermissionsEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::PublishPermissionsEnum.new() +``` + diff --git a/docs/RecordingAvailableCallback.md b/docs/RecordingAvailableCallback.md new file mode 100644 index 00000000..d76a7576 --- /dev/null +++ b/docs/RecordingAvailableCallback.md @@ -0,0 +1,60 @@ +# Bandwidth::RecordingAvailableCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **parent_call_id** | **String** | (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** | **String** | The unique ID of this recording | [optional] | +| **media_url** | **String** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] | +| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] | +| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] | +| **channels** | **String** | 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] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **status** | **String** | 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** | **String** | 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_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::RecordingAvailableCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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: null, + channels: completed, + tag: exampleTag, + status: completed, + transfer_caller_id: +15555555555, + transfer_to: +15555555555) +) +``` + diff --git a/docs/RecordingCompleteCallback.md b/docs/RecordingCompleteCallback.md new file mode 100644 index 00000000..cf25723b --- /dev/null +++ b/docs/RecordingCompleteCallback.md @@ -0,0 +1,60 @@ +# Bandwidth::RecordingCompleteCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **parent_call_id** | **String** | (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** | **String** | The unique ID of this recording | [optional] | +| **media_url** | **String** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] | +| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] | +| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] | +| **channels** | **Integer** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **transfer_caller_id** | **String** | 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_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::RecordingCompleteCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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: null, + channels: 1, + tag: exampleTag, + transfer_caller_id: +15555555555, + transfer_to: +15555555555) +) +``` + diff --git a/docs/RecordingStateEnum.md b/docs/RecordingStateEnum.md new file mode 100644 index 00000000..1a847b60 --- /dev/null +++ b/docs/RecordingStateEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::RecordingStateEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::RecordingStateEnum.new() +``` + diff --git a/docs/RecordingsApi.md b/docs/RecordingsApi.md new file mode 100644 index 00000000..9148367b --- /dev/null +++ b/docs/RecordingsApi.md @@ -0,0 +1,758 @@ +# Bandwidth::RecordingsApi + +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 | +| [**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 | +| [**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 Transcription + +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. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::RecordingsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID + +begin + # Delete Transcription + api_instance.delete_call_transcription(account_id, call_id, recording_id) +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->delete_call_transcription: #{e}" +end +``` + +#### Using the delete_call_transcription_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_call_transcription_with_http_info(account_id, call_id, recording_id) + +```ruby +begin + # Delete Transcription + data, status_code, headers = api_instance.delete_call_transcription_with_http_info(account_id, call_id, recording_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->delete_call_transcription_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | +| **recording_id** | **String** | Programmable Voice API Recording ID | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_recording + +> delete_recording(account_id, call_id, recording_id) + +Delete Recording + +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. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::RecordingsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID + +begin + # Delete Recording + api_instance.delete_recording(account_id, call_id, recording_id) +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->delete_recording: #{e}" +end +``` + +#### Using the delete_recording_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_recording_with_http_info(account_id, call_id, recording_id) + +```ruby +begin + # Delete Recording + data, status_code, headers = api_instance.delete_recording_with_http_info(account_id, call_id, recording_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->delete_recording_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | +| **recording_id** | **String** | Programmable Voice API Recording ID | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_recording_media + +> delete_recording_media(account_id, call_id, recording_id) + +Delete Recording Media + +Deletes the specified recording's media. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::RecordingsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID + +begin + # Delete Recording Media + api_instance.delete_recording_media(account_id, call_id, recording_id) +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->delete_recording_media: #{e}" +end +``` + +#### Using the delete_recording_media_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_recording_media_with_http_info(account_id, call_id, recording_id) + +```ruby +begin + # Delete Recording Media + data, status_code, headers = api_instance.delete_recording_media_with_http_info(account_id, call_id, recording_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->delete_recording_media_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | +| **recording_id** | **String** | Programmable Voice API Recording ID | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## download_call_recording + +> File download_call_recording(account_id, call_id, recording_id) + +Download Recording + +Downloads the specified recording. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::RecordingsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID + +begin + # Download Recording + result = api_instance.download_call_recording(account_id, call_id, recording_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->download_call_recording: #{e}" +end +``` + +#### Using the download_call_recording_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> download_call_recording_with_http_info(account_id, call_id, recording_id) + +```ruby +begin + # Download Recording + data, status_code, headers = api_instance.download_call_recording_with_http_info(account_id, call_id, recording_id) + p status_code # => 2xx + p headers # => { ... } + p data # => File +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->download_call_recording_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | +| **recording_id** | **String** | Programmable Voice API Recording ID | | + +### Return type + +**File** + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: audio/vnd.wave, audio/mpeg, application/json + + +## get_call_recording + +> get_call_recording(account_id, call_id, recording_id) + +Get Call Recording + +Returns metadata for the specified recording. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::RecordingsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID + +begin + # Get Call Recording + result = api_instance.get_call_recording(account_id, call_id, recording_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->get_call_recording: #{e}" +end +``` + +#### Using the get_call_recording_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_call_recording_with_http_info(account_id, call_id, recording_id) + +```ruby +begin + # Get Call Recording + data, status_code, headers = api_instance.get_call_recording_with_http_info(account_id, call_id, recording_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->get_call_recording_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | +| **recording_id** | **String** | Programmable Voice API Recording ID | | + +### Return type + +[**CallRecordingMetadata**](CallRecordingMetadata.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_call_transcription + +> get_call_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. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::RecordingsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID + +begin + # Get Transcription + result = api_instance.get_call_transcription(account_id, call_id, recording_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->get_call_transcription: #{e}" +end +``` + +#### Using the get_call_transcription_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_call_transcription_with_http_info(account_id, call_id, recording_id) + +```ruby +begin + # Get Transcription + data, status_code, headers = api_instance.get_call_transcription_with_http_info(account_id, call_id, recording_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->get_call_transcription_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | +| **recording_id** | **String** | Programmable Voice API Recording ID | | + +### Return type + +[**TranscriptionList**](TranscriptionList.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_account_call_recordings + +> > list_account_call_recordings(account_id, opts) + +Get Call Recordings + +Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::RecordingsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +opts = { + to: '%2b19195551234', # String | Filter results by the `to` field. + from: '%2b19195554321', # String | Filter results by the `from` field. + min_start_time: '2022-06-21T19:13:21Z', # String | Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). + max_start_time: '2022-06-21T19:13:21Z' # String | Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). +} + +begin + # Get Call Recordings + result = api_instance.list_account_call_recordings(account_id, opts) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->list_account_call_recordings: #{e}" +end +``` + +#### Using the list_account_call_recordings_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_account_call_recordings_with_http_info(account_id, opts) + +```ruby +begin + # Get Call Recordings + data, status_code, headers = api_instance.list_account_call_recordings_with_http_info(account_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->list_account_call_recordings_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **to** | **String** | Filter results by the `to` field. | [optional] | +| **from** | **String** | Filter results by the `from` field. | [optional] | +| **min_start_time** | **String** | Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). | [optional] | +| **max_start_time** | **String** | Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). | [optional] | + +### Return type + +[**Array<CallRecordingMetadata>**](CallRecordingMetadata.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_call_recordings + +> > list_call_recordings(account_id, call_id) + +List Call Recordings + +Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::RecordingsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID + +begin + # List Call Recordings + result = api_instance.list_call_recordings(account_id, call_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->list_call_recordings: #{e}" +end +``` + +#### Using the list_call_recordings_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_call_recordings_with_http_info(account_id, call_id) + +```ruby +begin + # List Call Recordings + data, status_code, headers = api_instance.list_call_recordings_with_http_info(account_id, call_id) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->list_call_recordings_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | + +### Return type + +[**Array<CallRecordingMetadata>**](CallRecordingMetadata.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## transcribe_call_recording + +> transcribe_call_recording(account_id, call_id, recording_id, transcribe_recording) + +Create Transcription Request + +Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::RecordingsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID +transcribe_recording = Bandwidth::TranscribeRecording.new # TranscribeRecording | + +begin + # Create Transcription Request + api_instance.transcribe_call_recording(account_id, call_id, recording_id, transcribe_recording) +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->transcribe_call_recording: #{e}" +end +``` + +#### Using the transcribe_call_recording_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording) + +```ruby +begin + # Create Transcription Request + data, status_code, headers = api_instance.transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->transcribe_call_recording_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | +| **recording_id** | **String** | Programmable Voice API Recording ID | | +| **transcribe_recording** | [**TranscribeRecording**](TranscribeRecording.md) | | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_call_recording_state + +> update_call_recording_state(account_id, call_id, update_call_recording) + +Update Recording + +Pause or resume a recording on an active phone call. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::RecordingsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +update_call_recording = Bandwidth::UpdateCallRecording.new({state: Bandwidth::RecordingStateEnum::PAUSED}) # UpdateCallRecording | + +begin + # Update Recording + api_instance.update_call_recording_state(account_id, call_id, update_call_recording) +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->update_call_recording_state: #{e}" +end +``` + +#### Using the update_call_recording_state_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_call_recording_state_with_http_info(account_id, call_id, update_call_recording) + +```ruby +begin + # Update Recording + data, status_code, headers = api_instance.update_call_recording_state_with_http_info(account_id, call_id, update_call_recording) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling RecordingsApi->update_call_recording_state_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | +| **call_id** | **String** | Programmable Voice API Call ID | | +| **update_call_recording** | [**UpdateCallRecording**](UpdateCallRecording.md) | | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/RedirectCallback.md b/docs/RedirectCallback.md new file mode 100644 index 00000000..1a29f0f0 --- /dev/null +++ b/docs/RedirectCallback.md @@ -0,0 +1,48 @@ +# Bandwidth::RedirectCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **parent_call_id** | **String** | (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] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **transfer_caller_id** | **String** | 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_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::RedirectCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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) +) +``` + diff --git a/docs/RedirectMethodEnum.md b/docs/RedirectMethodEnum.md new file mode 100644 index 00000000..6a3b89cf --- /dev/null +++ b/docs/RedirectMethodEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::RedirectMethodEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::RedirectMethodEnum.new() +``` + diff --git a/docs/RequestError.md b/docs/RequestError.md new file mode 100644 index 00000000..435a830b --- /dev/null +++ b/docs/RequestError.md @@ -0,0 +1,20 @@ +# Bandwidth::RequestError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **error** | **String** | A message describing the error with your request. | [optional] | +| **request_id** | **String** | The associated requestId from AWS. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::RequestError.new( + error: Internal error, + request_id: 12af78d1-5f88-4917-925d-17c1ac8fda7a +) +``` + diff --git a/docs/Session.md b/docs/Session.md new file mode 100644 index 00000000..3ecaf79a --- /dev/null +++ b/docs/Session.md @@ -0,0 +1,20 @@ +# Bandwidth::Session + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique id of the session. | [optional] | +| **tag** | **String** | User defined tag to associate with the session. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Session.new( + id: 75c21163-e110-41bc-bd76-1bb428ec85d5, + tag: session1 +) +``` + diff --git a/docs/SessionsApi.md b/docs/SessionsApi.md new file mode 100644 index 00000000..83a64520 --- /dev/null +++ b/docs/SessionsApi.md @@ -0,0 +1,605 @@ +# Bandwidth::SessionsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**add_participant_to_session**](SessionsApi.md#add_participant_to_session) | **PUT** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId} | Add Participant to Session | +| [**create_session**](SessionsApi.md#create_session) | **POST** /accounts/{accountId}/sessions | Create Session | +| [**delete_session**](SessionsApi.md#delete_session) | **DELETE** /accounts/{accountId}/sessions/{sessionId} | Delete Session | +| [**get_participant_subscriptions**](SessionsApi.md#get_participant_subscriptions) | **GET** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions | Get Participant Subscriptions | +| [**get_session**](SessionsApi.md#get_session) | **GET** /accounts/{accountId}/sessions/{sessionId} | Get Session | +| [**list_session_participants**](SessionsApi.md#list_session_participants) | **GET** /accounts/{accountId}/sessions/{sessionId}/participants | List Participants in Session | +| [**remove_participant_from_session**](SessionsApi.md#remove_participant_from_session) | **DELETE** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId} | Remove Participant from Session | +| [**update_participant_subscriptions**](SessionsApi.md#update_participant_subscriptions) | **PUT** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions | Update Participant Subscriptions | + + +## add_participant_to_session + +> add_participant_to_session(account_id, session_id, participant_id, opts) + +Add Participant to Session + +Add a participant to a session. Subscriptions can optionally be provided as part of this call. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::SessionsApi.new +account_id = '9900000' # String | Account ID +session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID +participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID +opts = { + subscriptions: Bandwidth::Subscriptions.new # Subscriptions | The Body describes an optional set of subscriptions to apply to the participant. Calling this endpoint with no/empty body will only add the participant to the session, and will not subscribe the Participant to any media. The request body for this endpoint is OPTIONAL and provided as a convenience to avoid additional calls to the Update Participant Subscriptions endpoint. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created +} + +begin + # Add Participant to Session + api_instance.add_participant_to_session(account_id, session_id, participant_id, opts) +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->add_participant_to_session: #{e}" +end +``` + +#### Using the add_participant_to_session_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> add_participant_to_session_with_http_info(account_id, session_id, participant_id, opts) + +```ruby +begin + # Add Participant to Session + data, status_code, headers = api_instance.add_participant_to_session_with_http_info(account_id, session_id, participant_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->add_participant_to_session_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Account ID | | +| **session_id** | **String** | Session ID | | +| **participant_id** | **String** | Participant ID | | +| **subscriptions** | [**Subscriptions**](Subscriptions.md) | The Body describes an optional set of subscriptions to apply to the participant. Calling this endpoint with no/empty body will only add the participant to the session, and will not subscribe the Participant to any media. The request body for this endpoint is OPTIONAL and provided as a convenience to avoid additional calls to the Update Participant Subscriptions endpoint. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created | [optional] | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_session + +> create_session(account_id, opts) + +Create Session + +Create a new session. Sessions are idempotent, so relevant parameters must be set in this function if desired. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::SessionsApi.new +account_id = '9900000' # String | Account ID +opts = { + session: Bandwidth::Session.new # Session | Create session request body. +} + +begin + # Create Session + result = api_instance.create_session(account_id, opts) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->create_session: #{e}" +end +``` + +#### Using the create_session_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_session_with_http_info(account_id, opts) + +```ruby +begin + # Create Session + data, status_code, headers = api_instance.create_session_with_http_info(account_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->create_session_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Account ID | | +| **session** | [**Session**](Session.md) | Create session request body. | [optional] | + +### Return type + +[**Session**](Session.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_session + +> delete_session(account_id, session_id) + +Delete Session + +Delete session by ID. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::SessionsApi.new +account_id = '9900000' # String | Account ID +session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID + +begin + # Delete Session + api_instance.delete_session(account_id, session_id) +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->delete_session: #{e}" +end +``` + +#### Using the delete_session_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_session_with_http_info(account_id, session_id) + +```ruby +begin + # Delete Session + data, status_code, headers = api_instance.delete_session_with_http_info(account_id, session_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->delete_session_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Account ID | | +| **session_id** | **String** | Session ID | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_participant_subscriptions + +> get_participant_subscriptions(account_id, session_id, participant_id) + +Get Participant Subscriptions + +Get a participant's subscriptions. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::SessionsApi.new +account_id = '9900000' # String | Account ID +session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID +participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID + +begin + # Get Participant Subscriptions + result = api_instance.get_participant_subscriptions(account_id, session_id, participant_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->get_participant_subscriptions: #{e}" +end +``` + +#### Using the get_participant_subscriptions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_participant_subscriptions_with_http_info(account_id, session_id, participant_id) + +```ruby +begin + # Get Participant Subscriptions + data, status_code, headers = api_instance.get_participant_subscriptions_with_http_info(account_id, session_id, participant_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->get_participant_subscriptions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Account ID | | +| **session_id** | **String** | Session ID | | +| **participant_id** | **String** | Participant ID | | + +### Return type + +[**Subscriptions**](Subscriptions.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_session + +> get_session(account_id, session_id) + +Get Session + +Get session by ID. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::SessionsApi.new +account_id = '9900000' # String | Account ID +session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID + +begin + # Get Session + result = api_instance.get_session(account_id, session_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->get_session: #{e}" +end +``` + +#### Using the get_session_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_session_with_http_info(account_id, session_id) + +```ruby +begin + # Get Session + data, status_code, headers = api_instance.get_session_with_http_info(account_id, session_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->get_session_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Account ID | | +| **session_id** | **String** | Session ID | | + +### Return type + +[**Session**](Session.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_session_participants + +> > list_session_participants(account_id, session_id) + +List Participants in Session + +List participants in a session. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::SessionsApi.new +account_id = '9900000' # String | Account ID +session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID + +begin + # List Participants in Session + result = api_instance.list_session_participants(account_id, session_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->list_session_participants: #{e}" +end +``` + +#### Using the list_session_participants_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_session_participants_with_http_info(account_id, session_id) + +```ruby +begin + # List Participants in Session + data, status_code, headers = api_instance.list_session_participants_with_http_info(account_id, session_id) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->list_session_participants_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Account ID | | +| **session_id** | **String** | Session ID | | + +### Return type + +[**Array<Participant>**](Participant.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## remove_participant_from_session + +> remove_participant_from_session(account_id, session_id, participant_id) + +Remove Participant from Session + +Remove a participant from a session. This will automatically remove any subscriptions the participant has associated with this session. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::SessionsApi.new +account_id = '9900000' # String | Account ID +session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID +participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID + +begin + # Remove Participant from Session + api_instance.remove_participant_from_session(account_id, session_id, participant_id) +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->remove_participant_from_session: #{e}" +end +``` + +#### Using the remove_participant_from_session_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> remove_participant_from_session_with_http_info(account_id, session_id, participant_id) + +```ruby +begin + # Remove Participant from Session + data, status_code, headers = api_instance.remove_participant_from_session_with_http_info(account_id, session_id, participant_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->remove_participant_from_session_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Account ID | | +| **session_id** | **String** | Session ID | | +| **participant_id** | **String** | Participant ID | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_participant_subscriptions + +> update_participant_subscriptions(account_id, session_id, participant_id, opts) + +Update Participant Subscriptions + +Update a participant's subscriptions. This is a full update that will replace the participant's subscriptions. It allows subscription to the entire Session, a subset list of Participants in that Session, or specific media streams on any of the listed Participants. First call `getParticipantSubscriptions` if you need the current subscriptions. Calling this API with no `Subscriptions` object to remove all subscriptions. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::SessionsApi.new +account_id = '9900000' # String | Account ID +session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID +participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID +opts = { + subscriptions: Bandwidth::Subscriptions.new # Subscriptions | The body describes the desired subscriptions for the Participant. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created +} + +begin + # Update Participant Subscriptions + api_instance.update_participant_subscriptions(account_id, session_id, participant_id, opts) +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->update_participant_subscriptions: #{e}" +end +``` + +#### Using the update_participant_subscriptions_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts) + +```ruby +begin + # Update Participant Subscriptions + data, status_code, headers = api_instance.update_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling SessionsApi->update_participant_subscriptions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Account ID | | +| **session_id** | **String** | Session ID | | +| **participant_id** | **String** | Participant ID | | +| **subscriptions** | [**Subscriptions**](Subscriptions.md) | The body describes the desired subscriptions for the Participant. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created | [optional] | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/StatisticsApi.md b/docs/StatisticsApi.md new file mode 100644 index 00000000..d186fb64 --- /dev/null +++ b/docs/StatisticsApi.md @@ -0,0 +1,78 @@ +# Bandwidth::StatisticsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**get_statistics**](StatisticsApi.md#get_statistics) | **GET** /accounts/{accountId}/statistics | Get Account Statistics | + + +## get_statistics + +> get_statistics(account_id) + +Get Account Statistics + +Returns details about the current state of the account. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Bandwidth::StatisticsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID + +begin + # Get Account Statistics + result = api_instance.get_statistics(account_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling StatisticsApi->get_statistics: #{e}" +end +``` + +#### Using the get_statistics_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_statistics_with_http_info(account_id) + +```ruby +begin + # Get Account Statistics + data, status_code, headers = api_instance.get_statistics_with_http_info(account_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling StatisticsApi->get_statistics_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID | | + +### Return type + +[**AccountStatistics**](AccountStatistics.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/StirShaken.md b/docs/StirShaken.md new file mode 100644 index 00000000..42f1e965 --- /dev/null +++ b/docs/StirShaken.md @@ -0,0 +1,22 @@ +# Bandwidth::StirShaken + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **verstat** | **String** | (optional) The verification status indicating whether the verification was successful or not. Possible values are TN-Verification-Passed and TN-Verification-Failed. | [optional] | +| **attestation_indicator** | **String** | (optional) The attestation level verified by Bandwidth. Possible values are A (full), B (partial) or C (gateway). | [optional] | +| **originating_id** | **String** | (optional) A unique origination identifier. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::StirShaken.new( + verstat: Tn-Verification-Passed, + attestation_indicator: A, + originating_id: 99759086-1335-11ed-9bcf-5f7d464e91af +) +``` + diff --git a/docs/Subscriptions.md b/docs/Subscriptions.md new file mode 100644 index 00000000..ada96411 --- /dev/null +++ b/docs/Subscriptions.md @@ -0,0 +1,20 @@ +# Bandwidth::Subscriptions + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **session_id** | **String** | If present, and not overridden by the array of participants, it represents the session the subscriptions are associated with. If this is the only field, the subscriber will be subscribed to all participants in the session (including any participants that are later added to the session). Upon creation of a Participant, returns as an empty object. | [optional] | +| **participants** | [**Array<ParticipantSubscription>**](ParticipantSubscription.md) | (optional) A list of participants in the session that will be subscribed to. If present and not empty or null, this will override any sessionId specified in the body. Returns empty if used during the creation of a Participant. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Subscriptions.new( + session_id: d8886aad-b956-4e1b-b2f4-d7c9f8162772, + participants: [{"participantId":"568749d5-04d5-483d-adf5-deac7dd3d521"},{"participantId":"0275e47f-dd21-4cf0-a1e1-dfdc719e73a7","streamAliases":["alias_1","alias_2"]}] +) +``` + diff --git a/docs/Tag.md b/docs/Tag.md new file mode 100644 index 00000000..0c2a8756 --- /dev/null +++ b/docs/Tag.md @@ -0,0 +1,20 @@ +# Bandwidth::Tag + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key** | **String** | | [optional] | +| **value** | **String** | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Tag.new( + key: null, + value: null +) +``` + diff --git a/docs/TnLookupRequestError.md b/docs/TnLookupRequestError.md new file mode 100644 index 00000000..ed31bd7f --- /dev/null +++ b/docs/TnLookupRequestError.md @@ -0,0 +1,18 @@ +# Bandwidth::TnLookupRequestError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message** | **String** | A description of what validation error occurred. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::TnLookupRequestError.new( + message: example error message +) +``` + diff --git a/docs/TranscribeRecording.md b/docs/TranscribeRecording.md new file mode 100644 index 00000000..35daa8b0 --- /dev/null +++ b/docs/TranscribeRecording.md @@ -0,0 +1,28 @@ +# Bandwidth::TranscribeRecording + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **callback_url** | **String** | 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][default to 'POST'] | +| **username** | **String** | Basic auth username. | [optional] | +| **password** | **String** | Basic auth password. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **callback_timeout** | **Float** | This is the timeout (in seconds) to use when delivering the webhook to `callbackUrl`. Can be any numeric value (including decimals) between 1 and 25. | [optional][default to 15] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::TranscribeRecording.new( + callback_url: https://myServer.com/bandwidth/webhooks/transcriptionAvailable, + callback_method: null, + username: mySecretUsername, + password: mySecretPassword1!, + tag: exampleTag, + callback_timeout: 5.5 +) +``` + diff --git a/docs/Transcription.md b/docs/Transcription.md new file mode 100644 index 00000000..7caa4d2a --- /dev/null +++ b/docs/Transcription.md @@ -0,0 +1,20 @@ +# Bandwidth::Transcription + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **text** | **String** | The transcribed text | [optional] | +| **confidence** | **Float** | The confidence on the recognized content, ranging from `0.0` to `1.0` with `1.0` being the highest confidence. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Transcription.new( + text: Nice talking to you, friend!, + confidence: 0.9 +) +``` + diff --git a/docs/TranscriptionAvailableCallback.md b/docs/TranscriptionAvailableCallback.md new file mode 100644 index 00000000..a4e1b40e --- /dev/null +++ b/docs/TranscriptionAvailableCallback.md @@ -0,0 +1,58 @@ +# Bandwidth::TranscriptionAvailableCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **media_url** | **String** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] | +| **parent_call_id** | **String** | (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** | **String** | The unique ID of this recording | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] | +| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] | +| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **transcription** | [**Transcription**](Transcription.md) | | [optional] | +| **transfer_caller_id** | **String** | 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_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::TranscriptionAvailableCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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: null, + tag: exampleTag, + transcription: null, + transfer_caller_id: +15555555555, + transfer_to: +15555555555) +) +``` + diff --git a/docs/TranscriptionList.md b/docs/TranscriptionList.md new file mode 100644 index 00000000..949c92cf --- /dev/null +++ b/docs/TranscriptionList.md @@ -0,0 +1,18 @@ +# Bandwidth::TranscriptionList + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **transcripts** | [**Array<Transcription>**](Transcription.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::TranscriptionList.new( + transcripts: null +) +``` + diff --git a/docs/TranscriptionMetadata.md b/docs/TranscriptionMetadata.md new file mode 100644 index 00000000..b9a4d61f --- /dev/null +++ b/docs/TranscriptionMetadata.md @@ -0,0 +1,24 @@ +# Bandwidth::TranscriptionMetadata + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique transcription ID | [optional] | +| **status** | **String** | 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** | **String** | The time that the transcription was completed | [optional] | +| **url** | **String** | The URL of the [transcription](#operation/getCallTranscription) | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::TranscriptionMetadata.new( + 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 +) +``` + diff --git a/docs/TransferAnswerCallback.md b/docs/TransferAnswerCallback.md new file mode 100644 index 00000000..86cda344 --- /dev/null +++ b/docs/TransferAnswerCallback.md @@ -0,0 +1,46 @@ +# Bandwidth::TransferAnswerCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **transfer_caller_id** | **String** | 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_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::TransferAnswerCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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) +) +``` + diff --git a/docs/TransferCompleteCallback.md b/docs/TransferCompleteCallback.md new file mode 100644 index 00000000..5b6b2062 --- /dev/null +++ b/docs/TransferCompleteCallback.md @@ -0,0 +1,52 @@ +# Bandwidth::TransferCompleteCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **transfer_caller_id** | **String** | 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_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] | +| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] | +| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] | +| **error_id** | **String** | Bandwidth's internal id that references the error event. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::TransferCompleteCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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 +) +``` + diff --git a/docs/TransferDisconnectCallback.md b/docs/TransferDisconnectCallback.md new file mode 100644 index 00000000..5c323d3f --- /dev/null +++ b/docs/TransferDisconnectCallback.md @@ -0,0 +1,56 @@ +# Bandwidth::TransferDisconnectCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **parent_call_id** | **String** | (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] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | +| **transfer_caller_id** | **String** | 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_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] | +| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] | +| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] | +| **error_id** | **String** | Bandwidth's internal id that references the error event. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::TransferDisconnectCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + direction: null, + 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 +) +``` + diff --git a/docs/UnauthorizedRequest.md b/docs/UnauthorizedRequest.md new file mode 100644 index 00000000..e307c8bf --- /dev/null +++ b/docs/UnauthorizedRequest.md @@ -0,0 +1,18 @@ +# Bandwidth::UnauthorizedRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message** | **String** | Unauthorized | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::UnauthorizedRequest.new( + message: Unauthorized +) +``` + diff --git a/docs/UpdateCall.md b/docs/UpdateCall.md new file mode 100644 index 00000000..67c07d8d --- /dev/null +++ b/docs/UpdateCall.md @@ -0,0 +1,36 @@ +# Bandwidth::UpdateCall + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **state** | [**CallStateEnum**](CallStateEnum.md) | | [optional][default to 'active'] | +| **redirect_url** | **String** | 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][default to 'POST'] | +| **username** | **String** | Basic auth username. | [optional] | +| **password** | **String** | Basic auth password. | [optional] | +| **redirect_fallback_url** | **String** | 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][default to 'POST'] | +| **fallback_username** | **String** | Basic auth username. | [optional] | +| **fallback_password** | **String** | Basic auth password. | [optional] | +| **tag** | **String** | 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] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::UpdateCall.new( + state: null, + redirect_url: https://myServer.com/bandwidth/webhooks/redirect, + redirect_method: null, + username: mySecretUsername, + password: mySecretPassword1!, + redirect_fallback_url: https://myFallbackServer.com/bandwidth/webhooks/redirect, + redirect_fallback_method: null, + fallback_username: mySecretUsername, + fallback_password: mySecretPassword1!, + tag: My Custom Tag +) +``` + diff --git a/docs/UpdateCallRecording.md b/docs/UpdateCallRecording.md new file mode 100644 index 00000000..f57cf27d --- /dev/null +++ b/docs/UpdateCallRecording.md @@ -0,0 +1,18 @@ +# Bandwidth::UpdateCallRecording + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **state** | [**RecordingStateEnum**](RecordingStateEnum.md) | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::UpdateCallRecording.new( + state: null +) +``` + diff --git a/docs/UpdateConference.md b/docs/UpdateConference.md new file mode 100644 index 00000000..e4cb22f5 --- /dev/null +++ b/docs/UpdateConference.md @@ -0,0 +1,34 @@ +# Bandwidth::UpdateConference + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **status** | [**ConferenceStateEnum**](ConferenceStateEnum.md) | | [optional][default to 'active'] | +| **redirect_url** | **String** | 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][default to 'POST'] | +| **username** | **String** | Basic auth username. | [optional] | +| **password** | **String** | Basic auth password. | [optional] | +| **redirect_fallback_url** | **String** | 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][default to 'POST'] | +| **fallback_username** | **String** | Basic auth username. | [optional] | +| **fallback_password** | **String** | Basic auth password. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::UpdateConference.new( + status: null, + redirect_url: https://myServer.com/bandwidth/webhooks/conferenceRedirect, + redirect_method: null, + username: mySecretUsername, + password: mySecretPassword1!, + redirect_fallback_url: https://myFallbackServer.com/bandwidth/webhooks/conferenceRedirect, + redirect_fallback_method: null, + fallback_username: mySecretUsername, + fallback_password: mySecretPassword1! +) +``` + diff --git a/docs/UpdateConferenceMember.md b/docs/UpdateConferenceMember.md new file mode 100644 index 00000000..2e3ad699 --- /dev/null +++ b/docs/UpdateConferenceMember.md @@ -0,0 +1,22 @@ +# Bandwidth::UpdateConferenceMember + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **mute** | **Boolean** | Whether or not this member is currently muted. Members who are muted are still able to hear other participants. Updates this member's mute status. Has no effect if omitted. | [optional] | +| **hold** | **Boolean** | Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. Updates this member's hold status. Has no effect if omitted. | [optional] | +| **call_ids_to_coach** | **Array<String>** | If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. Modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::UpdateConferenceMember.new( + mute: false, + hold: false, + call_ids_to_coach: ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] +) +``` + diff --git a/docs/VerifyCodeRequest.md b/docs/VerifyCodeRequest.md new file mode 100644 index 00000000..b85de500 --- /dev/null +++ b/docs/VerifyCodeRequest.md @@ -0,0 +1,24 @@ +# Bandwidth::VerifyCodeRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **to** | **String** | The phone number to send the mfa code to. | | +| **scope** | **String** | An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\". | [optional] | +| **expiration_time_in_minutes** | **Float** | The time period, in minutes, to validate the mfa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively. | | +| **code** | **String** | The generated mfa code to check if valid. | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::VerifyCodeRequest.new( + to: +19195551234, + scope: 2FA, + expiration_time_in_minutes: 3, + code: 123456 +) +``` + diff --git a/docs/VerifyCodeResponse.md b/docs/VerifyCodeResponse.md new file mode 100644 index 00000000..7a34c68c --- /dev/null +++ b/docs/VerifyCodeResponse.md @@ -0,0 +1,18 @@ +# Bandwidth::VerifyCodeResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **valid** | **Boolean** | Whether or not the supplied code is valid. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::VerifyCodeResponse.new( + valid: true +) +``` + diff --git a/docs/VoiceApiError.md b/docs/VoiceApiError.md new file mode 100644 index 00000000..b7e2d143 --- /dev/null +++ b/docs/VoiceApiError.md @@ -0,0 +1,22 @@ +# Bandwidth::VoiceApiError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | | [optional] | +| **description** | **String** | | [optional] | +| **id** | **String** | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::VoiceApiError.new( + type: null, + description: null, + id: null +) +``` + diff --git a/docs/VoiceCodeResponse.md b/docs/VoiceCodeResponse.md new file mode 100644 index 00000000..3d16cefc --- /dev/null +++ b/docs/VoiceCodeResponse.md @@ -0,0 +1,18 @@ +# Bandwidth::VoiceCodeResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **call_id** | **String** | Programmable Voice API Call ID. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::VoiceCodeResponse.new( + call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 +) +``` + diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb new file mode 100644 index 00000000..e1144b86 --- /dev/null +++ b/lib/bandwidth-sdk.rb @@ -0,0 +1,139 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +# Common files +require 'bandwidth-sdk/api_client' +require 'bandwidth-sdk/api_error' +require 'bandwidth-sdk/version' +require 'bandwidth-sdk/configuration' + +# Models +require 'bandwidth-sdk/models/account_statistics' +require 'bandwidth-sdk/models/answer_callback' +require 'bandwidth-sdk/models/bridge_complete_callback' +require 'bandwidth-sdk/models/bridge_target_complete_callback' +require 'bandwidth-sdk/models/call_direction_enum' +require 'bandwidth-sdk/models/call_recording_metadata' +require 'bandwidth-sdk/models/call_state' +require 'bandwidth-sdk/models/call_state_enum' +require 'bandwidth-sdk/models/callback_method_enum' +require 'bandwidth-sdk/models/code_request' +require 'bandwidth-sdk/models/conference' +require 'bandwidth-sdk/models/conference_completed_callback' +require 'bandwidth-sdk/models/conference_created_callback' +require 'bandwidth-sdk/models/conference_member' +require 'bandwidth-sdk/models/conference_member_exit_callback' +require 'bandwidth-sdk/models/conference_member_join_callback' +require 'bandwidth-sdk/models/conference_recording_available_callback' +require 'bandwidth-sdk/models/conference_recording_metadata' +require 'bandwidth-sdk/models/conference_redirect_callback' +require 'bandwidth-sdk/models/conference_state_enum' +require 'bandwidth-sdk/models/create_call' +require 'bandwidth-sdk/models/create_call_response' +require 'bandwidth-sdk/models/create_lookup_response' +require 'bandwidth-sdk/models/create_message_request_error' +require 'bandwidth-sdk/models/create_participant_request' +require 'bandwidth-sdk/models/create_participant_response' +require 'bandwidth-sdk/models/deferred_result' +require 'bandwidth-sdk/models/device_api_version_enum' +require 'bandwidth-sdk/models/disconenct_callback' +require 'bandwidth-sdk/models/diversion' +require 'bandwidth-sdk/models/dtmf_callback' +require 'bandwidth-sdk/models/field_error' +require 'bandwidth-sdk/models/file_format_enum' +require 'bandwidth-sdk/models/forbidden_request' +require 'bandwidth-sdk/models/gather_callback' +require 'bandwidth-sdk/models/initiate_callback' +require 'bandwidth-sdk/models/list_message_direction_enum' +require 'bandwidth-sdk/models/list_message_item' +require 'bandwidth-sdk/models/lookup_request' +require 'bandwidth-sdk/models/lookup_result' +require 'bandwidth-sdk/models/lookup_status' +require 'bandwidth-sdk/models/lookup_status_enum' +require 'bandwidth-sdk/models/machine_detection_complete_callback' +require 'bandwidth-sdk/models/machine_detection_configuration' +require 'bandwidth-sdk/models/machine_detection_mode_enum' +require 'bandwidth-sdk/models/media' +require 'bandwidth-sdk/models/message' +require 'bandwidth-sdk/models/message_direction_enum' +require 'bandwidth-sdk/models/message_request' +require 'bandwidth-sdk/models/message_status_enum' +require 'bandwidth-sdk/models/message_type_enum' +require 'bandwidth-sdk/models/messages_list' +require 'bandwidth-sdk/models/messaging_code_response' +require 'bandwidth-sdk/models/messaging_request_error' +require 'bandwidth-sdk/models/mfa_forbidden_request_error' +require 'bandwidth-sdk/models/mfa_request_error' +require 'bandwidth-sdk/models/mfa_unauthorized_request_error' +require 'bandwidth-sdk/models/page_info' +require 'bandwidth-sdk/models/participant' +require 'bandwidth-sdk/models/participant_subscription' +require 'bandwidth-sdk/models/priority_enum' +require 'bandwidth-sdk/models/publish_permissions_enum' +require 'bandwidth-sdk/models/recording_available_callback' +require 'bandwidth-sdk/models/recording_complete_callback' +require 'bandwidth-sdk/models/recording_state_enum' +require 'bandwidth-sdk/models/redirect_callback' +require 'bandwidth-sdk/models/redirect_method_enum' +require 'bandwidth-sdk/models/request_error' +require 'bandwidth-sdk/models/session' +require 'bandwidth-sdk/models/stir_shaken' +require 'bandwidth-sdk/models/subscriptions' +require 'bandwidth-sdk/models/tag' +require 'bandwidth-sdk/models/tn_lookup_request_error' +require 'bandwidth-sdk/models/transcribe_recording' +require 'bandwidth-sdk/models/transcription' +require 'bandwidth-sdk/models/transcription_available_callback' +require 'bandwidth-sdk/models/transcription_list' +require 'bandwidth-sdk/models/transcription_metadata' +require 'bandwidth-sdk/models/transfer_answer_callback' +require 'bandwidth-sdk/models/transfer_complete_callback' +require 'bandwidth-sdk/models/transfer_disconnect_callback' +require 'bandwidth-sdk/models/unauthorized_request' +require 'bandwidth-sdk/models/update_call' +require 'bandwidth-sdk/models/update_call_recording' +require 'bandwidth-sdk/models/update_conference' +require 'bandwidth-sdk/models/update_conference_member' +require 'bandwidth-sdk/models/verify_code_request' +require 'bandwidth-sdk/models/verify_code_response' +require 'bandwidth-sdk/models/voice_api_error' +require 'bandwidth-sdk/models/voice_code_response' + +# APIs +require 'bandwidth-sdk/api/calls_api' +require 'bandwidth-sdk/api/conferences_api' +require 'bandwidth-sdk/api/mfa_api' +require 'bandwidth-sdk/api/media_api' +require 'bandwidth-sdk/api/messages_api' +require 'bandwidth-sdk/api/participants_api' +require 'bandwidth-sdk/api/phone_number_lookup_api' +require 'bandwidth-sdk/api/recordings_api' +require 'bandwidth-sdk/api/sessions_api' +require 'bandwidth-sdk/api/statistics_api' + +module Bandwidth + class << self + # Customize default settings for the SDK using block. + # Bandwidth.configure do |config| + # config.username = "xxx" + # config.password = "xxx" + # end + # If no block given, return the default Configuration object. + def configure + if block_given? + yield(Configuration.default) + else + Configuration.default + end + end + end +end diff --git a/lib/bandwidth-sdk/api/calls_api.rb b/lib/bandwidth-sdk/api/calls_api.rb new file mode 100644 index 00000000..2526b6b7 --- /dev/null +++ b/lib/bandwidth-sdk/api/calls_api.rb @@ -0,0 +1,325 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'cgi' + +module Bandwidth + class CallsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create Call + # Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. Please note: Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed. + # @param account_id [String] Your Bandwidth Account ID + # @param create_call [CreateCall] JSON object containing information to create an outbound call + # @param [Hash] opts the optional parameters + # @return [CreateCallResponse] + def create_call(account_id, create_call, opts = {}) + data, _status_code, _headers = create_call_with_http_info(account_id, create_call, opts) + data + end + + # Create Call + # Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. <b>Please note:</b> Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed. + # @param account_id [String] Your Bandwidth Account ID + # @param create_call [CreateCall] JSON object containing information to create an outbound call + # @param [Hash] opts the optional parameters + # @return [Array<(CreateCallResponse, Integer, Hash)>] CreateCallResponse data, response status code and response headers + def create_call_with_http_info(account_id, create_call, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CallsApi.create_call ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling CallsApi.create_call" + end + # verify the required parameter 'create_call' is set + if @api_client.config.client_side_validation && create_call.nil? + fail ArgumentError, "Missing the required parameter 'create_call' when calling CallsApi.create_call" + end + # resource path + local_var_path = '/accounts/{accountId}/calls'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_call) + + # return_type + return_type = opts[:debug_return_type] || 'CreateCallResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"CallsApi.create_call", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CallsApi#create_call\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Call State Information + # Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: 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 HTTP 404 response. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param [Hash] opts the optional parameters + # @return [CallState] + def get_call_state(account_id, call_id, opts = {}) + data, _status_code, _headers = get_call_state_with_http_info(account_id, call_id, opts) + data + end + + # Get Call State Information + # Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: 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 HTTP 404 response. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param [Hash] opts the optional parameters + # @return [Array<(CallState, Integer, Hash)>] CallState data, response status code and response headers + def get_call_state_with_http_info(account_id, call_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CallsApi.get_call_state ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling CallsApi.get_call_state" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling CallsApi.get_call_state" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CallState' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"CallsApi.get_call_state", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CallsApi#get_call_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Call + # Interrupts and redirects a call to a different URL that should return a BXML document. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param update_call [UpdateCall] JSON object containing information to redirect an existing call to a new BXML document + # @param [Hash] opts the optional parameters + # @return [nil] + def update_call(account_id, call_id, update_call, opts = {}) + update_call_with_http_info(account_id, call_id, update_call, opts) + nil + end + + # Update Call + # Interrupts and redirects a call to a different URL that should return a BXML document. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param update_call [UpdateCall] JSON object containing information to redirect an existing call to a new BXML document + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_call_with_http_info(account_id, call_id, update_call, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CallsApi.update_call ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling CallsApi.update_call" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling CallsApi.update_call" + end + # verify the required parameter 'update_call' is set + if @api_client.config.client_side_validation && update_call.nil? + fail ArgumentError, "Missing the required parameter 'update_call' when calling CallsApi.update_call" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_call) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"CallsApi.update_call", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CallsApi#update_call\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Call BXML + # Interrupts and replaces an active call's BXML document. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param body [String] + # @param [Hash] opts the optional parameters + # @return [nil] + def update_call_bxml(account_id, call_id, body, opts = {}) + update_call_bxml_with_http_info(account_id, call_id, body, opts) + nil + end + + # Update Call BXML + # Interrupts and replaces an active call's BXML document. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param body [String] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_call_bxml_with_http_info(account_id, call_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CallsApi.update_call_bxml ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling CallsApi.update_call_bxml" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling CallsApi.update_call_bxml" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CallsApi.update_call_bxml" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}/bxml'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/xml']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"CallsApi.update_call_bxml", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CallsApi#update_call_bxml\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/bandwidth-sdk/api/conferences_api.rb b/lib/bandwidth-sdk/api/conferences_api.rb new file mode 100644 index 00000000..72f2ac59 --- /dev/null +++ b/lib/bandwidth-sdk/api/conferences_api.rb @@ -0,0 +1,717 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'cgi' + +module Bandwidth + class ConferencesApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Download Conference Recording + # Downloads the specified recording file. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [File] + def download_conference_recording(account_id, conference_id, recording_id, opts = {}) + data, _status_code, _headers = download_conference_recording_with_http_info(account_id, conference_id, recording_id, opts) + data + end + + # Download Conference Recording + # Downloads the specified recording file. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def download_conference_recording_with_http_info(account_id, conference_id, recording_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConferencesApi.download_conference_recording ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.download_conference_recording" + end + # verify the required parameter 'conference_id' is set + if @api_client.config.client_side_validation && conference_id.nil? + fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.download_conference_recording" + end + # verify the required parameter 'recording_id' is set + if @api_client.config.client_side_validation && recording_id.nil? + fail ArgumentError, "Missing the required parameter 'recording_id' when calling ConferencesApi.download_conference_recording" + end + # resource path + local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['audio/vnd.wave', 'audio/mpeg', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'File' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ConferencesApi.download_conference_recording", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConferencesApi#download_conference_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Conference Information + # Returns information about the specified conference. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param [Hash] opts the optional parameters + # @return [Conference] + def get_conference(account_id, conference_id, opts = {}) + data, _status_code, _headers = get_conference_with_http_info(account_id, conference_id, opts) + data + end + + # Get Conference Information + # Returns information about the specified conference. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param [Hash] opts the optional parameters + # @return [Array<(Conference, Integer, Hash)>] Conference data, response status code and response headers + def get_conference_with_http_info(account_id, conference_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConferencesApi.get_conference ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.get_conference" + end + # verify the required parameter 'conference_id' is set + if @api_client.config.client_side_validation && conference_id.nil? + fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.get_conference" + end + # resource path + local_var_path = '/accounts/{accountId}/conferences/{conferenceId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Conference' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ConferencesApi.get_conference", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConferencesApi#get_conference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Conference Member + # Returns information about the specified conference member. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param member_id [String] Programmable Voice API Conference Member ID + # @param [Hash] opts the optional parameters + # @return [ConferenceMember] + def get_conference_member(account_id, conference_id, member_id, opts = {}) + data, _status_code, _headers = get_conference_member_with_http_info(account_id, conference_id, member_id, opts) + data + end + + # Get Conference Member + # Returns information about the specified conference member. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param member_id [String] Programmable Voice API Conference Member ID + # @param [Hash] opts the optional parameters + # @return [Array<(ConferenceMember, Integer, Hash)>] ConferenceMember data, response status code and response headers + def get_conference_member_with_http_info(account_id, conference_id, member_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConferencesApi.get_conference_member ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.get_conference_member" + end + # verify the required parameter 'conference_id' is set + if @api_client.config.client_side_validation && conference_id.nil? + fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.get_conference_member" + end + # verify the required parameter 'member_id' is set + if @api_client.config.client_side_validation && member_id.nil? + fail ArgumentError, "Missing the required parameter 'member_id' when calling ConferencesApi.get_conference_member" + end + # resource path + local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ConferenceMember' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ConferencesApi.get_conference_member", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConferencesApi#get_conference_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Conference Recording Information + # Returns metadata for the specified recording. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [ConferenceRecordingMetadata] + def get_conference_recording(account_id, conference_id, recording_id, opts = {}) + data, _status_code, _headers = get_conference_recording_with_http_info(account_id, conference_id, recording_id, opts) + data + end + + # Get Conference Recording Information + # Returns metadata for the specified recording. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [Array<(ConferenceRecordingMetadata, Integer, Hash)>] ConferenceRecordingMetadata data, response status code and response headers + def get_conference_recording_with_http_info(account_id, conference_id, recording_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConferencesApi.get_conference_recording ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.get_conference_recording" + end + # verify the required parameter 'conference_id' is set + if @api_client.config.client_side_validation && conference_id.nil? + fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.get_conference_recording" + end + # verify the required parameter 'recording_id' is set + if @api_client.config.client_side_validation && recording_id.nil? + fail ArgumentError, "Missing the required parameter 'recording_id' when calling ConferencesApi.get_conference_recording" + end + # resource path + local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ConferenceRecordingMetadata' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ConferencesApi.get_conference_recording", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConferencesApi#get_conference_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Conference Recordings + # Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param [Hash] opts the optional parameters + # @return [Array] + def list_conference_recordings(account_id, conference_id, opts = {}) + data, _status_code, _headers = list_conference_recordings_with_http_info(account_id, conference_id, opts) + data + end + + # Get Conference Recordings + # Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_conference_recordings_with_http_info(account_id, conference_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConferencesApi.list_conference_recordings ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.list_conference_recordings" + end + # verify the required parameter 'conference_id' is set + if @api_client.config.client_side_validation && conference_id.nil? + fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.list_conference_recordings" + end + # resource path + local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/recordings'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ConferencesApi.list_conference_recordings", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConferencesApi#list_conference_recordings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Conferences + # Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences 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 conference records. + # @param account_id [String] Your Bandwidth Account ID + # @param [Hash] opts the optional parameters + # @option opts [String] :name Filter results by the `name` field. + # @option opts [String] :min_created_time Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). + # @option opts [String] :max_created_time Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). + # @option opts [Integer] :page_size Specifies the max number of conferences that will be returned. (default to 1000) + # @option opts [String] :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. + # @return [Array] + def list_conferences(account_id, opts = {}) + data, _status_code, _headers = list_conferences_with_http_info(account_id, opts) + data + end + + # Get Conferences + # Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences 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 conference records. + # @param account_id [String] Your Bandwidth Account ID + # @param [Hash] opts the optional parameters + # @option opts [String] :name Filter results by the `name` field. + # @option opts [String] :min_created_time Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). + # @option opts [String] :max_created_time Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). + # @option opts [Integer] :page_size Specifies the max number of conferences that will be returned. (default to 1000) + # @option opts [String] :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. + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_conferences_with_http_info(account_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConferencesApi.list_conferences ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.list_conferences" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ConferencesApi.list_conferences, must be smaller than or equal to 1000.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ConferencesApi.list_conferences, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/accounts/{accountId}/conferences'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? + query_params[:'minCreatedTime'] = opts[:'min_created_time'] if !opts[:'min_created_time'].nil? + query_params[:'maxCreatedTime'] = opts[:'max_created_time'] if !opts[:'max_created_time'].nil? + query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ConferencesApi.list_conferences", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConferencesApi#list_conferences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Conference + # Update the conference state. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param update_conference [UpdateConference] + # @param [Hash] opts the optional parameters + # @return [nil] + def update_conference(account_id, conference_id, update_conference, opts = {}) + update_conference_with_http_info(account_id, conference_id, update_conference, opts) + nil + end + + # Update Conference + # Update the conference state. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param update_conference [UpdateConference] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_conference_with_http_info(account_id, conference_id, update_conference, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConferencesApi.update_conference ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.update_conference" + end + # verify the required parameter 'conference_id' is set + if @api_client.config.client_side_validation && conference_id.nil? + fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.update_conference" + end + # verify the required parameter 'update_conference' is set + if @api_client.config.client_side_validation && update_conference.nil? + fail ArgumentError, "Missing the required parameter 'update_conference' when calling ConferencesApi.update_conference" + end + # resource path + local_var_path = '/accounts/{accountId}/conferences/{conferenceId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_conference) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ConferencesApi.update_conference", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConferencesApi#update_conference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Conference BXML + # Update the conference BXML document. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param body [String] + # @param [Hash] opts the optional parameters + # @return [nil] + def update_conference_bxml(account_id, conference_id, body, opts = {}) + update_conference_bxml_with_http_info(account_id, conference_id, body, opts) + nil + end + + # Update Conference BXML + # Update the conference BXML document. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param body [String] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_conference_bxml_with_http_info(account_id, conference_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConferencesApi.update_conference_bxml ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.update_conference_bxml" + end + # verify the required parameter 'conference_id' is set + if @api_client.config.client_side_validation && conference_id.nil? + fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.update_conference_bxml" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ConferencesApi.update_conference_bxml" + end + # resource path + local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/bxml'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/xml']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ConferencesApi.update_conference_bxml", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConferencesApi#update_conference_bxml\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Conference Member + # Updates settings for a particular conference member. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param member_id [String] Programmable Voice API Conference Member ID + # @param update_conference_member [UpdateConferenceMember] + # @param [Hash] opts the optional parameters + # @return [nil] + def update_conference_member(account_id, conference_id, member_id, update_conference_member, opts = {}) + update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member, opts) + nil + end + + # Update Conference Member + # Updates settings for a particular conference member. + # @param account_id [String] Your Bandwidth Account ID + # @param conference_id [String] Programmable Voice API Conference ID + # @param member_id [String] Programmable Voice API Conference Member ID + # @param update_conference_member [UpdateConferenceMember] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ConferencesApi.update_conference_member ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.update_conference_member" + end + # verify the required parameter 'conference_id' is set + if @api_client.config.client_side_validation && conference_id.nil? + fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.update_conference_member" + end + # verify the required parameter 'member_id' is set + if @api_client.config.client_side_validation && member_id.nil? + fail ArgumentError, "Missing the required parameter 'member_id' when calling ConferencesApi.update_conference_member" + end + # verify the required parameter 'update_conference_member' is set + if @api_client.config.client_side_validation && update_conference_member.nil? + fail ArgumentError, "Missing the required parameter 'update_conference_member' when calling ConferencesApi.update_conference_member" + end + # resource path + local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_conference_member) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ConferencesApi.update_conference_member", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ConferencesApi#update_conference_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/bandwidth-sdk/api/media_api.rb b/lib/bandwidth-sdk/api/media_api.rb new file mode 100644 index 00000000..3d79a84d --- /dev/null +++ b/lib/bandwidth-sdk/api/media_api.rb @@ -0,0 +1,312 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'cgi' + +module Bandwidth + class MediaApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Delete Media + # Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name. + # @param account_id [String] Your Bandwidth Account ID. + # @param media_id [String] Media ID to retrieve. + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_media(account_id, media_id, opts = {}) + delete_media_with_http_info(account_id, media_id, opts) + nil + end + + # Delete Media + # Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name. + # @param account_id [String] Your Bandwidth Account ID. + # @param media_id [String] Media ID to retrieve. + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_media_with_http_info(account_id, media_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MediaApi.delete_media ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling MediaApi.delete_media" + end + # verify the required parameter 'media_id' is set + if @api_client.config.client_side_validation && media_id.nil? + fail ArgumentError, "Missing the required parameter 'media_id' when calling MediaApi.delete_media" + end + # resource path + local_var_path = '/users/{accountId}/media/{mediaId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'mediaId' + '}', CGI.escape(media_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"MediaApi.delete_media", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MediaApi#delete_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Media + # Downloads a media file you previously uploaded. + # @param account_id [String] Your Bandwidth Account ID. + # @param media_id [String] Media ID to retrieve. + # @param [Hash] opts the optional parameters + # @return [File] + def get_media(account_id, media_id, opts = {}) + data, _status_code, _headers = get_media_with_http_info(account_id, media_id, opts) + data + end + + # Get Media + # Downloads a media file you previously uploaded. + # @param account_id [String] Your Bandwidth Account ID. + # @param media_id [String] Media ID to retrieve. + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_media_with_http_info(account_id, media_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MediaApi.get_media ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling MediaApi.get_media" + end + # verify the required parameter 'media_id' is set + if @api_client.config.client_side_validation && media_id.nil? + fail ArgumentError, "Missing the required parameter 'media_id' when calling MediaApi.get_media" + end + # resource path + local_var_path = '/users/{accountId}/media/{mediaId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'mediaId' + '}', CGI.escape(media_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'File' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"MediaApi.get_media", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MediaApi#get_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Media + # Gets a list of your media files. No query parameters are supported. + # @param account_id [String] Your Bandwidth Account ID. + # @param [Hash] opts the optional parameters + # @option opts [String] :continuation_token Continuation token used to retrieve subsequent media. + # @return [Array] + def list_media(account_id, opts = {}) + data, _status_code, _headers = list_media_with_http_info(account_id, opts) + data + end + + # List Media + # Gets a list of your media files. No query parameters are supported. + # @param account_id [String] Your Bandwidth Account ID. + # @param [Hash] opts the optional parameters + # @option opts [String] :continuation_token Continuation token used to retrieve subsequent media. + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_media_with_http_info(account_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MediaApi.list_media ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling MediaApi.list_media" + end + # resource path + local_var_path = '/users/{accountId}/media'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Continuation-Token'] = opts[:'continuation_token'] if !opts[:'continuation_token'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"MediaApi.list_media", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MediaApi#list_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Upload Media + # Upload a file. You may add headers to the request in order to provide some control to your media file. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). + # @param account_id [String] Your Bandwidth Account ID. + # @param media_id [String] Media ID to retrieve. + # @param body [File] + # @param [Hash] opts the optional parameters + # @option opts [String] :content_type The media type of the entity-body. + # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + # @return [nil] + def upload_media(account_id, media_id, body, opts = {}) + upload_media_with_http_info(account_id, media_id, body, opts) + nil + end + + # Upload Media + # Upload a file. You may add headers to the request in order to provide some control to your media file. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). + # @param account_id [String] Your Bandwidth Account ID. + # @param media_id [String] Media ID to retrieve. + # @param body [File] + # @param [Hash] opts the optional parameters + # @option opts [String] :content_type The media type of the entity-body. + # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def upload_media_with_http_info(account_id, media_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MediaApi.upload_media ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling MediaApi.upload_media" + end + # verify the required parameter 'media_id' is set + if @api_client.config.client_side_validation && media_id.nil? + fail ArgumentError, "Missing the required parameter 'media_id' when calling MediaApi.upload_media" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MediaApi.upload_media" + end + # resource path + local_var_path = '/users/{accountId}/media/{mediaId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'mediaId' + '}', CGI.escape(media_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json', 'application/ogg', 'application/pdf', 'application/rtf', 'application/zip', 'application/x-tar', 'application/xml', 'application/gzip', 'application/x-bzip2', 'application/x-gzip', 'application/smil', 'application/javascript', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/flac', 'audio/webm', 'audio/wav', 'audio/amr', 'audio/3gpp', 'image/bmp', 'image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/svg+xml', 'image/tiff', 'image/webp', 'image/x-icon', 'text/css', 'text/csv', 'text/calendar', 'text/plain', 'text/javascript', 'text/vcard', 'text/vnd.wap.wml', 'text/xml', 'video/avi', 'video/mp4', 'video/mpeg', 'video/ogg', 'video/quicktime', 'video/webm', 'video/x-ms-wmv']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + header_params[:'Content-Type'] = opts[:'content_type'] if !opts[:'content_type'].nil? + header_params[:'Cache-Control'] = opts[:'cache_control'] if !opts[:'cache_control'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"MediaApi.upload_media", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MediaApi#upload_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/bandwidth-sdk/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb new file mode 100644 index 00000000..3e93641e --- /dev/null +++ b/lib/bandwidth-sdk/api/messages_api.rb @@ -0,0 +1,198 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'cgi' + +module Bandwidth + class MessagesApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create Message + # Endpoint for sending text messages and picture messages using V2 messaging. + # @param account_id [String] Your Bandwidth Account ID. + # @param message_request [MessageRequest] + # @param [Hash] opts the optional parameters + # @return [Message] + def create_message(account_id, message_request, opts = {}) + data, _status_code, _headers = create_message_with_http_info(account_id, message_request, opts) + data + end + + # Create Message + # Endpoint for sending text messages and picture messages using V2 messaging. + # @param account_id [String] Your Bandwidth Account ID. + # @param message_request [MessageRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(Message, Integer, Hash)>] Message data, response status code and response headers + def create_message_with_http_info(account_id, message_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MessagesApi.create_message ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling MessagesApi.create_message" + end + # verify the required parameter 'message_request' is set + if @api_client.config.client_side_validation && message_request.nil? + fail ArgumentError, "Missing the required parameter 'message_request' when calling MessagesApi.create_message" + end + # resource path + local_var_path = '/users/{accountId}/messages'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(message_request) + + # return_type + return_type = opts[:debug_return_type] || 'Message' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"MessagesApi.create_message", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MessagesApi#create_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Messages + # Returns a list of messages based on query parameters. + # @param account_id [String] Your Bandwidth Account ID. + # @param [Hash] opts the optional parameters + # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + # @option opts [ListMessageDirectionEnum] :message_direction The direction of the message. One of INBOUND OUTBOUND. + # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + # @option opts [MessageTypeEnum] :message_type The type of message. Either sms or mms. + # @option opts [Integer] :error_code The error code of the message. + # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. + # @option opts [String] :page_token A base64 encoded value used for pagination of results. + # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + # @return [MessagesList] + def list_messages(account_id, opts = {}) + data, _status_code, _headers = list_messages_with_http_info(account_id, opts) + data + end + + # List Messages + # Returns a list of messages based on query parameters. + # @param account_id [String] Your Bandwidth Account ID. + # @param [Hash] opts the optional parameters + # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + # @option opts [ListMessageDirectionEnum] :message_direction The direction of the message. One of INBOUND OUTBOUND. + # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + # @option opts [MessageTypeEnum] :message_type The type of message. Either sms or mms. + # @option opts [Integer] :error_code The error code of the message. + # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. + # @option opts [String] :page_token A base64 encoded value used for pagination of results. + # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + # @return [Array<(MessagesList, Integer, Hash)>] MessagesList data, response status code and response headers + def list_messages_with_http_info(account_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MessagesApi.list_messages ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling MessagesApi.list_messages" + end + # resource path + local_var_path = '/users/{accountId}/messages'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'messageId'] = opts[:'message_id'] if !opts[:'message_id'].nil? + query_params[:'sourceTn'] = opts[:'source_tn'] if !opts[:'source_tn'].nil? + query_params[:'destinationTn'] = opts[:'destination_tn'] if !opts[:'destination_tn'].nil? + query_params[:'messageStatus'] = opts[:'message_status'] if !opts[:'message_status'].nil? + query_params[:'messageDirection'] = opts[:'message_direction'] if !opts[:'message_direction'].nil? + query_params[:'carrierName'] = opts[:'carrier_name'] if !opts[:'carrier_name'].nil? + query_params[:'messageType'] = opts[:'message_type'] if !opts[:'message_type'].nil? + query_params[:'errorCode'] = opts[:'error_code'] if !opts[:'error_code'].nil? + query_params[:'fromDateTime'] = opts[:'from_date_time'] if !opts[:'from_date_time'].nil? + query_params[:'toDateTime'] = opts[:'to_date_time'] if !opts[:'to_date_time'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'MessagesList' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"MessagesApi.list_messages", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MessagesApi#list_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/bandwidth-sdk/api/mfa_api.rb b/lib/bandwidth-sdk/api/mfa_api.rb new file mode 100644 index 00000000..7b43bc7a --- /dev/null +++ b/lib/bandwidth-sdk/api/mfa_api.rb @@ -0,0 +1,244 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'cgi' + +module Bandwidth + class MFAApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Messaging Authentication Code + # Send an MFA code via text message (SMS). + # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param code_request [CodeRequest] MFA code request body. + # @param [Hash] opts the optional parameters + # @return [MessagingCodeResponse] + def generate_messaging_code(account_id, code_request, opts = {}) + data, _status_code, _headers = generate_messaging_code_with_http_info(account_id, code_request, opts) + data + end + + # Messaging Authentication Code + # Send an MFA code via text message (SMS). + # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param code_request [CodeRequest] MFA code request body. + # @param [Hash] opts the optional parameters + # @return [Array<(MessagingCodeResponse, Integer, Hash)>] MessagingCodeResponse data, response status code and response headers + def generate_messaging_code_with_http_info(account_id, code_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MFAApi.generate_messaging_code ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling MFAApi.generate_messaging_code" + end + # verify the required parameter 'code_request' is set + if @api_client.config.client_side_validation && code_request.nil? + fail ArgumentError, "Missing the required parameter 'code_request' when calling MFAApi.generate_messaging_code" + end + # resource path + local_var_path = '/accounts/{accountId}/code/messaging'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(code_request) + + # return_type + return_type = opts[:debug_return_type] || 'MessagingCodeResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"MFAApi.generate_messaging_code", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MFAApi#generate_messaging_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Voice Authentication Code + # Send an MFA Code via a phone call. + # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param code_request [CodeRequest] MFA code request body. + # @param [Hash] opts the optional parameters + # @return [VoiceCodeResponse] + def generate_voice_code(account_id, code_request, opts = {}) + data, _status_code, _headers = generate_voice_code_with_http_info(account_id, code_request, opts) + data + end + + # Voice Authentication Code + # Send an MFA Code via a phone call. + # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param code_request [CodeRequest] MFA code request body. + # @param [Hash] opts the optional parameters + # @return [Array<(VoiceCodeResponse, Integer, Hash)>] VoiceCodeResponse data, response status code and response headers + def generate_voice_code_with_http_info(account_id, code_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MFAApi.generate_voice_code ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling MFAApi.generate_voice_code" + end + # verify the required parameter 'code_request' is set + if @api_client.config.client_side_validation && code_request.nil? + fail ArgumentError, "Missing the required parameter 'code_request' when calling MFAApi.generate_voice_code" + end + # resource path + local_var_path = '/accounts/{accountId}/code/voice'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(code_request) + + # return_type + return_type = opts[:debug_return_type] || 'VoiceCodeResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"MFAApi.generate_voice_code", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MFAApi#generate_voice_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Verify Authentication Code + # Verify a previously sent MFA code. + # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param verify_code_request [VerifyCodeRequest] MFA code verify request body. + # @param [Hash] opts the optional parameters + # @return [VerifyCodeResponse] + def verify_code(account_id, verify_code_request, opts = {}) + data, _status_code, _headers = verify_code_with_http_info(account_id, verify_code_request, opts) + data + end + + # Verify Authentication Code + # Verify a previously sent MFA code. + # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param verify_code_request [VerifyCodeRequest] MFA code verify request body. + # @param [Hash] opts the optional parameters + # @return [Array<(VerifyCodeResponse, Integer, Hash)>] VerifyCodeResponse data, response status code and response headers + def verify_code_with_http_info(account_id, verify_code_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MFAApi.verify_code ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling MFAApi.verify_code" + end + # verify the required parameter 'verify_code_request' is set + if @api_client.config.client_side_validation && verify_code_request.nil? + fail ArgumentError, "Missing the required parameter 'verify_code_request' when calling MFAApi.verify_code" + end + # resource path + local_var_path = '/accounts/{accountId}/code/verify'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(verify_code_request) + + # return_type + return_type = opts[:debug_return_type] || 'VerifyCodeResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"MFAApi.verify_code", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MFAApi#verify_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/bandwidth-sdk/api/participants_api.rb b/lib/bandwidth-sdk/api/participants_api.rb new file mode 100644 index 00000000..797efd87 --- /dev/null +++ b/lib/bandwidth-sdk/api/participants_api.rb @@ -0,0 +1,230 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'cgi' + +module Bandwidth + class ParticipantsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create Participant + # Create a new participant under this account. Participants are idempotent, so relevant parameters must be set in this function if desired. + # @param account_id [String] Account ID + # @param [Hash] opts the optional parameters + # @option opts [CreateParticipantRequest] :create_participant_request Create participant request body. + # @return [CreateParticipantResponse] + def create_participant(account_id, opts = {}) + data, _status_code, _headers = create_participant_with_http_info(account_id, opts) + data + end + + # Create Participant + # Create a new participant under this account. Participants are idempotent, so relevant parameters must be set in this function if desired. + # @param account_id [String] Account ID + # @param [Hash] opts the optional parameters + # @option opts [CreateParticipantRequest] :create_participant_request Create participant request body. + # @return [Array<(CreateParticipantResponse, Integer, Hash)>] CreateParticipantResponse data, response status code and response headers + def create_participant_with_http_info(account_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ParticipantsApi.create_participant ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ParticipantsApi.create_participant" + end + # resource path + local_var_path = '/accounts/{accountId}/participants'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_participant_request']) + + # return_type + return_type = opts[:debug_return_type] || 'CreateParticipantResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ParticipantsApi.create_participant", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ParticipantsApi#create_participant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete Participant + # Delete participant by ID. + # @param account_id [String] Account ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_participant(account_id, participant_id, opts = {}) + delete_participant_with_http_info(account_id, participant_id, opts) + nil + end + + # Delete Participant + # Delete participant by ID. + # @param account_id [String] Account ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_participant_with_http_info(account_id, participant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ParticipantsApi.delete_participant ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ParticipantsApi.delete_participant" + end + # verify the required parameter 'participant_id' is set + if @api_client.config.client_side_validation && participant_id.nil? + fail ArgumentError, "Missing the required parameter 'participant_id' when calling ParticipantsApi.delete_participant" + end + # resource path + local_var_path = '/accounts/{accountId}/participants/{participantId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ParticipantsApi.delete_participant", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ParticipantsApi#delete_participant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Participant + # Get participant by ID. + # @param account_id [String] Account ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @return [Participant] + def get_participant(account_id, participant_id, opts = {}) + data, _status_code, _headers = get_participant_with_http_info(account_id, participant_id, opts) + data + end + + # Get Participant + # Get participant by ID. + # @param account_id [String] Account ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @return [Array<(Participant, Integer, Hash)>] Participant data, response status code and response headers + def get_participant_with_http_info(account_id, participant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ParticipantsApi.get_participant ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling ParticipantsApi.get_participant" + end + # verify the required parameter 'participant_id' is set + if @api_client.config.client_side_validation && participant_id.nil? + fail ArgumentError, "Missing the required parameter 'participant_id' when calling ParticipantsApi.get_participant" + end + # resource path + local_var_path = '/accounts/{accountId}/participants/{participantId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Participant' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"ParticipantsApi.get_participant", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ParticipantsApi#get_participant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb new file mode 100644 index 00000000..65268107 --- /dev/null +++ b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb @@ -0,0 +1,165 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'cgi' + +module Bandwidth + class PhoneNumberLookupApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create Lookup + # Create a Phone Number Lookup Request. + # @param account_id [String] The ID of the Bandwidth account that the user belongs to. + # @param lookup_request [LookupRequest] Phone number lookup request. + # @param [Hash] opts the optional parameters + # @return [CreateLookupResponse] + def create_lookup(account_id, lookup_request, opts = {}) + data, _status_code, _headers = create_lookup_with_http_info(account_id, lookup_request, opts) + data + end + + # Create Lookup + # Create a Phone Number Lookup Request. + # @param account_id [String] The ID of the Bandwidth account that the user belongs to. + # @param lookup_request [LookupRequest] Phone number lookup request. + # @param [Hash] opts the optional parameters + # @return [Array<(CreateLookupResponse, Integer, Hash)>] CreateLookupResponse data, response status code and response headers + def create_lookup_with_http_info(account_id, lookup_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PhoneNumberLookupApi.create_lookup ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling PhoneNumberLookupApi.create_lookup" + end + # verify the required parameter 'lookup_request' is set + if @api_client.config.client_side_validation && lookup_request.nil? + fail ArgumentError, "Missing the required parameter 'lookup_request' when calling PhoneNumberLookupApi.create_lookup" + end + # resource path + local_var_path = '/accounts/{accountId}/tnlookup'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(lookup_request) + + # return_type + return_type = opts[:debug_return_type] || 'CreateLookupResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"PhoneNumberLookupApi.create_lookup", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PhoneNumberLookupApi#create_lookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Lookup Request Status + # Get an existing Phone Number Lookup Request. + # @param account_id [String] The ID of the Bandwidth account that the user belongs to. + # @param request_id [String] The phone number lookup request ID from Bandwidth. + # @param [Hash] opts the optional parameters + # @return [LookupStatus] + def get_lookup_status(account_id, request_id, opts = {}) + data, _status_code, _headers = get_lookup_status_with_http_info(account_id, request_id, opts) + data + end + + # Get Lookup Request Status + # Get an existing Phone Number Lookup Request. + # @param account_id [String] The ID of the Bandwidth account that the user belongs to. + # @param request_id [String] The phone number lookup request ID from Bandwidth. + # @param [Hash] opts the optional parameters + # @return [Array<(LookupStatus, Integer, Hash)>] LookupStatus data, response status code and response headers + def get_lookup_status_with_http_info(account_id, request_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PhoneNumberLookupApi.get_lookup_status ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling PhoneNumberLookupApi.get_lookup_status" + end + # verify the required parameter 'request_id' is set + if @api_client.config.client_side_validation && request_id.nil? + fail ArgumentError, "Missing the required parameter 'request_id' when calling PhoneNumberLookupApi.get_lookup_status" + end + # resource path + local_var_path = '/accounts/{accountId}/tnlookup/{requestId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'requestId' + '}', CGI.escape(request_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LookupStatus' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"PhoneNumberLookupApi.get_lookup_status", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PhoneNumberLookupApi#get_lookup_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/bandwidth-sdk/api/recordings_api.rb b/lib/bandwidth-sdk/api/recordings_api.rb new file mode 100644 index 00000000..8297f3fa --- /dev/null +++ b/lib/bandwidth-sdk/api/recordings_api.rb @@ -0,0 +1,782 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'cgi' + +module Bandwidth + class RecordingsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Delete Transcription + # 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 [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_call_transcription(account_id, call_id, recording_id, opts = {}) + delete_call_transcription_with_http_info(account_id, call_id, recording_id, opts) + nil + end + + # Delete Transcription + # 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 [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_call_transcription_with_http_info(account_id, call_id, recording_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RecordingsApi.delete_call_transcription ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.delete_call_transcription" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.delete_call_transcription" + end + # verify the required parameter 'recording_id' is set + if @api_client.config.client_side_validation && recording_id.nil? + fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.delete_call_transcription" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"RecordingsApi.delete_call_transcription", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RecordingsApi#delete_call_transcription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete Recording + # 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 [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_recording(account_id, call_id, recording_id, opts = {}) + delete_recording_with_http_info(account_id, call_id, recording_id, opts) + nil + end + + # Delete Recording + # 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 [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_recording_with_http_info(account_id, call_id, recording_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RecordingsApi.delete_recording ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.delete_recording" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.delete_recording" + end + # verify the required parameter 'recording_id' is set + if @api_client.config.client_side_validation && recording_id.nil? + fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.delete_recording" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"RecordingsApi.delete_recording", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RecordingsApi#delete_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete Recording Media + # Deletes the specified recording's media. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_recording_media(account_id, call_id, recording_id, opts = {}) + delete_recording_media_with_http_info(account_id, call_id, recording_id, opts) + nil + end + + # Delete Recording Media + # Deletes the specified recording's media. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_recording_media_with_http_info(account_id, call_id, recording_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RecordingsApi.delete_recording_media ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.delete_recording_media" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.delete_recording_media" + end + # verify the required parameter 'recording_id' is set + if @api_client.config.client_side_validation && recording_id.nil? + fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.delete_recording_media" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"RecordingsApi.delete_recording_media", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RecordingsApi#delete_recording_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Download Recording + # Downloads the specified recording. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [File] + def download_call_recording(account_id, call_id, recording_id, opts = {}) + data, _status_code, _headers = download_call_recording_with_http_info(account_id, call_id, recording_id, opts) + data + end + + # Download Recording + # Downloads the specified recording. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def download_call_recording_with_http_info(account_id, call_id, recording_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RecordingsApi.download_call_recording ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.download_call_recording" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.download_call_recording" + end + # verify the required parameter 'recording_id' is set + if @api_client.config.client_side_validation && recording_id.nil? + fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.download_call_recording" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['audio/vnd.wave', 'audio/mpeg', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'File' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"RecordingsApi.download_call_recording", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RecordingsApi#download_call_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Call Recording + # Returns metadata for the specified recording. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [CallRecordingMetadata] + def get_call_recording(account_id, call_id, recording_id, opts = {}) + data, _status_code, _headers = get_call_recording_with_http_info(account_id, call_id, recording_id, opts) + data + end + + # Get Call Recording + # Returns metadata for the specified recording. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [Array<(CallRecordingMetadata, Integer, Hash)>] CallRecordingMetadata data, response status code and response headers + def get_call_recording_with_http_info(account_id, call_id, recording_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RecordingsApi.get_call_recording ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.get_call_recording" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.get_call_recording" + end + # verify the required parameter 'recording_id' is set + if @api_client.config.client_side_validation && recording_id.nil? + fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.get_call_recording" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CallRecordingMetadata' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"RecordingsApi.get_call_recording", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RecordingsApi#get_call_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # 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. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [TranscriptionList] + def get_call_transcription(account_id, call_id, recording_id, opts = {}) + data, _status_code, _headers = get_call_transcription_with_http_info(account_id, call_id, recording_id, opts) + data + end + + # 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 [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/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 [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [Array<(TranscriptionList, Integer, Hash)>] TranscriptionList data, response status code and response headers + def get_call_transcription_with_http_info(account_id, call_id, recording_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RecordingsApi.get_call_transcription ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.get_call_transcription" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.get_call_transcription" + end + # verify the required parameter 'recording_id' is set + if @api_client.config.client_side_validation && recording_id.nil? + fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.get_call_transcription" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TranscriptionList' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"RecordingsApi.get_call_transcription", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RecordingsApi#get_call_transcription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Call Recordings + # Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria. + # @param account_id [String] Your Bandwidth Account ID + # @param [Hash] opts the optional parameters + # @option opts [String] :to Filter results by the `to` field. + # @option opts [String] :from Filter results by the `from` field. + # @option opts [String] :min_start_time Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). + # @option opts [String] :max_start_time Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). + # @return [Array] + def list_account_call_recordings(account_id, opts = {}) + data, _status_code, _headers = list_account_call_recordings_with_http_info(account_id, opts) + data + end + + # Get Call Recordings + # Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria. + # @param account_id [String] Your Bandwidth Account ID + # @param [Hash] opts the optional parameters + # @option opts [String] :to Filter results by the `to` field. + # @option opts [String] :from Filter results by the `from` field. + # @option opts [String] :min_start_time Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). + # @option opts [String] :max_start_time Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_account_call_recordings_with_http_info(account_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RecordingsApi.list_account_call_recordings ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.list_account_call_recordings" + end + # resource path + local_var_path = '/accounts/{accountId}/recordings'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? + query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? + query_params[:'minStartTime'] = opts[:'min_start_time'] if !opts[:'min_start_time'].nil? + query_params[:'maxStartTime'] = opts[:'max_start_time'] if !opts[:'max_start_time'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"RecordingsApi.list_account_call_recordings", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RecordingsApi#list_account_call_recordings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Call Recordings + # Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param [Hash] opts the optional parameters + # @return [Array] + def list_call_recordings(account_id, call_id, opts = {}) + data, _status_code, _headers = list_call_recordings_with_http_info(account_id, call_id, opts) + data + end + + # List Call Recordings + # Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_call_recordings_with_http_info(account_id, call_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RecordingsApi.list_call_recordings ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.list_call_recordings" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.list_call_recordings" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}/recordings'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"RecordingsApi.list_call_recordings", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RecordingsApi#list_call_recordings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create Transcription Request + # Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param transcribe_recording [TranscribeRecording] + # @param [Hash] opts the optional parameters + # @return [nil] + def transcribe_call_recording(account_id, call_id, recording_id, transcribe_recording, opts = {}) + transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording, opts) + nil + end + + # Create Transcription Request + # Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param recording_id [String] Programmable Voice API Recording ID + # @param transcribe_recording [TranscribeRecording] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RecordingsApi.transcribe_call_recording ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.transcribe_call_recording" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.transcribe_call_recording" + end + # verify the required parameter 'recording_id' is set + if @api_client.config.client_side_validation && recording_id.nil? + fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.transcribe_call_recording" + end + # verify the required parameter 'transcribe_recording' is set + if @api_client.config.client_side_validation && transcribe_recording.nil? + fail ArgumentError, "Missing the required parameter 'transcribe_recording' when calling RecordingsApi.transcribe_call_recording" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(transcribe_recording) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"RecordingsApi.transcribe_call_recording", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RecordingsApi#transcribe_call_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Recording + # Pause or resume a recording on an active phone call. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param update_call_recording [UpdateCallRecording] + # @param [Hash] opts the optional parameters + # @return [nil] + def update_call_recording_state(account_id, call_id, update_call_recording, opts = {}) + update_call_recording_state_with_http_info(account_id, call_id, update_call_recording, opts) + nil + end + + # Update Recording + # Pause or resume a recording on an active phone call. + # @param account_id [String] Your Bandwidth Account ID + # @param call_id [String] Programmable Voice API Call ID + # @param update_call_recording [UpdateCallRecording] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_call_recording_state_with_http_info(account_id, call_id, update_call_recording, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RecordingsApi.update_call_recording_state ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.update_call_recording_state" + end + # verify the required parameter 'call_id' is set + if @api_client.config.client_side_validation && call_id.nil? + fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.update_call_recording_state" + end + # verify the required parameter 'update_call_recording' is set + if @api_client.config.client_side_validation && update_call_recording.nil? + fail ArgumentError, "Missing the required parameter 'update_call_recording' when calling RecordingsApi.update_call_recording_state" + end + # resource path + local_var_path = '/accounts/{accountId}/calls/{callId}/recording'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_call_recording) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"RecordingsApi.update_call_recording_state", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RecordingsApi#update_call_recording_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/bandwidth-sdk/api/sessions_api.rb b/lib/bandwidth-sdk/api/sessions_api.rb new file mode 100644 index 00000000..6cb29610 --- /dev/null +++ b/lib/bandwidth-sdk/api/sessions_api.rb @@ -0,0 +1,613 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'cgi' + +module Bandwidth + class SessionsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Add Participant to Session + # Add a participant to a session. Subscriptions can optionally be provided as part of this call. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @option opts [Subscriptions] :subscriptions The Body describes an optional set of subscriptions to apply to the participant. Calling this endpoint with no/empty body will only add the participant to the session, and will not subscribe the Participant to any media. The request body for this endpoint is OPTIONAL and provided as a convenience to avoid additional calls to the Update Participant Subscriptions endpoint. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created + # @return [nil] + def add_participant_to_session(account_id, session_id, participant_id, opts = {}) + add_participant_to_session_with_http_info(account_id, session_id, participant_id, opts) + nil + end + + # Add Participant to Session + # Add a participant to a session. Subscriptions can optionally be provided as part of this call. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @option opts [Subscriptions] :subscriptions The Body describes an optional set of subscriptions to apply to the participant. Calling this endpoint with no/empty body will only add the participant to the session, and will not subscribe the Participant to any media. The request body for this endpoint is OPTIONAL and provided as a convenience to avoid additional calls to the Update Participant Subscriptions endpoint. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def add_participant_to_session_with_http_info(account_id, session_id, participant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SessionsApi.add_participant_to_session ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.add_participant_to_session" + end + # verify the required parameter 'session_id' is set + if @api_client.config.client_side_validation && session_id.nil? + fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.add_participant_to_session" + end + # verify the required parameter 'participant_id' is set + if @api_client.config.client_side_validation && participant_id.nil? + fail ArgumentError, "Missing the required parameter 'participant_id' when calling SessionsApi.add_participant_to_session" + end + # resource path + local_var_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'subscriptions']) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"SessionsApi.add_participant_to_session", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SessionsApi#add_participant_to_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create Session + # Create a new session. Sessions are idempotent, so relevant parameters must be set in this function if desired. + # @param account_id [String] Account ID + # @param [Hash] opts the optional parameters + # @option opts [Session] :session Create session request body. + # @return [Session] + def create_session(account_id, opts = {}) + data, _status_code, _headers = create_session_with_http_info(account_id, opts) + data + end + + # Create Session + # Create a new session. Sessions are idempotent, so relevant parameters must be set in this function if desired. + # @param account_id [String] Account ID + # @param [Hash] opts the optional parameters + # @option opts [Session] :session Create session request body. + # @return [Array<(Session, Integer, Hash)>] Session data, response status code and response headers + def create_session_with_http_info(account_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SessionsApi.create_session ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.create_session" + end + # resource path + local_var_path = '/accounts/{accountId}/sessions'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'session']) + + # return_type + return_type = opts[:debug_return_type] || 'Session' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"SessionsApi.create_session", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SessionsApi#create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete Session + # Delete session by ID. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_session(account_id, session_id, opts = {}) + delete_session_with_http_info(account_id, session_id, opts) + nil + end + + # Delete Session + # Delete session by ID. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_session_with_http_info(account_id, session_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SessionsApi.delete_session ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.delete_session" + end + # verify the required parameter 'session_id' is set + if @api_client.config.client_side_validation && session_id.nil? + fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.delete_session" + end + # resource path + local_var_path = '/accounts/{accountId}/sessions/{sessionId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"SessionsApi.delete_session", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SessionsApi#delete_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Participant Subscriptions + # Get a participant's subscriptions. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @return [Subscriptions] + def get_participant_subscriptions(account_id, session_id, participant_id, opts = {}) + data, _status_code, _headers = get_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts) + data + end + + # Get Participant Subscriptions + # Get a participant's subscriptions. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @return [Array<(Subscriptions, Integer, Hash)>] Subscriptions data, response status code and response headers + def get_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SessionsApi.get_participant_subscriptions ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.get_participant_subscriptions" + end + # verify the required parameter 'session_id' is set + if @api_client.config.client_side_validation && session_id.nil? + fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.get_participant_subscriptions" + end + # verify the required parameter 'participant_id' is set + if @api_client.config.client_side_validation && participant_id.nil? + fail ArgumentError, "Missing the required parameter 'participant_id' when calling SessionsApi.get_participant_subscriptions" + end + # resource path + local_var_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Subscriptions' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"SessionsApi.get_participant_subscriptions", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SessionsApi#get_participant_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Session + # Get session by ID. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param [Hash] opts the optional parameters + # @return [Session] + def get_session(account_id, session_id, opts = {}) + data, _status_code, _headers = get_session_with_http_info(account_id, session_id, opts) + data + end + + # Get Session + # Get session by ID. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param [Hash] opts the optional parameters + # @return [Array<(Session, Integer, Hash)>] Session data, response status code and response headers + def get_session_with_http_info(account_id, session_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SessionsApi.get_session ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.get_session" + end + # verify the required parameter 'session_id' is set + if @api_client.config.client_side_validation && session_id.nil? + fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.get_session" + end + # resource path + local_var_path = '/accounts/{accountId}/sessions/{sessionId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Session' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"SessionsApi.get_session", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SessionsApi#get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Participants in Session + # List participants in a session. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param [Hash] opts the optional parameters + # @return [Array] + def list_session_participants(account_id, session_id, opts = {}) + data, _status_code, _headers = list_session_participants_with_http_info(account_id, session_id, opts) + data + end + + # List Participants in Session + # List participants in a session. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_session_participants_with_http_info(account_id, session_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SessionsApi.list_session_participants ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.list_session_participants" + end + # verify the required parameter 'session_id' is set + if @api_client.config.client_side_validation && session_id.nil? + fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.list_session_participants" + end + # resource path + local_var_path = '/accounts/{accountId}/sessions/{sessionId}/participants'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"SessionsApi.list_session_participants", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SessionsApi#list_session_participants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Remove Participant from Session + # Remove a participant from a session. This will automatically remove any subscriptions the participant has associated with this session. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @return [nil] + def remove_participant_from_session(account_id, session_id, participant_id, opts = {}) + remove_participant_from_session_with_http_info(account_id, session_id, participant_id, opts) + nil + end + + # Remove Participant from Session + # Remove a participant from a session. This will automatically remove any subscriptions the participant has associated with this session. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_participant_from_session_with_http_info(account_id, session_id, participant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SessionsApi.remove_participant_from_session ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.remove_participant_from_session" + end + # verify the required parameter 'session_id' is set + if @api_client.config.client_side_validation && session_id.nil? + fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.remove_participant_from_session" + end + # verify the required parameter 'participant_id' is set + if @api_client.config.client_side_validation && participant_id.nil? + fail ArgumentError, "Missing the required parameter 'participant_id' when calling SessionsApi.remove_participant_from_session" + end + # resource path + local_var_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"SessionsApi.remove_participant_from_session", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SessionsApi#remove_participant_from_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Participant Subscriptions + # Update a participant's subscriptions. This is a full update that will replace the participant's subscriptions. It allows subscription to the entire Session, a subset list of Participants in that Session, or specific media streams on any of the listed Participants. First call `getParticipantSubscriptions` if you need the current subscriptions. Calling this API with no `Subscriptions` object to remove all subscriptions. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @option opts [Subscriptions] :subscriptions The body describes the desired subscriptions for the Participant. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created + # @return [nil] + def update_participant_subscriptions(account_id, session_id, participant_id, opts = {}) + update_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts) + nil + end + + # Update Participant Subscriptions + # Update a participant's subscriptions. This is a full update that will replace the participant's subscriptions. It allows subscription to the entire Session, a subset list of Participants in that Session, or specific media streams on any of the listed Participants. First call `getParticipantSubscriptions` if you need the current subscriptions. Calling this API with no `Subscriptions` object to remove all subscriptions. + # @param account_id [String] Account ID + # @param session_id [String] Session ID + # @param participant_id [String] Participant ID + # @param [Hash] opts the optional parameters + # @option opts [Subscriptions] :subscriptions The body describes the desired subscriptions for the Participant. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SessionsApi.update_participant_subscriptions ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.update_participant_subscriptions" + end + # verify the required parameter 'session_id' is set + if @api_client.config.client_side_validation && session_id.nil? + fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.update_participant_subscriptions" + end + # verify the required parameter 'participant_id' is set + if @api_client.config.client_side_validation && participant_id.nil? + fail ArgumentError, "Missing the required parameter 'participant_id' when calling SessionsApi.update_participant_subscriptions" + end + # resource path + local_var_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'subscriptions']) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"SessionsApi.update_participant_subscriptions", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SessionsApi#update_participant_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/bandwidth-sdk/api/statistics_api.rb b/lib/bandwidth-sdk/api/statistics_api.rb new file mode 100644 index 00000000..8d2ef637 --- /dev/null +++ b/lib/bandwidth-sdk/api/statistics_api.rb @@ -0,0 +1,85 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'cgi' + +module Bandwidth + class StatisticsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Get Account Statistics + # Returns details about the current state of the account. + # @param account_id [String] Your Bandwidth Account ID + # @param [Hash] opts the optional parameters + # @return [AccountStatistics] + def get_statistics(account_id, opts = {}) + data, _status_code, _headers = get_statistics_with_http_info(account_id, opts) + data + end + + # Get Account Statistics + # Returns details about the current state of the account. + # @param account_id [String] Your Bandwidth Account ID + # @param [Hash] opts the optional parameters + # @return [Array<(AccountStatistics, Integer, Hash)>] AccountStatistics data, response status code and response headers + def get_statistics_with_http_info(account_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatisticsApi.get_statistics ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling StatisticsApi.get_statistics" + end + # resource path + local_var_path = '/accounts/{accountId}/statistics'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AccountStatistics' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic'] + + new_options = opts.merge( + :operation => :"StatisticsApi.get_statistics", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StatisticsApi#get_statistics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/bandwidth-sdk/api_client.rb b/lib/bandwidth-sdk/api_client.rb new file mode 100644 index 00000000..5ff076b9 --- /dev/null +++ b/lib/bandwidth-sdk/api_client.rb @@ -0,0 +1,425 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'json' +require 'logger' +require 'tempfile' +require 'time' +require 'faraday' +require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0') + +module Bandwidth + class ApiClient + # The Configuration object holding settings to be used in the API client. + attr_accessor :config + + # Defines the headers to be used in HTTP requests of all API calls by default. + # + # @return [Hash] + attr_accessor :default_headers + + # Initializes the ApiClient + # @option config [Configuration] Configuration for initializing the object, default to Configuration.default + def initialize(config = Configuration.default) + @config = config + @user_agent = "OpenAPI-Generator/#{VERSION}/ruby" + @default_headers = { + 'Content-Type' => 'application/json', + 'User-Agent' => @user_agent + } + end + + def self.default + @@default ||= ApiClient.new + end + + # Call an API with given options. + # + # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: + # the data deserialized from response body (could be nil), response status code and response headers. + def call_api(http_method, path, opts = {}) + begin + response = connection(opts).public_send(http_method.to_sym.downcase) do |req| + build_request(http_method, path, req, opts) + end + + if config.debugging + config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end + + unless response.success? + if response.status == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(code: 0, + message: response.return_message) + else + fail ApiError.new(code: response.status, + response_headers: response.headers, + response_body: response.body), + response.reason_phrase + end + end + rescue Faraday::TimeoutError + fail ApiError.new('Connection timed out') + end + + if opts[:return_type] + data = deserialize(response, opts[:return_type]) + else + data = nil + end + return data, response.status, response.headers + end + + # Builds the HTTP request + # + # @param [String] http_method HTTP method/verb (e.g. POST) + # @param [String] path URL path (e.g. /account/new) + # @option opts [Hash] :header_params Header parameters + # @option opts [Hash] :query_params Query parameters + # @option opts [Hash] :form_params Query parameters + # @option opts [Object] :body HTTP body (JSON/XML) + # @return [Faraday::Request] A Faraday Request + def build_request(http_method, path, request, opts = {}) + url = build_request_url(path, opts) + http_method = http_method.to_sym.downcase + + header_params = @default_headers.merge(opts[:header_params] || {}) + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + + update_params_for_auth! header_params, query_params, opts[:auth_names] + + if [:post, :patch, :put, :delete].include?(http_method) + req_body = build_request_body(header_params, form_params, opts[:body]) + if config.debugging + config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" + end + end + request.headers = header_params + request.body = req_body + + # Overload default options only if provided + request.options.params_encoder = config.params_encoder if config.params_encoder + request.options.timeout = config.timeout if config.timeout + + request.url url + request.params = query_params + download_file(request) if opts[:return_type] == 'File' || opts[:return_type] == 'Binary' + request + end + + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' + data = URI.encode_www_form(form_params) + elsif header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Tempfile + # TODO hardcode to application/octet-stream, need better way to detect content type + data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path) + when ::Array, nil + # let Faraday handle Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + + def download_file(request) + @stream = [] + + # handle streaming Responses + request.options.on_data = Proc.new do |chunk, overall_received_bytes| + @stream << chunk + end + end + + def connection(opts) + opts[:header_params]['Content-Type'] == 'multipart/form-data' ? connection_multipart : connection_regular + end + + def connection_multipart + @connection_multipart ||= build_connection do |conn| + conn.request :multipart + conn.request :url_encoded + end + end + + def connection_regular + @connection_regular ||= build_connection + end + + def build_connection + Faraday.new(url: config.base_url, ssl: ssl_options) do |conn| + basic_auth(conn) + config.configure_middleware(conn) + yield(conn) if block_given? + conn.adapter(Faraday.default_adapter) + end + end + + def ssl_options + { + ca_file: config.ssl_ca_file, + verify: config.ssl_verify, + verify_mode: config.ssl_verify_mode, + client_cert: config.ssl_client_cert, + client_key: config.ssl_client_key + } + end + + def basic_auth(conn) + if config.username && config.password + if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0') + conn.request(:authorization, :basic, config.username, config.password) + else + conn.request(:basic_auth, config.username, config.password) + end + end + end + + # Check if the given MIME is a JSON MIME. + # JSON MIME examples: + # application/json + # application/json; charset=UTF8 + # APPLICATION/JSON + # */* + # @param [String] mime MIME + # @return [Boolean] True if the MIME is application/json + def json_mime?(mime) + (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + end + + # Deserialize the response to the given return type. + # + # @param [Response] response HTTP response + # @param [String] return_type some examples: "User", "Array", "Hash" + def deserialize(response, return_type) + body = response.body + + # handle file downloading - return the File instance processed in request callbacks + # note that response body is empty when the file is written in chunks in request on_body callback + if return_type == 'File' + if @config.return_binary_data == true + # return byte stream + encoding = body.encoding + return @stream.join.force_encoding(encoding) + else + # return file instead of binary data + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = body.encoding + @tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + @tempfile.write(@stream.join.force_encoding(encoding)) + @tempfile.close + @config.logger.info "Temp file written to #{@tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + return @tempfile + end + end + + return nil if body.nil? || body.empty? + + # return response body directly for String return type + return body if return_type == 'String' + + # ensuring a default content type + content_type = response.headers['Content-Type'] || 'application/json' + + fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) + + begin + data = JSON.parse("[#{body}]", :symbolize_names => true)[0] + rescue JSON::ParserError => e + if %w(String Date Time).include?(return_type) + data = body + else + raise e + end + end + + convert_to_type data, return_type + end + + # Convert data to the given return type. + # @param [Object] data Data to be converted + # @param [String] return_type Return type + # @return [Mixed] Data in a particular type + def convert_to_type(data, return_type) + return nil if data.nil? + case return_type + when 'String' + data.to_s + when 'Integer' + data.to_i + when 'Float' + data.to_f + when 'Boolean' + data == true + when 'Time' + # parse date time (expecting ISO 8601 format) + Time.parse data + when 'Date' + # parse date time (expecting ISO 8601 format) + Date.parse data + when 'Object' + # generic object (usually a Hash), return directly + data + when /\AArray<(.+)>\z/ + # e.g. Array + sub_type = $1 + data.map { |item| convert_to_type(item, sub_type) } + when /\AHash\\z/ + # e.g. Hash + sub_type = $1 + {}.tap do |hash| + data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } + end + else + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(return_type) + klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data) + end + end + + # Sanitize filename by removing path. + # e.g. ../../sun.gif becomes sun.gif + # + # @param [String] filename the filename to be sanitized + # @return [String] the sanitized filename + def sanitize_filename(filename) + filename.gsub(/.*[\/\\]/, '') + end + + def build_request_url(path, opts = {}) + # Add leading and trailing slashes to path + path = "/#{path}".gsub(/\/+/, '/') + @config.base_url(opts[:operation]) + path + end + + # Update header and query params based on authentication settings. + # + # @param [Hash] header_params Header parameters + # @param [Hash] query_params Query parameters + # @param [String] auth_names Authentication scheme name + def update_params_for_auth!(header_params, query_params, auth_names) + Array(auth_names).each do |auth_name| + auth_setting = @config.auth_settings[auth_name] + next unless auth_setting + case auth_setting[:in] + when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] + when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] + else fail ArgumentError, 'Authentication token must be in `query` or `header`' + end + end + end + + # Sets user agent in HTTP header + # + # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) + def user_agent=(user_agent) + @user_agent = user_agent + @default_headers['User-Agent'] = @user_agent + end + + # Return Accept header based on an array of accepts provided. + # @param [Array] accepts array for Accept + # @return [String] the Accept header (e.g. application/json) + def select_header_accept(accepts) + return nil if accepts.nil? || accepts.empty? + # use JSON when present, otherwise use all of the provided + json_accept = accepts.find { |s| json_mime?(s) } + json_accept || accepts.join(',') + end + + # Return Content-Type header based on an array of content types provided. + # @param [Array] content_types array for Content-Type + # @return [String] the Content-Type header (e.g. application/json) + def select_header_content_type(content_types) + # return nil by default + return if content_types.nil? || content_types.empty? + # use JSON when present, otherwise use the first one + json_content_type = content_types.find { |s| json_mime?(s) } + json_content_type || content_types.first + end + + # Convert object (array, hash, object, etc) to JSON string. + # @param [Object] model object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_http_body(model) + return model if model.nil? || model.is_a?(String) + local_body = nil + if model.is_a?(Array) + local_body = model.map { |m| object_to_hash(m) } + else + local_body = object_to_hash(model) + end + local_body.to_json + end + + # Convert object(non-array) to hash. + # @param [Object] obj object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_hash(obj) + if obj.respond_to?(:to_hash) + obj.to_hash + else + obj + end + end + + # Build parameter value according to the given collection format. + # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi + def build_collection_param(param, collection_format) + case collection_format + when :csv + param.join(',') + when :ssv + param.join(' ') + when :tsv + param.join("\t") + when :pipes + param.join('|') + when :multi + # return the array directly as typhoeus will handle it as expected + param + else + fail "unknown collection format: #{collection_format.inspect}" + end + end + end +end diff --git a/lib/bandwidth-sdk/api_error.rb b/lib/bandwidth-sdk/api_error.rb new file mode 100644 index 00000000..8ea438ab --- /dev/null +++ b/lib/bandwidth-sdk/api_error.rb @@ -0,0 +1,57 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +module Bandwidth + class ApiError < StandardError + attr_reader :code, :response_headers, :response_body + + # Usage examples: + # ApiError.new + # ApiError.new("message") + # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") + # ApiError.new(:code => 404, :message => "Not Found") + def initialize(arg = nil) + if arg.is_a? Hash + if arg.key?(:message) || arg.key?('message') + super(arg[:message] || arg['message']) + else + super arg + end + + arg.each do |k, v| + instance_variable_set "@#{k}", v + end + else + super arg + end + end + + # Override to_s to display a friendly error message + def to_s + message + end + + def message + if @message.nil? + msg = "Error message: the server returns an error" + else + msg = @message + end + + msg += "\nHTTP status code: #{code}" if code + msg += "\nResponse headers: #{response_headers}" if response_headers + msg += "\nResponse body: #{response_body}" if response_body + + msg + end + end +end diff --git a/lib/bandwidth-sdk/configuration.rb b/lib/bandwidth-sdk/configuration.rb new file mode 100644 index 00000000..08bbb5d4 --- /dev/null +++ b/lib/bandwidth-sdk/configuration.rb @@ -0,0 +1,612 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +module Bandwidth + class Configuration + # Defines url scheme + attr_accessor :scheme + + # Defines url host + attr_accessor :host + + # Defines url base path + attr_accessor :base_path + + # Define server configuration index + attr_accessor :server_index + + # Define server operation configuration index + attr_accessor :server_operation_index + + # Default server variables + attr_accessor :server_variables + + # Default server operation variables + attr_accessor :server_operation_variables + + # Defines API keys used with API Key authentications. + # + # @return [Hash] key: parameter name, value: parameter value (API key) + # + # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) + # config.api_key['api_key'] = 'xxx' + attr_accessor :api_key + + # Defines API key prefixes used with API Key authentications. + # + # @return [Hash] key: parameter name, value: API key prefix + # + # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) + # config.api_key_prefix['api_key'] = 'Token' + attr_accessor :api_key_prefix + + # Defines the username used with HTTP basic authentication. + # + # @return [String] + attr_accessor :username + + # Defines the password used with HTTP basic authentication. + # + # @return [String] + attr_accessor :password + + # Defines the access token (Bearer) used with OAuth2. + attr_accessor :access_token + + # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response + # details will be logged with `logger.debug` (see the `logger` attribute). + # Default to false. + # + # @return [true, false] + attr_accessor :debugging + + # Defines the logger used for debugging. + # Default to `Rails.logger` (when in Rails) or logging to STDOUT. + # + # @return [#debug] + attr_accessor :logger + + # Defines the temporary folder to store downloaded files + # (for API endpoints that have file response). + # Default to use `Tempfile`. + # + # @return [String] + attr_accessor :temp_folder_path + + # The time limit for HTTP request in seconds. + # Default to 0 (never times out). + attr_accessor :timeout + + # Set this to false to skip client side validation in the operation. + # Default to true. + # @return [true, false] + attr_accessor :client_side_validation + + ### TLS/SSL setting + # Set this to false to skip verifying SSL certificate when calling API from https server. + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :ssl_verify + + ### TLS/SSL setting + # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + attr_accessor :ssl_verify_mode + + ### TLS/SSL setting + # Set this to customize the certificate file to verify the peer. + # + # @return [String] the path to the certificate file + attr_accessor :ssl_ca_file + + ### TLS/SSL setting + # Client certificate file (for client certificate) + attr_accessor :ssl_client_cert + + ### TLS/SSL setting + # Client private key file (for client certificate) + attr_accessor :ssl_client_key + + ### Proxy setting + # HTTP Proxy settings + attr_accessor :proxy + + # Set this to customize parameters encoder of array parameter. + # Default to nil. Faraday uses NestedParamsEncoder when nil. + # + # @see The params_encoder option of Faraday. Related source code: + # https://github.com/lostisland/faraday/tree/main/lib/faraday/encoders + attr_accessor :params_encoder + + + attr_accessor :inject_format + + attr_accessor :force_ending_format + + def initialize + @scheme = 'http' + @host = 'localhost' + @base_path = '' + @server_index = 0 + @server_operation_index = {} + @server_variables = {} + @server_operation_variables = {} + @api_key = {} + @api_key_prefix = {} + @client_side_validation = true + @ssl_verify = true + @ssl_verify_mode = nil + @ssl_ca_file = nil + @ssl_client_cert = nil + @ssl_client_key = nil + @middlewares = Hash.new { |h, k| h[k] = [] } + @timeout = 60 + # return data as binary instead of file + @return_binary_data = false + @params_encoder = nil + @debugging = false + @inject_format = false + @force_ending_format = false + @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) + + yield(self) if block_given? + end + + # The default Configuration object. + def self.default + @@default ||= Configuration.new + end + + def configure + yield(self) if block_given? + end + + def scheme=(scheme) + # remove :// from scheme + @scheme = scheme.sub(/:\/\//, '') + end + + def host=(host) + # remove http(s):// and anything after a slash + @host = host.sub(/https?:\/\//, '').split('/').first + end + + def base_path=(base_path) + # Add leading and trailing slashes to base_path + @base_path = "/#{base_path}".gsub(/\/+/, '/') + @base_path = '' if @base_path == '/' + end + + # Returns base URL for specified operation based on server settings + def base_url(operation = nil) + index = server_operation_index.fetch(operation, server_index) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil + + server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) + end + + # Gets API key (with prefix if set). + # @param [String] param_name the parameter name of API key auth + def api_key_with_prefix(param_name, param_alias = nil) + key = @api_key[param_name] + key = @api_key.fetch(param_alias, key) unless param_alias.nil? + if @api_key_prefix[param_name] + "#{@api_key_prefix[param_name]} #{key}" + else + key + end + end + + # Gets Basic Auth token string + def basic_auth_token + 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") + end + + # Returns Auth Settings hash for api client. + def auth_settings + { + 'Basic' => + { + type: 'basic', + in: 'header', + key: 'Authorization', + value: basic_auth_token + }, + } + end + + # Returns an array of Server setting + def server_settings + [ + { + url: "", + description: "No description provided", + } + ] + end + + def operation_server_settings + { + "CallsApi.create_call": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "CallsApi.get_call_state": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "CallsApi.update_call": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "CallsApi.update_call_bxml": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "ConferencesApi.download_conference_recording": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "ConferencesApi.get_conference": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "ConferencesApi.get_conference_member": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "ConferencesApi.get_conference_recording": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "ConferencesApi.list_conference_recordings": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "ConferencesApi.list_conferences": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "ConferencesApi.update_conference": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "ConferencesApi.update_conference_bxml": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "ConferencesApi.update_conference_member": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "MFAApi.generate_messaging_code": [ + { + url: "https://mfa.bandwidth.com/api/v1", + description: "Production", + } + ], + "MFAApi.generate_voice_code": [ + { + url: "https://mfa.bandwidth.com/api/v1", + description: "Production", + } + ], + "MFAApi.verify_code": [ + { + url: "https://mfa.bandwidth.com/api/v1", + description: "Production", + } + ], + "MediaApi.delete_media": [ + { + url: "https://messaging.bandwidth.com/api/v2", + description: "Production", + } + ], + "MediaApi.get_media": [ + { + url: "https://messaging.bandwidth.com/api/v2", + description: "Production", + } + ], + "MediaApi.list_media": [ + { + url: "https://messaging.bandwidth.com/api/v2", + description: "Production", + } + ], + "MediaApi.upload_media": [ + { + url: "https://messaging.bandwidth.com/api/v2", + description: "Production", + } + ], + "MessagesApi.create_message": [ + { + url: "https://messaging.bandwidth.com/api/v2", + description: "Production", + } + ], + "MessagesApi.list_messages": [ + { + url: "https://messaging.bandwidth.com/api/v2", + description: "Production", + } + ], + "ParticipantsApi.create_participant": [ + { + url: "https://api.webrtc.bandwidth.com/v1", + description: "Production", + } + ], + "ParticipantsApi.delete_participant": [ + { + url: "https://api.webrtc.bandwidth.com/v1", + description: "Production", + } + ], + "ParticipantsApi.get_participant": [ + { + url: "https://api.webrtc.bandwidth.com/v1", + description: "Production", + } + ], + "PhoneNumberLookupApi.create_lookup": [ + { + url: "https://numbers.bandwidth.com/api/v1", + description: "Production", + } + ], + "PhoneNumberLookupApi.get_lookup_status": [ + { + url: "https://numbers.bandwidth.com/api/v1", + description: "Production", + } + ], + "RecordingsApi.delete_call_transcription": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "RecordingsApi.delete_recording": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "RecordingsApi.delete_recording_media": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "RecordingsApi.download_call_recording": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "RecordingsApi.get_call_recording": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "RecordingsApi.get_call_transcription": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "RecordingsApi.list_account_call_recordings": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "RecordingsApi.list_call_recordings": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "RecordingsApi.transcribe_call_recording": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "RecordingsApi.update_call_recording_state": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + "SessionsApi.add_participant_to_session": [ + { + url: "https://api.webrtc.bandwidth.com/v1", + description: "Production", + } + ], + "SessionsApi.create_session": [ + { + url: "https://api.webrtc.bandwidth.com/v1", + description: "Production", + } + ], + "SessionsApi.delete_session": [ + { + url: "https://api.webrtc.bandwidth.com/v1", + description: "Production", + } + ], + "SessionsApi.get_participant_subscriptions": [ + { + url: "https://api.webrtc.bandwidth.com/v1", + description: "Production", + } + ], + "SessionsApi.get_session": [ + { + url: "https://api.webrtc.bandwidth.com/v1", + description: "Production", + } + ], + "SessionsApi.list_session_participants": [ + { + url: "https://api.webrtc.bandwidth.com/v1", + description: "Production", + } + ], + "SessionsApi.remove_participant_from_session": [ + { + url: "https://api.webrtc.bandwidth.com/v1", + description: "Production", + } + ], + "SessionsApi.update_participant_subscriptions": [ + { + url: "https://api.webrtc.bandwidth.com/v1", + description: "Production", + } + ], + "StatisticsApi.get_statistics": [ + { + url: "https://voice.bandwidth.com/api/v2", + description: "Production", + } + ], + } + end + + # Returns URL based on server settings + # + # @param index array index of the server settings + # @param variables hash of variable and the corresponding value + def server_url(index, variables = {}, servers = nil) + servers = server_settings if servers == nil + + # check array index out of bound + if (index < 0 || index >= servers.size) + fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" + end + + server = servers[index] + url = server[:url] + + return url unless server.key? :variables + + # go through variable and assign a value + server[:variables].each do |name, variable| + if variables.key?(name) + if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name])) + url.gsub! "{" + name.to_s + "}", variables[name] + else + fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." + end + else + # use default value + url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] + end + end + + url + end + + # Adds middleware to the stack + def use(*middleware) + set_faraday_middleware(:use, *middleware) + end + + # Adds request middleware to the stack + def request(*middleware) + set_faraday_middleware(:request, *middleware) + end + + # Adds response middleware to the stack + def response(*middleware) + set_faraday_middleware(:response, *middleware) + end + + # Adds Faraday middleware setting information to the stack + # + # @example Use the `set_faraday_middleware` method to set middleware information + # config.set_faraday_middleware(:request, :retry, max: 3, methods: [:get, :post], retry_statuses: [503]) + # config.set_faraday_middleware(:response, :logger, nil, { bodies: true, log_level: :debug }) + # config.set_faraday_middleware(:use, Faraday::HttpCache, store: Rails.cache, shared_cache: false) + # config.set_faraday_middleware(:insert, 0, FaradayMiddleware::FollowRedirects, { standards_compliant: true, limit: 1 }) + # config.set_faraday_middleware(:swap, 0, Faraday::Response::Logger) + # config.set_faraday_middleware(:delete, Faraday::Multipart::Middleware) + # + # @see https://github.com/lostisland/faraday/blob/v2.3.0/lib/faraday/rack_builder.rb#L92-L143 + def set_faraday_middleware(operation, key, *args, &block) + unless [:request, :response, :use, :insert, :insert_before, :insert_after, :swap, :delete].include?(operation) + fail ArgumentError, "Invalid faraday middleware operation #{operation}. Must be" \ + " :request, :response, :use, :insert, :insert_before, :insert_after, :swap or :delete." + end + + @middlewares[operation] << [key, args, block] + end + ruby2_keywords(:set_faraday_middleware) if respond_to?(:ruby2_keywords, true) + + # Set up middleware on the connection + def configure_middleware(connection) + return if @middlewares.empty? + + [:request, :response, :use, :insert, :insert_before, :insert_after, :swap].each do |operation| + next unless @middlewares.key?(operation) + + @middlewares[operation].each do |key, args, block| + connection.builder.send(operation, key, *args, &block) + end + end + + if @middlewares.key?(:delete) + @middlewares[:delete].each do |key, _args, _block| + connection.builder.delete(key) + end + end + end + end +end diff --git a/lib/bandwidth-sdk/models/account_statistics.rb b/lib/bandwidth-sdk/models/account_statistics.rb new file mode 100644 index 00000000..36e44d09 --- /dev/null +++ b/lib/bandwidth-sdk/models/account_statistics.rb @@ -0,0 +1,230 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class AccountStatistics + # The number of calls currently enqueued. + attr_accessor :current_call_queue_size + + # The maximum size of the queue before outgoing calls start being rejected. + attr_accessor :max_call_queue_size + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'current_call_queue_size' => :'currentCallQueueSize', + :'max_call_queue_size' => :'maxCallQueueSize' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'current_call_queue_size' => :'Integer', + :'max_call_queue_size' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::AccountStatistics` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::AccountStatistics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'current_call_queue_size') + self.current_call_queue_size = attributes[:'current_call_queue_size'] + end + + if attributes.key?(:'max_call_queue_size') + self.max_call_queue_size = attributes[:'max_call_queue_size'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + current_call_queue_size == o.current_call_queue_size && + max_call_queue_size == o.max_call_queue_size + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [current_call_queue_size, max_call_queue_size].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/answer_callback.rb b/lib/bandwidth-sdk/models/answer_callback.rb new file mode 100644 index 00000000..8c98d5a0 --- /dev/null +++ b/lib/bandwidth-sdk/models/answer_callback.rb @@ -0,0 +1,354 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Answer event is sent to the answerUrl specified in the createCall request when an outbound call is answered. + class AnswerCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete + attr_accessor :machine_detection_result + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'tag' => :'tag', + :'machine_detection_result' => :'machineDetectionResult' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'tag' => :'String', + :'machine_detection_result' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'tag', + :'machine_detection_result' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::AnswerCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::AnswerCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'machine_detection_result') + self.machine_detection_result = attributes[:'machine_detection_result'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + tag == o.tag && + machine_detection_result == o.machine_detection_result + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, enqueued_time, start_time, answer_time, tag, machine_detection_result].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/bridge_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_complete_callback.rb new file mode 100644 index 00000000..993f99e4 --- /dev/null +++ b/lib/bandwidth-sdk/models/bridge_complete_callback.rb @@ -0,0 +1,375 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # If the target call leaves the , then this callback is sent to the bridgeCompleteUrl, and the BXML returned in it is executed on the call. If this webhook is sent, the Bridge Target Complete webhook is NOT sent. This callback is also sent if any problem occurs that prevents the calls to be bridged. + class BridgeCompleteCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. + attr_accessor :cause + + # Text explaining the reason that caused the call to fail in case of errors. + attr_accessor :error_message + + # Bandwidth's internal id that references the error event. + attr_accessor :error_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'tag' => :'tag', + :'cause' => :'cause', + :'error_message' => :'errorMessage', + :'error_id' => :'errorId' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'tag' => :'String', + :'cause' => :'String', + :'error_message' => :'String', + :'error_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'tag', + :'error_message', + :'error_id' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::BridgeCompleteCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BridgeCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'cause') + self.cause = attributes[:'cause'] + end + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'error_id') + self.error_id = attributes[:'error_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + tag == o.tag && + cause == o.cause && + error_message == o.error_message && + error_id == o.error_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, enqueued_time, start_time, answer_time, tag, cause, error_message, error_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb new file mode 100644 index 00000000..187ed492 --- /dev/null +++ b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb @@ -0,0 +1,343 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # If the originating call leaves the , then this callback is sent to the bridgeTargetCompleteUrl, and the BXML returned in it is executed on the target call. If this webhook is sent, the Bridge Complete webhook is NOT sent. + class BridgeTargetCompleteCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::BridgeTargetCompleteCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BridgeTargetCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, enqueued_time, start_time, answer_time, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/bxml/bxml.rb b/lib/bandwidth-sdk/models/bxml/bxml.rb new file mode 100644 index 00000000..ffcec42c --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/bxml.rb @@ -0,0 +1,36 @@ +require 'builder' +Dir[File.dirname(__FILE__) + '/verbs/*'].each {|file| + require_relative file +} + +module Bandwidth + module Voice + class Bxml + # Initializer + # @param verbs [Array] optional list of verbs to include in the bxml tag + def initialize(verbs = nil) + @verbs = verbs || [] + end + + # Return BXML representaion of this response + def to_bxml() + xml = Builder::XmlMarkup.new() + xml.instruct!(:xml, :version=>'1.0', :encoding=>'UTF-8') + xml.Bxml do + @verbs.each {|verb| verb.to_bxml(xml)} + end + xml.target!().gsub(SPEAK_SENTENCE_REGEX){|s|s.gsub(SSML_REGEX, '<\1>')} + end + + # Add one or more verbs to this response + def push(*verbs) + @verbs.push(*verbs) + end + + # Add a verb to this response + def <<(verb) + @verbs << verb + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/response.rb b/lib/bandwidth-sdk/models/bxml/response.rb new file mode 100644 index 00000000..fda1cfe7 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/response.rb @@ -0,0 +1,39 @@ +require 'builder' +Dir[File.dirname(__FILE__) + '/verbs/*'].each {|file| + require_relative file +} + +SSML_REGEX = /<([a-zA-Z\/\/].*?)>/ +SPEAK_SENTENCE_REGEX = /.*?<\/SpeakSentence>/ + +module Bandwidth + module Voice + class Response + # Initializer + # @param verbs [Array] optional list of verbs to include into response + def initialize(verbs = nil) + @verbs = verbs || [] + end + + # Return BXML representaion of this response + def to_bxml() + xml = Builder::XmlMarkup.new() + xml.instruct!(:xml, :version=>'1.0', :encoding=>'UTF-8') + xml.Response do + @verbs.each {|verb| verb.to_bxml(xml)} + end + xml.target!().gsub(SPEAK_SENTENCE_REGEX){|s|s.gsub(SSML_REGEX, '<\1>')} + end + + # Add one or more verbs to this response + def push(*verbs) + @verbs.push(*verbs) + end + + # Add a verb to this response + def <<(verb) + @verbs << verb + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb b/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb new file mode 100644 index 00000000..8235ebfc --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb @@ -0,0 +1,28 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The Bridge verb allows you to connect 2 calls + class Bridge + include XmlVerb + + def to_bxml(xml) + xml.Bridge(call_id, compact_hash({ + 'bridgeCompleteUrl' => bridge_complete_url, + 'bridgeCompleteMethod' => bridge_complete_method, + 'bridgeTargetCompleteUrl' => bridge_target_complete_url, + 'bridgeTargetCompleteMethod' => bridge_target_complete_method, + 'username' => username, + 'password' => password, + 'tag' => tag, + 'bridgeCompleteFallbackUrl' => bridge_complete_fallback_url, + 'bridgeCompleteFallbackMethod' => bridge_complete_fallback_method, + 'bridgeTargetCompleteFallbackUrl' => bridge_target_complete_fallback_url, + 'bridgeTargetCompleteFallbackMethod' => bridge_target_complete_fallback_method, + 'fallbackUsername' => fallback_username, + 'fallbackPassword' => fallback_password + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/conference.rb b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb new file mode 100644 index 00000000..c4147a00 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb @@ -0,0 +1,32 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The Conference verb is used to add callees to conferences + class Conference + include XmlVerb + + def to_bxml(xml) + if not call_ids_to_coach.nil? + coach_ids = call_ids_to_coach.instance_of?(String) ? call_ids_to_coach : call_ids_to_coach.join(",") + else + coach_ids = nil + end + xml.Conference(conference_name, compact_hash({ + 'mute' => mute, + 'hold' => hold, + 'callIdsToCoach' => coach_ids, + 'conferenceEventUrl' => conference_event_url, + 'conferenceEventMethod' => conference_event_method, + 'username' => username, + 'password' => password, + 'tag' => tag, + 'conferenceEventFallbackUrl' => conference_event_fallback_url, + 'conferenceEventFallbackMethod' => conference_event_fallback_method, + 'fallbackUsername' => fallback_username, + 'fallbackPassword' => fallback_password + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/forward.rb b/lib/bandwidth-sdk/models/bxml/verbs/forward.rb new file mode 100644 index 00000000..d429ae4a --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/forward.rb @@ -0,0 +1,18 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + class Forward + include XmlVerb + def to_bxml(xml) + xml.Forward(compact_hash({ + 'to' => to, + 'from' => from, + 'callTimeout' => call_timeout, + 'diversionTreatment' => diversion_treatment, + 'diversionReason' => diversion_reason + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb new file mode 100644 index 00000000..d898f8cd --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb @@ -0,0 +1,49 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The Gather verb is used to collect digits for some period of time + class Gather + include XmlVerb + + def to_bxml(xml) + xml.Gather(compact_hash({ + 'gatherUrl' => gather_url, + 'gatherMethod' => gather_method, + 'terminatingDigits' => terminating_digits, + 'tag' => tag, + 'maxDigits' => max_digits, + 'interDigitTimeout' => inter_digit_timeout, + 'username' => username, + 'password' => password, + 'firstDigitTimeout' => first_digit_timeout, + 'repeatCount' => repeat_count, + 'gatherFallbackUrl' => gather_fallback_url, + 'gatherFallbackMethod' => gather_fallback_method, + 'fallbackUsername' => fallback_username, + 'fallbackPassword' => fallback_password + })) do + def embedded_xml(xml, property, type) + if property + s = if property.is_a?(type) + then property + else type.new(property) + end + s.to_bxml(xml) + end + end + def nest_verbs_list(xml, property) + if property + property.each do |verb| + verb.to_bxml(xml) + end + end + end + embedded_xml(xml, speak_sentence, SpeakSentence) + embedded_xml(xml, play_audio, PlayAudio) + nest_verbs_list(xml, nested_verbs) + end + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb b/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb new file mode 100644 index 00000000..d316ebfc --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb @@ -0,0 +1,14 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The Hangup verb is used to hangup current call + class Hangup + include XmlVerb + + def to_bxml(xml) + xml.Hangup() + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/pause.rb b/lib/bandwidth-sdk/models/bxml/verbs/pause.rb new file mode 100644 index 00000000..7c6dc966 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/pause.rb @@ -0,0 +1,15 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + class Pause + include XmlVerb + + def to_bxml(xml) + xml.Pause(compact_hash({ + 'duration' => duration + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb new file mode 100644 index 00000000..86cd439c --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb @@ -0,0 +1,14 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The PauseRecording verb is used to pause recording in a call + class PauseRecording + include XmlVerb + + def to_bxml(xml) + xml.PauseRecording() + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb b/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb new file mode 100644 index 00000000..725dbdc0 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb @@ -0,0 +1,24 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + class PhoneNumber + include XmlVerb + def to_bxml(xml) + xml.PhoneNumber(number, compact_hash({ + 'transferAnswerUrl' => transfer_answer_url, + 'transferAnswerMethod' => transfer_answer_method, + 'transferDisconnectUrl' => transfer_disconnect_url, + 'transferDisconnectMethod' => transfer_disconnect_method, + 'username' => username, + 'password' => password, + 'tag' => tag, + 'transferAnswerFallbackUrl' => transfer_answer_fallback_url, + 'transferAnswerFallbackMethod' => transfer_answer_fallback_method, + 'fallbackUsername' => fallback_username, + 'fallbackPassword' => fallback_password + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb b/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb new file mode 100644 index 00000000..59e7bfcb --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb @@ -0,0 +1,17 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The PlayAudio verb is used to play an audio file in the call + class PlayAudio + include XmlVerb + + def to_bxml(xml) + xml.PlayAudio(url, compact_hash({ + 'username' => username, + 'password' => password + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/record.rb b/lib/bandwidth-sdk/models/bxml/verbs/record.rb new file mode 100644 index 00000000..ad2f6676 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/record.rb @@ -0,0 +1,33 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The Record verb is used to trigger call recording + class Record + include XmlVerb + + def to_bxml(xml) + xml.Record(compact_hash({ + 'tag' => tag, + 'username' => username, + 'password' => password, + 'recordCompleteUrl' => record_complete_url, + 'recordCompleteMethod' => record_complete_method, + 'recordingAvailableUrl' => recording_available_url, + 'recordingAvailableMethod' => recording_available_method, + 'terminatingDigits' => terminating_digits, + 'maxDuration' => max_duration, + 'fileFormat' => file_format, + 'transcribe' => transcribe, + 'transcriptionAvailableUrl' => transcription_available_url, + 'transcriptionAvailableMethod' => transcription_available_method, + 'silenceTimeout' => silence_timeout, + 'recordCompleteFallbackUrl' => record_complete_fallback_url, + 'recordCompleteFallbackMethod' => record_complete_fallback_method, + 'fallbackUsername' => fallback_username, + 'fallbackPassword' => fallback_password + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb b/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb new file mode 100644 index 00000000..80112e0b --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb @@ -0,0 +1,24 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The Redirect verb is used to redirect the current XML execution to another URL + class Redirect + include XmlVerb + + def to_bxml(xml) + xml.Redirect(compact_hash({ + 'redirectUrl' => redirect_url, + 'redirectMethod' => redirect_method, + 'tag' => tag, + 'username' => username, + 'password' => password, + 'redirectFallbackUrl' => redirect_fallback_url, + 'redirectFallbackMethod' => redirect_fallback_method, + 'fallbackUsername' => fallback_username, + 'fallbackPassword' => fallback_password + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb new file mode 100644 index 00000000..09ec5ebf --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb @@ -0,0 +1,14 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The ResumeRecording verb is used to resume recording in a call + class ResumeRecording + include XmlVerb + + def to_bxml(xml) + xml.ResumeRecording() + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/ring.rb b/lib/bandwidth-sdk/models/bxml/verbs/ring.rb new file mode 100644 index 00000000..d1a41c14 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/ring.rb @@ -0,0 +1,16 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + class Ring + include XmlVerb + + def to_bxml(xml) + xml.Ring(compact_hash({ + 'duration' => duration, + 'answerCall' => answer_call + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb b/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb new file mode 100644 index 00000000..f2c9a140 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb @@ -0,0 +1,16 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + class SendDtmf + include XmlVerb + + def to_bxml(xml) + xml.SendDtmf(dtmf, compact_hash({ + 'toneDuration' => tone_duration, + 'toneInterval' => tone_interval + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb b/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb new file mode 100644 index 00000000..2465a8b0 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb @@ -0,0 +1,25 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + class SipUri + include XmlVerb + def to_bxml(xml) + xml.SipUri(uri, compact_hash({ + 'transferAnswerUrl' => transfer_answer_url, + 'transferAnswerMethod' => transfer_answer_method, + 'transferDisconnectUrl' => transfer_disconnect_url, + 'transferDisconnectMethod' => transfer_disconnect_method, + 'username' => username, + 'password' => password, + 'tag' => tag, + 'uui' => uui, + 'transferAnswerFallbackUrl' => transfer_answer_fallback_url, + 'transferAnswerFallbackMethod' => transfer_answer_fallback_method, + 'fallbackUsername' => fallback_username, + 'fallbackPassword' => fallback_password + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb new file mode 100644 index 00000000..b43c9795 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb @@ -0,0 +1,18 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The SpeakSentence verb is used to convert any text into speak for the caller + class SpeakSentence + include XmlVerb + + def to_bxml(xml) + xml.SpeakSentence(sentence, compact_hash({ + 'voice' => voice, + 'locale' => locale, + 'gender' => gender + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb new file mode 100644 index 00000000..39454343 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb @@ -0,0 +1,20 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The StartGather verb is used to start a gather + class StartGather + include XmlVerb + + def to_bxml(xml) + xml.StartGather(compact_hash({ + 'username' => username, + 'password' => password, + 'tag' => tag, + 'dtmfUrl' => dtmf_url, + 'dtmfMethod' => dtmf_method, + })) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb new file mode 100644 index 00000000..292ea88a --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb @@ -0,0 +1,25 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The StartRecording verb is used to trigger call recording + class StartRecording + include XmlVerb + + def to_bxml(xml) + xml.StartRecording(compact_hash({ + 'tag' => tag, + 'username' => username, + 'password' => password, + 'recordingAvailableUrl' => recording_available_url, + 'recordingAvailableMethod' => recording_available_method, + 'fileFormat' => file_format, + 'multiChannel' => multi_channel, + 'transcribe' => transcribe, + 'transcriptionAvailableUrl' => transcription_available_url, + 'transcriptionAvailableMethod' => transcription_available_method + })) + end + end + end +end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/start_stream.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb similarity index 100% rename from lib/bandwidth/voice_lib/bxml/verbs/start_stream.rb rename to lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb new file mode 100644 index 00000000..0e4c5dae --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb @@ -0,0 +1,14 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The StopGather verb is used to complete a gather + class StopGather + include XmlVerb + + def to_bxml(xml) + xml.StopGather() + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb new file mode 100644 index 00000000..eececb46 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb @@ -0,0 +1,14 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The StopRecording verb is used to stop recording in a call + class StopRecording + include XmlVerb + + def to_bxml(xml) + xml.StopRecording() + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb new file mode 100644 index 00000000..32920835 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb @@ -0,0 +1,16 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The StopStream verb is used to stop a stream that was started with a previous `` verb + class StopStream + include XmlVerb + + def to_bxml(xml) + xml.StopStream(compact_hash({ + 'name' => name + })) + end + end + end +end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/stream_param.rb b/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb similarity index 100% rename from lib/bandwidth/voice_lib/bxml/verbs/stream_param.rb rename to lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb diff --git a/lib/bandwidth-sdk/models/bxml/verbs/tag.rb b/lib/bandwidth-sdk/models/bxml/verbs/tag.rb new file mode 100644 index 00000000..20e2f7d2 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/tag.rb @@ -0,0 +1,13 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + class Tag + include XmlVerb + + def to_bxml(xml) + xml.Tag(tag) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb b/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb new file mode 100644 index 00000000..680da916 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb @@ -0,0 +1,48 @@ +require_relative 'xml_verb' + +module Bandwidth + module Voice + # The Transfer verb is used to transfer the call to another number + class Transfer + include XmlVerb + + def to_bxml(xml) + xml.Transfer(compact_hash({ + 'transferCallerId' => transfer_caller_id, + 'callTimeout' => call_timeout, + 'tag' => tag, + 'transferCompleteUrl' => transfer_complete_url, + 'transferCompleteMethod' => transfer_complete_method, + 'username' => username, + 'password' => password, + 'diversionTreatment' => diversion_treatment, + 'diversionReason' => diversion_reason, + 'transferCompleteFallbackUrl' => transfer_complete_fallback_url, + 'transferCompleteFallbackMethod' => transfer_complete_fallback_method, + 'fallbackUsername' => fallback_username, + 'fallbackPassword' => fallback_password + })) do + def embedded_xml(xml, property, type) + if property + s = if property.is_a?(type) + then property + else type.new(property) + end + s.to_bxml(xml) + end + end + if not phone_numbers.nil? + phone_numbers.each do |number| + embedded_xml(xml, number, PhoneNumber) + end + end + if not sip_uris.nil? + sip_uris.each do |sip_uri| + embedded_xml(xml, sip_uri, SipUri) + end + end + end + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/xml_verb.rb b/lib/bandwidth-sdk/models/bxml/verbs/xml_verb.rb new file mode 100644 index 00000000..8233a934 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/xml_verb.rb @@ -0,0 +1,26 @@ +module Bandwidth + module Voice + module XmlVerb + def initialize(data = nil) + @data = (data || {}).clone() + end + + def method_missing(name, *args, &block) + if name[name.size - 1] == '=' + @data[name[0..-2].to_sym] = args[0] + else + @data[name] + end + end + + def compact_hash(hash) + hash.inject({}) do |new_hash, (k,v)| + if !v.nil? + new_hash[k] = v.class == Hash ? compact_hash(v) : v + end + new_hash + end + end + end + end +end diff --git a/lib/bandwidth-sdk/models/call_direction_enum.rb b/lib/bandwidth-sdk/models/call_direction_enum.rb new file mode 100644 index 00000000..3ce97b83 --- /dev/null +++ b/lib/bandwidth-sdk/models/call_direction_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CallDirectionEnum + INBOUND = "inbound".freeze + OUTBOUND = "outbound".freeze + + def self.all_vars + @all_vars ||= [INBOUND, OUTBOUND].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if CallDirectionEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #CallDirectionEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/call_recording_metadata.rb b/lib/bandwidth-sdk/models/call_recording_metadata.rb new file mode 100644 index 00000000..3c74e4c6 --- /dev/null +++ b/lib/bandwidth-sdk/models/call_recording_metadata.rb @@ -0,0 +1,389 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CallRecordingMetadata + # The id of the application associated with the call. + attr_accessor :application_id + + # The user account associated with the call. + attr_accessor :account_id + + # The call id associated with the event. + attr_accessor :call_id + + # (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. + attr_accessor :parent_call_id + + # The unique ID of this recording + attr_accessor :recording_id + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + # 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. + attr_accessor :from + + # 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. + attr_accessor :transfer_caller_id + + # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). + attr_accessor :transfer_to + + # The duration of the recording in ISO-8601 format + attr_accessor :duration + + attr_accessor :direction + + # Always `1` for conference recordings; multi-channel recordings are not supported on conferences. + attr_accessor :channels + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # The time that the recording ended in ISO-8601 format + attr_accessor :end_time + + attr_accessor :file_format + + # 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. + attr_accessor :status + + # The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. + attr_accessor :media_url + + attr_accessor :transcription + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'application_id' => :'applicationId', + :'account_id' => :'accountId', + :'call_id' => :'callId', + :'parent_call_id' => :'parentCallId', + :'recording_id' => :'recordingId', + :'to' => :'to', + :'from' => :'from', + :'transfer_caller_id' => :'transferCallerId', + :'transfer_to' => :'transferTo', + :'duration' => :'duration', + :'direction' => :'direction', + :'channels' => :'channels', + :'start_time' => :'startTime', + :'end_time' => :'endTime', + :'file_format' => :'fileFormat', + :'status' => :'status', + :'media_url' => :'mediaUrl', + :'transcription' => :'transcription' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'application_id' => :'String', + :'account_id' => :'String', + :'call_id' => :'String', + :'parent_call_id' => :'String', + :'recording_id' => :'String', + :'to' => :'String', + :'from' => :'String', + :'transfer_caller_id' => :'String', + :'transfer_to' => :'String', + :'duration' => :'String', + :'direction' => :'CallDirectionEnum', + :'channels' => :'Integer', + :'start_time' => :'Time', + :'end_time' => :'Time', + :'file_format' => :'FileFormatEnum', + :'status' => :'String', + :'media_url' => :'String', + :'transcription' => :'TranscriptionMetadata' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'media_url', + :'transcription' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CallRecordingMetadata` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallRecordingMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'transfer_caller_id') + self.transfer_caller_id = attributes[:'transfer_caller_id'] + end + + if attributes.key?(:'transfer_to') + self.transfer_to = attributes[:'transfer_to'] + end + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'channels') + self.channels = attributes[:'channels'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'file_format') + self.file_format = attributes[:'file_format'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'media_url') + self.media_url = attributes[:'media_url'] + end + + if attributes.key?(:'transcription') + self.transcription = attributes[:'transcription'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + application_id == o.application_id && + account_id == o.account_id && + call_id == o.call_id && + parent_call_id == o.parent_call_id && + recording_id == o.recording_id && + to == o.to && + from == o.from && + transfer_caller_id == o.transfer_caller_id && + transfer_to == o.transfer_to && + duration == o.duration && + direction == o.direction && + channels == o.channels && + start_time == o.start_time && + end_time == o.end_time && + file_format == o.file_format && + status == o.status && + media_url == o.media_url && + transcription == o.transcription + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [application_id, account_id, call_id, parent_call_id, recording_id, to, from, transfer_caller_id, transfer_to, duration, direction, channels, start_time, end_time, file_format, status, media_url, transcription].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/call_state.rb b/lib/bandwidth-sdk/models/call_state.rb new file mode 100644 index 00000000..e0f3aa1d --- /dev/null +++ b/lib/bandwidth-sdk/models/call_state.rb @@ -0,0 +1,401 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CallState + # The application id associated with the call. + attr_accessor :application_id + + # The account id associated with the call. + attr_accessor :account_id + + # The programmable voice API call ID. + attr_accessor :call_id + + # The A-leg call id, set only if this call is the B-leg of a [``](/docs/voice/bxml/transfer). + attr_accessor :parent_call_id + + # The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI + attr_accessor :to + + # The phone number that made the call, in E.164 format (e.g. +15555555555). + attr_accessor :from + + attr_accessor :direction + + # The current state of the call. Current possible values are `queued`, `initiated`, `answered` and `disconnected`. Additional states may be added in the future, so your application must be tolerant of unknown values. + attr_accessor :state + + # For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken) + attr_accessor :stir_shaken + + # The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header. + attr_accessor :identity + + # The time this call was placed in queue. + attr_accessor :enqueued_time + + # The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue. + attr_accessor :start_time + + # Populated once the call has been answered, with the time in ISO 8601 format. + attr_accessor :answer_time + + # Populated once the call has ended, with the time in ISO 8601 format. + attr_accessor :end_time + + # | Cause | Description | |:------|:------------| | `hangup`| One party hung up the call, a [``](../../bxml/verbs/hangup.md) verb was executed, or there was no more BXML to execute; it indicates that the call ended normally. | | `busy` | Callee was busy. | | `timeout` | Call wasn't answered before the `callTimeout` was reached. | | `cancel` | Call was cancelled by its originator while it was ringing. | | `rejected` | Call was rejected by the callee. | | `callback-error` | BXML callback couldn't be delivered to your callback server. | | `invalid-bxml` | Invalid BXML was returned in response to a callback. | | `application-error` | An unsupported action was tried on the call, e.g. trying to play a .ogg audio. | | `account-limit` | Account rate limits were reached. | | `node-capacity-exceeded` | System maximum capacity was reached. | | `error` | Some error not described in any of the other causes happened on the call. | | `unknown` | Unknown error happened on the call. | Note: This list is not exhaustive and other values can appear in the future. + attr_accessor :disconnect_cause + + # Populated only if the call ended with an error, with text explaining the reason. + attr_accessor :error_message + + # Populated only if the call ended with an error, with a Bandwidth internal id that references the error event. + attr_accessor :error_id + + # The last time the call had a state update, in ISO 8601 format. + attr_accessor :last_update + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'application_id' => :'applicationId', + :'account_id' => :'accountId', + :'call_id' => :'callId', + :'parent_call_id' => :'parentCallId', + :'to' => :'to', + :'from' => :'from', + :'direction' => :'direction', + :'state' => :'state', + :'stir_shaken' => :'stirShaken', + :'identity' => :'identity', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'end_time' => :'endTime', + :'disconnect_cause' => :'disconnectCause', + :'error_message' => :'errorMessage', + :'error_id' => :'errorId', + :'last_update' => :'lastUpdate' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'application_id' => :'String', + :'account_id' => :'String', + :'call_id' => :'String', + :'parent_call_id' => :'String', + :'to' => :'String', + :'from' => :'String', + :'direction' => :'CallDirectionEnum', + :'state' => :'String', + :'stir_shaken' => :'Hash', + :'identity' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'end_time' => :'Time', + :'disconnect_cause' => :'String', + :'error_message' => :'String', + :'error_id' => :'String', + :'last_update' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'parent_call_id', + :'stir_shaken', + :'identity', + :'enqueued_time', + :'start_time', + :'answer_time', + :'end_time', + :'disconnect_cause', + :'error_message', + :'error_id', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CallState` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallState`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'stir_shaken') + if (value = attributes[:'stir_shaken']).is_a?(Hash) + self.stir_shaken = value + end + end + + if attributes.key?(:'identity') + self.identity = attributes[:'identity'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'disconnect_cause') + self.disconnect_cause = attributes[:'disconnect_cause'] + end + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'error_id') + self.error_id = attributes[:'error_id'] + end + + if attributes.key?(:'last_update') + self.last_update = attributes[:'last_update'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + application_id == o.application_id && + account_id == o.account_id && + call_id == o.call_id && + parent_call_id == o.parent_call_id && + to == o.to && + from == o.from && + direction == o.direction && + state == o.state && + stir_shaken == o.stir_shaken && + identity == o.identity && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + end_time == o.end_time && + disconnect_cause == o.disconnect_cause && + error_message == o.error_message && + error_id == o.error_id && + last_update == o.last_update + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [application_id, account_id, call_id, parent_call_id, to, from, direction, state, stir_shaken, identity, enqueued_time, start_time, answer_time, end_time, disconnect_cause, error_message, error_id, last_update].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/call_state_enum.rb b/lib/bandwidth-sdk/models/call_state_enum.rb new file mode 100644 index 00000000..387362e3 --- /dev/null +++ b/lib/bandwidth-sdk/models/call_state_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CallStateEnum + ACTIVE = "active".freeze + COMPLETED = "completed".freeze + + def self.all_vars + @all_vars ||= [ACTIVE, COMPLETED].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if CallStateEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #CallStateEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/callback_method_enum.rb b/lib/bandwidth-sdk/models/callback_method_enum.rb new file mode 100644 index 00000000..2d6005af --- /dev/null +++ b/lib/bandwidth-sdk/models/callback_method_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CallbackMethodEnum + GET = "GET".freeze + POST = "POST".freeze + + def self.all_vars + @all_vars ||= [GET, POST].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if CallbackMethodEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #CallbackMethodEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/code_request.rb b/lib/bandwidth-sdk/models/code_request.rb new file mode 100644 index 00000000..27257878 --- /dev/null +++ b/lib/bandwidth-sdk/models/code_request.rb @@ -0,0 +1,427 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CodeRequest + # The phone number to send the mfa code to. + attr_accessor :to + + # The application phone number, the sender of the mfa code. + attr_accessor :from + + # The application unique ID, obtained from Bandwidth. + attr_accessor :application_id + + # An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\". + attr_accessor :scope + + # The message format of the mfa code. There are three values that the system will replace \"{CODE}\", \"{NAME}\", \"{SCOPE}\". The \"{SCOPE}\" and \"{NAME} value template are optional, while \"{CODE}\" must be supplied. As the name would suggest, code will be replace with the actual mfa code. Name is replaced with the application name, configured during provisioning of mfa. The scope value is the same value sent during the call and partitioned by the server. + attr_accessor :message + + # The number of digits for your mfa code. The valid number ranges from 2 to 8, inclusively. + attr_accessor :digits + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'to' => :'to', + :'from' => :'from', + :'application_id' => :'applicationId', + :'scope' => :'scope', + :'message' => :'message', + :'digits' => :'digits' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'to' => :'String', + :'from' => :'String', + :'application_id' => :'String', + :'scope' => :'String', + :'message' => :'String', + :'digits' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CodeRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CodeRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'scope') + self.scope = attributes[:'scope'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'digits') + self.digits = attributes[:'digits'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + pattern = Regexp.new(/^\+[1-9]\d{1,14}$/) + if @to !~ pattern + invalid_properties.push("invalid value for \"to\", must conform to the pattern #{pattern}.") + end + + if @from.nil? + invalid_properties.push('invalid value for "from", from cannot be nil.') + end + + if @from.to_s.length > 32 + invalid_properties.push('invalid value for "from", the character length must be smaller than or equal to 32.') + end + + pattern = Regexp.new(/^\+[1-9]\d{1,14}$/) + if @from !~ pattern + invalid_properties.push("invalid value for \"from\", must conform to the pattern #{pattern}.") + end + + if @application_id.nil? + invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') + end + + if @application_id.to_s.length > 50 + invalid_properties.push('invalid value for "application_id", the character length must be smaller than or equal to 50.') + end + + if !@scope.nil? && @scope.to_s.length > 25 + invalid_properties.push('invalid value for "scope", the character length must be smaller than or equal to 25.') + end + + if @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + if @message.to_s.length > 2048 + invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 2048.') + end + + if @digits.nil? + invalid_properties.push('invalid value for "digits", digits cannot be nil.') + end + + if @digits > 8 + invalid_properties.push('invalid value for "digits", must be smaller than or equal to 8.') + end + + if @digits < 4 + invalid_properties.push('invalid value for "digits", must be greater than or equal to 4.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @to.nil? + return false if @to !~ Regexp.new(/^\+[1-9]\d{1,14}$/) + return false if @from.nil? + return false if @from.to_s.length > 32 + return false if @from !~ Regexp.new(/^\+[1-9]\d{1,14}$/) + return false if @application_id.nil? + return false if @application_id.to_s.length > 50 + return false if !@scope.nil? && @scope.to_s.length > 25 + return false if @message.nil? + return false if @message.to_s.length > 2048 + return false if @digits.nil? + return false if @digits > 8 + return false if @digits < 4 + true + end + + # Custom attribute writer method with validation + # @param [Object] to Value to be assigned + def to=(to) + if to.nil? + fail ArgumentError, 'to cannot be nil' + end + + pattern = Regexp.new(/^\+[1-9]\d{1,14}$/) + if to !~ pattern + fail ArgumentError, "invalid value for \"to\", must conform to the pattern #{pattern}." + end + + @to = to + end + + # Custom attribute writer method with validation + # @param [Object] from Value to be assigned + def from=(from) + if from.nil? + fail ArgumentError, 'from cannot be nil' + end + + if from.to_s.length > 32 + fail ArgumentError, 'invalid value for "from", the character length must be smaller than or equal to 32.' + end + + pattern = Regexp.new(/^\+[1-9]\d{1,14}$/) + if from !~ pattern + fail ArgumentError, "invalid value for \"from\", must conform to the pattern #{pattern}." + end + + @from = from + end + + # Custom attribute writer method with validation + # @param [Object] application_id Value to be assigned + def application_id=(application_id) + if application_id.nil? + fail ArgumentError, 'application_id cannot be nil' + end + + if application_id.to_s.length > 50 + fail ArgumentError, 'invalid value for "application_id", the character length must be smaller than or equal to 50.' + end + + @application_id = application_id + end + + # Custom attribute writer method with validation + # @param [Object] scope Value to be assigned + def scope=(scope) + if !scope.nil? && scope.to_s.length > 25 + fail ArgumentError, 'invalid value for "scope", the character length must be smaller than or equal to 25.' + end + + @scope = scope + end + + # Custom attribute writer method with validation + # @param [Object] message Value to be assigned + def message=(message) + if message.nil? + fail ArgumentError, 'message cannot be nil' + end + + if message.to_s.length > 2048 + fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 2048.' + end + + @message = message + end + + # Custom attribute writer method with validation + # @param [Object] digits Value to be assigned + def digits=(digits) + if digits.nil? + fail ArgumentError, 'digits cannot be nil' + end + + if digits > 8 + fail ArgumentError, 'invalid value for "digits", must be smaller than or equal to 8.' + end + + if digits < 4 + fail ArgumentError, 'invalid value for "digits", must be greater than or equal to 4.' + end + + @digits = digits + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + to == o.to && + from == o.from && + application_id == o.application_id && + scope == o.scope && + message == o.message && + digits == o.digits + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [to, from, application_id, scope, message, digits].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/conference.rb b/lib/bandwidth-sdk/models/conference.rb new file mode 100644 index 00000000..01d937cb --- /dev/null +++ b/lib/bandwidth-sdk/models/conference.rb @@ -0,0 +1,298 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class Conference + # The Bandwidth-generated conference ID + attr_accessor :id + + # The name of the conference, as specified by your application + attr_accessor :name + + # The time the conference was initiated, in ISO 8601 format. + attr_accessor :created_time + + # The time the conference was terminated, in ISO 8601 format. + attr_accessor :completed_time + + # The URL to send the conference-related events. + attr_accessor :conference_event_url + + attr_accessor :conference_event_method + + # The custom string attached to the conference that will be sent with callbacks. + attr_accessor :tag + + # 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) + attr_accessor :active_members + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'created_time' => :'createdTime', + :'completed_time' => :'completedTime', + :'conference_event_url' => :'conferenceEventUrl', + :'conference_event_method' => :'conferenceEventMethod', + :'tag' => :'tag', + :'active_members' => :'activeMembers' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'created_time' => :'Time', + :'completed_time' => :'Time', + :'conference_event_url' => :'String', + :'conference_event_method' => :'CallbackMethodEnum', + :'tag' => :'String', + :'active_members' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'completed_time', + :'conference_event_url', + :'conference_event_method', + :'tag', + :'active_members' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Conference` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Conference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'created_time') + self.created_time = attributes[:'created_time'] + end + + if attributes.key?(:'completed_time') + self.completed_time = attributes[:'completed_time'] + end + + if attributes.key?(:'conference_event_url') + self.conference_event_url = attributes[:'conference_event_url'] + end + + if attributes.key?(:'conference_event_method') + self.conference_event_method = attributes[:'conference_event_method'] + else + self.conference_event_method = 'POST' + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'active_members') + if (value = attributes[:'active_members']).is_a?(Array) + self.active_members = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + created_time == o.created_time && + completed_time == o.completed_time && + conference_event_url == o.conference_event_url && + conference_event_method == o.conference_event_method && + tag == o.tag && + active_members == o.active_members + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name, created_time, completed_time, conference_event_url, conference_event_method, tag, active_members].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/conference_completed_callback.rb b/lib/bandwidth-sdk/models/conference_completed_callback.rb new file mode 100644 index 00000000..9c7eb44d --- /dev/null +++ b/lib/bandwidth-sdk/models/conference_completed_callback.rb @@ -0,0 +1,262 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Conference Completed event is fired when the last member leaves the conference. The response to this event may not contain BXML. + class ConferenceCompletedCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The unique, Bandwidth-generated ID of the conference that was recorded + attr_accessor :conference_id + + # The user-specified name of the conference that was recorded + attr_accessor :name + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'conference_id' => :'conferenceId', + :'name' => :'name', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'conference_id' => :'String', + :'name' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceCompletedCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceCompletedCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + conference_id == o.conference_id && + name == o.name && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, conference_id, name, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/conference_created_callback.rb b/lib/bandwidth-sdk/models/conference_created_callback.rb new file mode 100644 index 00000000..4bccebd9 --- /dev/null +++ b/lib/bandwidth-sdk/models/conference_created_callback.rb @@ -0,0 +1,262 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Conference Created event is fired whenever a new conference that specified a callbackUrl is created. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. + class ConferenceCreatedCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The unique, Bandwidth-generated ID of the conference that was recorded + attr_accessor :conference_id + + # The user-specified name of the conference that was recorded + attr_accessor :name + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'conference_id' => :'conferenceId', + :'name' => :'name', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'conference_id' => :'String', + :'name' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceCreatedCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceCreatedCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + conference_id == o.conference_id && + name == o.name && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, conference_id, name, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/conference_member.rb b/lib/bandwidth-sdk/models/conference_member.rb new file mode 100644 index 00000000..8c0de005 --- /dev/null +++ b/lib/bandwidth-sdk/models/conference_member.rb @@ -0,0 +1,273 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class ConferenceMember + # The call id associated with the event. + attr_accessor :call_id + + # The unique, Bandwidth-generated ID of the conference that was recorded + attr_accessor :conference_id + + # A URL that may be used to retrieve information about or update the state of this conference member. This is the URL of this member's [Get Conference Member](/apis/voice/#operation/getConferenceMember) endpoint and [Modify Conference Member](/apis/voice/#operation/updateConferenceMember) endpoint. + attr_accessor :member_url + + # Whether or not this member is currently muted. Members who are muted are still able to hear other participants. If used in a PUT request, updates this member's mute status. Has no effect if omitted. + attr_accessor :mute + + # Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. If used in a PUT request, updates this member's hold status. Has no effect if omitted. + attr_accessor :hold + + # If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. If present in a PUT request, modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join. + attr_accessor :call_ids_to_coach + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'call_id' => :'callId', + :'conference_id' => :'conferenceId', + :'member_url' => :'memberUrl', + :'mute' => :'mute', + :'hold' => :'hold', + :'call_ids_to_coach' => :'callIdsToCoach' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'call_id' => :'String', + :'conference_id' => :'String', + :'member_url' => :'String', + :'mute' => :'Boolean', + :'hold' => :'Boolean', + :'call_ids_to_coach' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_ids_to_coach' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceMember` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceMember`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'member_url') + self.member_url = attributes[:'member_url'] + end + + if attributes.key?(:'mute') + self.mute = attributes[:'mute'] + end + + if attributes.key?(:'hold') + self.hold = attributes[:'hold'] + end + + if attributes.key?(:'call_ids_to_coach') + if (value = attributes[:'call_ids_to_coach']).is_a?(Array) + self.call_ids_to_coach = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + call_id == o.call_id && + conference_id == o.conference_id && + member_url == o.member_url && + mute == o.mute && + hold == o.hold && + call_ids_to_coach == o.call_ids_to_coach + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [call_id, conference_id, member_url, mute, hold, call_ids_to_coach].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb new file mode 100644 index 00000000..4f4f890e --- /dev/null +++ b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb @@ -0,0 +1,292 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Conference Member Exit event is fired whenever a caller exits a conference that specified a callbackUrl. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. + class ConferenceMemberExitCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The unique, Bandwidth-generated ID of the conference that was recorded + attr_accessor :conference_id + + # The user-specified name of the conference that was recorded + attr_accessor :name + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + # The call id associated with the event. + attr_accessor :call_id + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'conference_id' => :'conferenceId', + :'name' => :'name', + :'from' => :'from', + :'to' => :'to', + :'call_id' => :'callId', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'conference_id' => :'String', + :'name' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_id' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceMemberExitCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceMemberExitCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + conference_id == o.conference_id && + name == o.name && + from == o.from && + to == o.to && + call_id == o.call_id && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, conference_id, name, from, to, call_id, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/conference_member_join_callback.rb b/lib/bandwidth-sdk/models/conference_member_join_callback.rb new file mode 100644 index 00000000..c1b226a1 --- /dev/null +++ b/lib/bandwidth-sdk/models/conference_member_join_callback.rb @@ -0,0 +1,292 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Conference Member Join event is fired whenever a caller joins a conference that specified a callbackUrl. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. + class ConferenceMemberJoinCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The unique, Bandwidth-generated ID of the conference that was recorded + attr_accessor :conference_id + + # The user-specified name of the conference that was recorded + attr_accessor :name + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + # The call id associated with the event. + attr_accessor :call_id + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'conference_id' => :'conferenceId', + :'name' => :'name', + :'from' => :'from', + :'to' => :'to', + :'call_id' => :'callId', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'conference_id' => :'String', + :'name' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_id' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceMemberJoinCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceMemberJoinCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + conference_id == o.conference_id && + name == o.name && + from == o.from && + to == o.to && + call_id == o.call_id && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, conference_id, name, from, to, call_id, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb new file mode 100644 index 00000000..27888d6c --- /dev/null +++ b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb @@ -0,0 +1,352 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Conference Recording Available event is sent after a conference recording has been processed. It indicates that the recording is available for download. + class ConferenceRecordingAvailableCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The unique, Bandwidth-generated ID of the conference that was recorded + attr_accessor :conference_id + + # The user-specified name of the conference that was recorded + attr_accessor :name + + # The user account associated with the call. + attr_accessor :account_id + + # The unique ID of this recording + attr_accessor :recording_id + + # Always `1` for conference recordings; multi-channel recordings are not supported on conferences. + attr_accessor :channels + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # The time that the recording ended in ISO-8601 format + attr_accessor :end_time + + # The duration of the recording in ISO-8601 format + attr_accessor :duration + + attr_accessor :file_format + + # The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. + attr_accessor :media_url + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # 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. + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'conference_id' => :'conferenceId', + :'name' => :'name', + :'account_id' => :'accountId', + :'recording_id' => :'recordingId', + :'channels' => :'channels', + :'start_time' => :'startTime', + :'end_time' => :'endTime', + :'duration' => :'duration', + :'file_format' => :'fileFormat', + :'media_url' => :'mediaUrl', + :'tag' => :'tag', + :'status' => :'status' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'conference_id' => :'String', + :'name' => :'String', + :'account_id' => :'String', + :'recording_id' => :'String', + :'channels' => :'Integer', + :'start_time' => :'Time', + :'end_time' => :'Time', + :'duration' => :'String', + :'file_format' => :'FileFormatEnum', + :'media_url' => :'String', + :'tag' => :'String', + :'status' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'media_url', + :'tag', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceRecordingAvailableCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceRecordingAvailableCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'channels') + self.channels = attributes[:'channels'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'file_format') + self.file_format = attributes[:'file_format'] + end + + if attributes.key?(:'media_url') + self.media_url = attributes[:'media_url'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + conference_id == o.conference_id && + name == o.name && + account_id == o.account_id && + recording_id == o.recording_id && + channels == o.channels && + start_time == o.start_time && + end_time == o.end_time && + duration == o.duration && + file_format == o.file_format && + media_url == o.media_url && + tag == o.tag && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, conference_id, name, account_id, recording_id, channels, start_time, end_time, duration, file_format, media_url, tag, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/conference_recording_metadata.rb b/lib/bandwidth-sdk/models/conference_recording_metadata.rb new file mode 100644 index 00000000..b0be0494 --- /dev/null +++ b/lib/bandwidth-sdk/models/conference_recording_metadata.rb @@ -0,0 +1,320 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class ConferenceRecordingMetadata + # The user account associated with the call. + attr_accessor :account_id + + # The unique, Bandwidth-generated ID of the conference that was recorded + attr_accessor :conference_id + + # The user-specified name of the conference that was recorded + attr_accessor :name + + # The unique ID of this recording + attr_accessor :recording_id + + # The duration of the recording in ISO-8601 format + attr_accessor :duration + + # Always `1` for conference recordings; multi-channel recordings are not supported on conferences. + attr_accessor :channels + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # The time that the recording ended in ISO-8601 format + attr_accessor :end_time + + attr_accessor :file_format + + # 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. + attr_accessor :status + + # The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. + attr_accessor :media_url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account_id' => :'accountId', + :'conference_id' => :'conferenceId', + :'name' => :'name', + :'recording_id' => :'recordingId', + :'duration' => :'duration', + :'channels' => :'channels', + :'start_time' => :'startTime', + :'end_time' => :'endTime', + :'file_format' => :'fileFormat', + :'status' => :'status', + :'media_url' => :'mediaUrl' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'account_id' => :'String', + :'conference_id' => :'String', + :'name' => :'String', + :'recording_id' => :'String', + :'duration' => :'String', + :'channels' => :'Integer', + :'start_time' => :'Time', + :'end_time' => :'Time', + :'file_format' => :'FileFormatEnum', + :'status' => :'String', + :'media_url' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'media_url' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceRecordingMetadata` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceRecordingMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'channels') + self.channels = attributes[:'channels'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'file_format') + self.file_format = attributes[:'file_format'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'media_url') + self.media_url = attributes[:'media_url'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + conference_id == o.conference_id && + name == o.name && + recording_id == o.recording_id && + duration == o.duration && + channels == o.channels && + start_time == o.start_time && + end_time == o.end_time && + file_format == o.file_format && + status == o.status && + media_url == o.media_url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [account_id, conference_id, name, recording_id, duration, channels, start_time, end_time, file_format, status, media_url].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/conference_redirect_callback.rb b/lib/bandwidth-sdk/models/conference_redirect_callback.rb new file mode 100644 index 00000000..6d1acbe1 --- /dev/null +++ b/lib/bandwidth-sdk/models/conference_redirect_callback.rb @@ -0,0 +1,262 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Conference Redirect event is fired whenever an existing conference is modified via a POST request made to the /conferences/{conferenceId} endpoint. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. + class ConferenceRedirectCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The unique, Bandwidth-generated ID of the conference that was recorded + attr_accessor :conference_id + + # The user-specified name of the conference that was recorded + attr_accessor :name + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'conference_id' => :'conferenceId', + :'name' => :'name', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'conference_id' => :'String', + :'name' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceRedirectCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceRedirectCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + conference_id == o.conference_id && + name == o.name && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, conference_id, name, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/conference_state_enum.rb b/lib/bandwidth-sdk/models/conference_state_enum.rb new file mode 100644 index 00000000..3b72e062 --- /dev/null +++ b/lib/bandwidth-sdk/models/conference_state_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class ConferenceStateEnum + ACTIVE = "active".freeze + COMPLETED = "completed".freeze + + def self.all_vars + @all_vars ||= [ACTIVE, COMPLETED].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if ConferenceStateEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #ConferenceStateEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/create_call.rb b/lib/bandwidth-sdk/models/create_call.rb new file mode 100644 index 00000000..56fdc030 --- /dev/null +++ b/lib/bandwidth-sdk/models/create_call.rb @@ -0,0 +1,629 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CreateCall + # The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.com`)). + attr_accessor :to + + # 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`). + attr_accessor :from + + # 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. + attr_accessor :uui + + # The id of the application associated with the `from` number. + attr_accessor :application_id + + # 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` + attr_accessor :answer_url + + attr_accessor :answer_method + + # Basic auth username. + attr_accessor :username + + # Basic auth password. + attr_accessor :password + + # 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` + attr_accessor :answer_fallback_url + + attr_accessor :answer_fallback_method + + # Basic auth username. + attr_accessor :fallback_username + + # Basic auth password. + attr_accessor :fallback_password + + # The URL to send the Disconnect event to when the call ends. This event does not expect a BXML response. + attr_accessor :disconnect_url + + attr_accessor :disconnect_method + + # 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. + attr_accessor :call_timeout + + # 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. + attr_accessor :callback_timeout + + attr_accessor :machine_detection + + # 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. + attr_accessor :priority + + # 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. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'to' => :'to', + :'from' => :'from', + :'uui' => :'uui', + :'application_id' => :'applicationId', + :'answer_url' => :'answerUrl', + :'answer_method' => :'answerMethod', + :'username' => :'username', + :'password' => :'password', + :'answer_fallback_url' => :'answerFallbackUrl', + :'answer_fallback_method' => :'answerFallbackMethod', + :'fallback_username' => :'fallbackUsername', + :'fallback_password' => :'fallbackPassword', + :'disconnect_url' => :'disconnectUrl', + :'disconnect_method' => :'disconnectMethod', + :'call_timeout' => :'callTimeout', + :'callback_timeout' => :'callbackTimeout', + :'machine_detection' => :'machineDetection', + :'priority' => :'priority', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'to' => :'String', + :'from' => :'String', + :'uui' => :'String', + :'application_id' => :'String', + :'answer_url' => :'String', + :'answer_method' => :'CallbackMethodEnum', + :'username' => :'String', + :'password' => :'String', + :'answer_fallback_url' => :'String', + :'answer_fallback_method' => :'CallbackMethodEnum', + :'fallback_username' => :'String', + :'fallback_password' => :'String', + :'disconnect_url' => :'String', + :'disconnect_method' => :'CallbackMethodEnum', + :'call_timeout' => :'Float', + :'callback_timeout' => :'Float', + :'machine_detection' => :'MachineDetectionConfiguration', + :'priority' => :'Integer', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'uui', + :'answer_method', + :'username', + :'password', + :'answer_fallback_url', + :'answer_fallback_method', + :'fallback_username', + :'fallback_password', + :'disconnect_url', + :'disconnect_method', + :'call_timeout', + :'callback_timeout', + :'priority', + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateCall` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateCall`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'uui') + self.uui = attributes[:'uui'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'answer_url') + self.answer_url = attributes[:'answer_url'] + end + + if attributes.key?(:'answer_method') + self.answer_method = attributes[:'answer_method'] + else + self.answer_method = 'POST' + end + + if attributes.key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'answer_fallback_url') + self.answer_fallback_url = attributes[:'answer_fallback_url'] + end + + if attributes.key?(:'answer_fallback_method') + self.answer_fallback_method = attributes[:'answer_fallback_method'] + else + self.answer_fallback_method = 'POST' + end + + if attributes.key?(:'fallback_username') + self.fallback_username = attributes[:'fallback_username'] + end + + if attributes.key?(:'fallback_password') + self.fallback_password = attributes[:'fallback_password'] + end + + if attributes.key?(:'disconnect_url') + self.disconnect_url = attributes[:'disconnect_url'] + end + + if attributes.key?(:'disconnect_method') + self.disconnect_method = attributes[:'disconnect_method'] + else + self.disconnect_method = 'POST' + end + + if attributes.key?(:'call_timeout') + self.call_timeout = attributes[:'call_timeout'] + else + self.call_timeout = 30 + end + + if attributes.key?(:'callback_timeout') + self.callback_timeout = attributes[:'callback_timeout'] + else + self.callback_timeout = 15 + end + + if attributes.key?(:'machine_detection') + self.machine_detection = attributes[:'machine_detection'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + else + self.priority = 5 + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + if @from.nil? + invalid_properties.push('invalid value for "from", from cannot be nil.') + end + + if @application_id.nil? + invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') + end + + if @answer_url.nil? + invalid_properties.push('invalid value for "answer_url", answer_url cannot be nil.') + end + + if @answer_url.to_s.length > 2048 + invalid_properties.push('invalid value for "answer_url", the character length must be smaller than or equal to 2048.') + end + + if !@username.nil? && @username.to_s.length > 1024 + invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') + end + + if !@password.nil? && @password.to_s.length > 1024 + invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 1024.') + end + + if !@answer_fallback_url.nil? && @answer_fallback_url.to_s.length > 2048 + invalid_properties.push('invalid value for "answer_fallback_url", the character length must be smaller than or equal to 2048.') + end + + if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 + invalid_properties.push('invalid value for "fallback_username", the character length must be smaller than or equal to 1024.') + end + + if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 + invalid_properties.push('invalid value for "fallback_password", the character length must be smaller than or equal to 1024.') + end + + if !@disconnect_url.nil? && @disconnect_url.to_s.length > 2048 + invalid_properties.push('invalid value for "disconnect_url", the character length must be smaller than or equal to 2048.') + end + + if !@call_timeout.nil? && @call_timeout > 300 + invalid_properties.push('invalid value for "call_timeout", must be smaller than or equal to 300.') + end + + if !@call_timeout.nil? && @call_timeout < 1 + invalid_properties.push('invalid value for "call_timeout", must be greater than or equal to 1.') + end + + if !@callback_timeout.nil? && @callback_timeout > 25 + invalid_properties.push('invalid value for "callback_timeout", must be smaller than or equal to 25.') + end + + if !@callback_timeout.nil? && @callback_timeout < 1 + invalid_properties.push('invalid value for "callback_timeout", must be greater than or equal to 1.') + end + + if !@priority.nil? && @priority > 5 + invalid_properties.push('invalid value for "priority", must be smaller than or equal to 5.') + end + + if !@priority.nil? && @priority < 1 + invalid_properties.push('invalid value for "priority", must be greater than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @to.nil? + return false if @from.nil? + return false if @application_id.nil? + return false if @answer_url.nil? + return false if @answer_url.to_s.length > 2048 + return false if !@username.nil? && @username.to_s.length > 1024 + return false if !@password.nil? && @password.to_s.length > 1024 + return false if !@answer_fallback_url.nil? && @answer_fallback_url.to_s.length > 2048 + return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 + return false if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 + return false if !@disconnect_url.nil? && @disconnect_url.to_s.length > 2048 + return false if !@call_timeout.nil? && @call_timeout > 300 + return false if !@call_timeout.nil? && @call_timeout < 1 + return false if !@callback_timeout.nil? && @callback_timeout > 25 + return false if !@callback_timeout.nil? && @callback_timeout < 1 + return false if !@priority.nil? && @priority > 5 + return false if !@priority.nil? && @priority < 1 + true + end + + # Custom attribute writer method with validation + # @param [Object] answer_url Value to be assigned + def answer_url=(answer_url) + if answer_url.nil? + fail ArgumentError, 'answer_url cannot be nil' + end + + if answer_url.to_s.length > 2048 + fail ArgumentError, 'invalid value for "answer_url", the character length must be smaller than or equal to 2048.' + end + + @answer_url = answer_url + end + + # Custom attribute writer method with validation + # @param [Object] username Value to be assigned + def username=(username) + if !username.nil? && username.to_s.length > 1024 + fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 1024.' + end + + @username = username + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if !password.nil? && password.to_s.length > 1024 + fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 1024.' + end + + @password = password + end + + # Custom attribute writer method with validation + # @param [Object] answer_fallback_url Value to be assigned + def answer_fallback_url=(answer_fallback_url) + if !answer_fallback_url.nil? && answer_fallback_url.to_s.length > 2048 + fail ArgumentError, 'invalid value for "answer_fallback_url", the character length must be smaller than or equal to 2048.' + end + + @answer_fallback_url = answer_fallback_url + end + + # Custom attribute writer method with validation + # @param [Object] fallback_username Value to be assigned + def fallback_username=(fallback_username) + if !fallback_username.nil? && fallback_username.to_s.length > 1024 + fail ArgumentError, 'invalid value for "fallback_username", the character length must be smaller than or equal to 1024.' + end + + @fallback_username = fallback_username + end + + # Custom attribute writer method with validation + # @param [Object] fallback_password Value to be assigned + def fallback_password=(fallback_password) + if !fallback_password.nil? && fallback_password.to_s.length > 1024 + fail ArgumentError, 'invalid value for "fallback_password", the character length must be smaller than or equal to 1024.' + end + + @fallback_password = fallback_password + end + + # Custom attribute writer method with validation + # @param [Object] disconnect_url Value to be assigned + def disconnect_url=(disconnect_url) + if !disconnect_url.nil? && disconnect_url.to_s.length > 2048 + fail ArgumentError, 'invalid value for "disconnect_url", the character length must be smaller than or equal to 2048.' + end + + @disconnect_url = disconnect_url + end + + # Custom attribute writer method with validation + # @param [Object] call_timeout Value to be assigned + def call_timeout=(call_timeout) + if !call_timeout.nil? && call_timeout > 300 + fail ArgumentError, 'invalid value for "call_timeout", must be smaller than or equal to 300.' + end + + if !call_timeout.nil? && call_timeout < 1 + fail ArgumentError, 'invalid value for "call_timeout", must be greater than or equal to 1.' + end + + @call_timeout = call_timeout + end + + # Custom attribute writer method with validation + # @param [Object] callback_timeout Value to be assigned + def callback_timeout=(callback_timeout) + if !callback_timeout.nil? && callback_timeout > 25 + fail ArgumentError, 'invalid value for "callback_timeout", must be smaller than or equal to 25.' + end + + if !callback_timeout.nil? && callback_timeout < 1 + fail ArgumentError, 'invalid value for "callback_timeout", must be greater than or equal to 1.' + end + + @callback_timeout = callback_timeout + end + + # Custom attribute writer method with validation + # @param [Object] priority Value to be assigned + def priority=(priority) + if !priority.nil? && priority > 5 + fail ArgumentError, 'invalid value for "priority", must be smaller than or equal to 5.' + end + + if !priority.nil? && priority < 1 + fail ArgumentError, 'invalid value for "priority", must be greater than or equal to 1.' + end + + @priority = priority + end + + # Custom attribute writer method with validation + # @param [Object] tag Value to be assigned + def tag=(tag) + @tag = tag + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + to == o.to && + from == o.from && + uui == o.uui && + application_id == o.application_id && + answer_url == o.answer_url && + answer_method == o.answer_method && + username == o.username && + password == o.password && + answer_fallback_url == o.answer_fallback_url && + answer_fallback_method == o.answer_fallback_method && + fallback_username == o.fallback_username && + fallback_password == o.fallback_password && + disconnect_url == o.disconnect_url && + disconnect_method == o.disconnect_method && + call_timeout == o.call_timeout && + callback_timeout == o.callback_timeout && + machine_detection == o.machine_detection && + priority == o.priority && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [to, from, uui, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/create_call_response.rb b/lib/bandwidth-sdk/models/create_call_response.rb new file mode 100644 index 00000000..6cf41aac --- /dev/null +++ b/lib/bandwidth-sdk/models/create_call_response.rb @@ -0,0 +1,530 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CreateCallResponse + # The id of the application associated with the `from` number. + attr_accessor :application_id + + # The bandwidth account ID associated with the call + attr_accessor :account_id + + # Programmable Voice API Call ID + attr_accessor :call_id + + # Recipient of the outgoing call + attr_accessor :to + + # Phone number that created the outbound call + attr_accessor :from + + # Time the call was accepted into the queue + attr_accessor :enqueued_time + + # The URL to update call state + attr_accessor :call_url + + # The timeout (in seconds) for the callee to answer the call after it starts ringing. + attr_accessor :call_timeout + + # This is the timeout (in seconds) to use when delivering webhooks for the call. + attr_accessor :callback_timeout + + # Custom tag value + attr_accessor :tag + + attr_accessor :answer_method + + # URL to deliver the `answer` event webhook. + attr_accessor :answer_url + + attr_accessor :answer_fallback_method + + # Fallback URL to deliver the `answer` event webhook. + attr_accessor :answer_fallback_url + + attr_accessor :disconnect_method + + # URL to deliver the `disconnect` event webhook. + attr_accessor :disconnect_url + + # Basic auth username. + attr_accessor :username + + # Basic auth password. + attr_accessor :password + + # Basic auth username. + attr_accessor :fallback_username + + # Basic auth password. + attr_accessor :fallback_password + + # The priority of this call over other calls from your account. + attr_accessor :priority + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'application_id' => :'applicationId', + :'account_id' => :'accountId', + :'call_id' => :'callId', + :'to' => :'to', + :'from' => :'from', + :'enqueued_time' => :'enqueuedTime', + :'call_url' => :'callUrl', + :'call_timeout' => :'callTimeout', + :'callback_timeout' => :'callbackTimeout', + :'tag' => :'tag', + :'answer_method' => :'answerMethod', + :'answer_url' => :'answerUrl', + :'answer_fallback_method' => :'answerFallbackMethod', + :'answer_fallback_url' => :'answerFallbackUrl', + :'disconnect_method' => :'disconnectMethod', + :'disconnect_url' => :'disconnectUrl', + :'username' => :'username', + :'password' => :'password', + :'fallback_username' => :'fallbackUsername', + :'fallback_password' => :'fallbackPassword', + :'priority' => :'priority' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'application_id' => :'String', + :'account_id' => :'String', + :'call_id' => :'String', + :'to' => :'String', + :'from' => :'String', + :'enqueued_time' => :'Time', + :'call_url' => :'String', + :'call_timeout' => :'Float', + :'callback_timeout' => :'Float', + :'tag' => :'String', + :'answer_method' => :'CallbackMethodEnum', + :'answer_url' => :'String', + :'answer_fallback_method' => :'CallbackMethodEnum', + :'answer_fallback_url' => :'String', + :'disconnect_method' => :'CallbackMethodEnum', + :'disconnect_url' => :'String', + :'username' => :'String', + :'password' => :'String', + :'fallback_username' => :'String', + :'fallback_password' => :'String', + :'priority' => :'Float' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'tag', + :'answer_method', + :'answer_fallback_method', + :'answer_fallback_url', + :'disconnect_method', + :'disconnect_url', + :'username', + :'password', + :'fallback_username', + :'fallback_password', + :'priority' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateCallResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateCallResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'call_timeout') + self.call_timeout = attributes[:'call_timeout'] + end + + if attributes.key?(:'callback_timeout') + self.callback_timeout = attributes[:'callback_timeout'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'answer_method') + self.answer_method = attributes[:'answer_method'] + else + self.answer_method = 'POST' + end + + if attributes.key?(:'answer_url') + self.answer_url = attributes[:'answer_url'] + end + + if attributes.key?(:'answer_fallback_method') + self.answer_fallback_method = attributes[:'answer_fallback_method'] + else + self.answer_fallback_method = 'POST' + end + + if attributes.key?(:'answer_fallback_url') + self.answer_fallback_url = attributes[:'answer_fallback_url'] + end + + if attributes.key?(:'disconnect_method') + self.disconnect_method = attributes[:'disconnect_method'] + else + self.disconnect_method = 'POST' + end + + if attributes.key?(:'disconnect_url') + self.disconnect_url = attributes[:'disconnect_url'] + end + + if attributes.key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'fallback_username') + self.fallback_username = attributes[:'fallback_username'] + end + + if attributes.key?(:'fallback_password') + self.fallback_password = attributes[:'fallback_password'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @application_id.nil? + invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') + end + + if @account_id.nil? + invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') + end + + if @call_id.nil? + invalid_properties.push('invalid value for "call_id", call_id cannot be nil.') + end + + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + if @from.nil? + invalid_properties.push('invalid value for "from", from cannot be nil.') + end + + if @call_url.nil? + invalid_properties.push('invalid value for "call_url", call_url cannot be nil.') + end + + if @answer_url.nil? + invalid_properties.push('invalid value for "answer_url", answer_url cannot be nil.') + end + + if !@username.nil? && @username.to_s.length > 1024 + invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') + end + + if !@password.nil? && @password.to_s.length > 1024 + invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 1024.') + end + + if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 + invalid_properties.push('invalid value for "fallback_username", the character length must be smaller than or equal to 1024.') + end + + if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 + invalid_properties.push('invalid value for "fallback_password", the character length must be smaller than or equal to 1024.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @application_id.nil? + return false if @account_id.nil? + return false if @call_id.nil? + return false if @to.nil? + return false if @from.nil? + return false if @call_url.nil? + return false if @answer_url.nil? + return false if !@username.nil? && @username.to_s.length > 1024 + return false if !@password.nil? && @password.to_s.length > 1024 + return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 + return false if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 + true + end + + # Custom attribute writer method with validation + # @param [Object] username Value to be assigned + def username=(username) + if !username.nil? && username.to_s.length > 1024 + fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 1024.' + end + + @username = username + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if !password.nil? && password.to_s.length > 1024 + fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 1024.' + end + + @password = password + end + + # Custom attribute writer method with validation + # @param [Object] fallback_username Value to be assigned + def fallback_username=(fallback_username) + if !fallback_username.nil? && fallback_username.to_s.length > 1024 + fail ArgumentError, 'invalid value for "fallback_username", the character length must be smaller than or equal to 1024.' + end + + @fallback_username = fallback_username + end + + # Custom attribute writer method with validation + # @param [Object] fallback_password Value to be assigned + def fallback_password=(fallback_password) + if !fallback_password.nil? && fallback_password.to_s.length > 1024 + fail ArgumentError, 'invalid value for "fallback_password", the character length must be smaller than or equal to 1024.' + end + + @fallback_password = fallback_password + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + application_id == o.application_id && + account_id == o.account_id && + call_id == o.call_id && + to == o.to && + from == o.from && + enqueued_time == o.enqueued_time && + call_url == o.call_url && + call_timeout == o.call_timeout && + callback_timeout == o.callback_timeout && + tag == o.tag && + answer_method == o.answer_method && + answer_url == o.answer_url && + answer_fallback_method == o.answer_fallback_method && + answer_fallback_url == o.answer_fallback_url && + disconnect_method == o.disconnect_method && + disconnect_url == o.disconnect_url && + username == o.username && + password == o.password && + fallback_username == o.fallback_username && + fallback_password == o.fallback_password && + priority == o.priority + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [application_id, account_id, call_id, to, from, enqueued_time, call_url, call_timeout, callback_timeout, tag, answer_method, answer_url, answer_fallback_method, answer_fallback_url, disconnect_method, disconnect_url, username, password, fallback_username, fallback_password, priority].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/create_lookup_response.rb b/lib/bandwidth-sdk/models/create_lookup_response.rb new file mode 100644 index 00000000..48d5c2b0 --- /dev/null +++ b/lib/bandwidth-sdk/models/create_lookup_response.rb @@ -0,0 +1,230 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The request has been accepted for processing but not yet finished and in a terminal state (COMPLETE, PARTIAL_COMPLETE, or FAILED). + class CreateLookupResponse + # The phone number lookup request ID from Bandwidth. + attr_accessor :request_id + + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_id' => :'requestId', + :'status' => :'status' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_id' => :'String', + :'status' => :'LookupStatusEnum' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateLookupResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateLookupResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'request_id') + self.request_id = attributes[:'request_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_id == o.request_id && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_id, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/create_message_request_error.rb b/lib/bandwidth-sdk/models/create_message_request_error.rb new file mode 100644 index 00000000..06128560 --- /dev/null +++ b/lib/bandwidth-sdk/models/create_message_request_error.rb @@ -0,0 +1,249 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CreateMessageRequestError + attr_accessor :type + + attr_accessor :description + + attr_accessor :field_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'description' => :'description', + :'field_errors' => :'fieldErrors' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'description' => :'String', + :'field_errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateMessageRequestError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateMessageRequestError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'field_errors') + if (value = attributes[:'field_errors']).is_a?(Array) + self.field_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @description.nil? + invalid_properties.push('invalid value for "description", description cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @description.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + description == o.description && + field_errors == o.field_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, description, field_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/create_participant_request.rb b/lib/bandwidth-sdk/models/create_participant_request.rb new file mode 100644 index 00000000..5a606820 --- /dev/null +++ b/lib/bandwidth-sdk/models/create_participant_request.rb @@ -0,0 +1,261 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # Create a participant request. + class CreateParticipantRequest + # Full callback url to use for notifications about this participant. + attr_accessor :callback_url + + # Defines if this participant can publish audio or video. + attr_accessor :publish_permissions + + # User defined tag to associate with the participant. + attr_accessor :tag + + attr_accessor :device_api_version + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'callback_url' => :'callbackUrl', + :'publish_permissions' => :'publishPermissions', + :'tag' => :'tag', + :'device_api_version' => :'deviceApiVersion' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'callback_url' => :'String', + :'publish_permissions' => :'Array', + :'tag' => :'String', + :'device_api_version' => :'DeviceApiVersionEnum' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'callback_url', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateParticipantRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateParticipantRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'callback_url') + self.callback_url = attributes[:'callback_url'] + end + + if attributes.key?(:'publish_permissions') + if (value = attributes[:'publish_permissions']).is_a?(Array) + self.publish_permissions = value + end + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'device_api_version') + self.device_api_version = attributes[:'device_api_version'] + else + self.device_api_version = 'V3' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Custom attribute writer method with validation + # @param [Object] publish_permissions Value to be assigned + def publish_permissions=(publish_permissions) + @publish_permissions = publish_permissions + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + callback_url == o.callback_url && + publish_permissions == o.publish_permissions && + tag == o.tag && + device_api_version == o.device_api_version + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [callback_url, publish_permissions, tag, device_api_version].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/create_participant_response.rb b/lib/bandwidth-sdk/models/create_participant_response.rb new file mode 100644 index 00000000..1042f6ae --- /dev/null +++ b/lib/bandwidth-sdk/models/create_participant_response.rb @@ -0,0 +1,230 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # Response generated when a Participant is created. + class CreateParticipantResponse + attr_accessor :participant + + # Auth token for the returned participant. This should be passed to the participant so that they can connect to the platform. + attr_accessor :token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'participant' => :'participant', + :'token' => :'token' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'participant' => :'Participant', + :'token' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateParticipantResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateParticipantResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'participant') + self.participant = attributes[:'participant'] + end + + if attributes.key?(:'token') + self.token = attributes[:'token'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + participant == o.participant && + token == o.token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [participant, token].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/deferred_result.rb b/lib/bandwidth-sdk/models/deferred_result.rb new file mode 100644 index 00000000..d15fb796 --- /dev/null +++ b/lib/bandwidth-sdk/models/deferred_result.rb @@ -0,0 +1,228 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class DeferredResult + attr_accessor :result + + attr_accessor :set_or_expired + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'result' => :'result', + :'set_or_expired' => :'setOrExpired' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'result' => :'Object', + :'set_or_expired' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::DeferredResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DeferredResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'result') + self.result = attributes[:'result'] + end + + if attributes.key?(:'set_or_expired') + self.set_or_expired = attributes[:'set_or_expired'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + result == o.result && + set_or_expired == o.set_or_expired + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [result, set_or_expired].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/device_api_version_enum.rb b/lib/bandwidth-sdk/models/device_api_version_enum.rb new file mode 100644 index 00000000..3cce20a3 --- /dev/null +++ b/lib/bandwidth-sdk/models/device_api_version_enum.rb @@ -0,0 +1,39 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class DeviceApiVersionEnum + V3 = "V3".freeze + + def self.all_vars + @all_vars ||= [V3].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if DeviceApiVersionEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #DeviceApiVersionEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/disconenct_callback.rb b/lib/bandwidth-sdk/models/disconenct_callback.rb new file mode 100644 index 00000000..bcf6bf3f --- /dev/null +++ b/lib/bandwidth-sdk/models/disconenct_callback.rb @@ -0,0 +1,385 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Disconnect event is fired when a call ends, for any reason. + class DisconenctCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + # The call id associated with the event. + attr_accessor :call_id + + attr_accessor :direction + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # The time that the recording ended in ISO-8601 format + attr_accessor :end_time + + # Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. + attr_accessor :cause + + # Text explaining the reason that caused the call to fail in case of errors. + attr_accessor :error_message + + # Bandwidth's internal id that references the error event. + attr_accessor :error_id + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'call_id' => :'callId', + :'direction' => :'direction', + :'call_url' => :'callUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'end_time' => :'endTime', + :'cause' => :'cause', + :'error_message' => :'errorMessage', + :'error_id' => :'errorId', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_id' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'end_time' => :'Time', + :'cause' => :'String', + :'error_message' => :'String', + :'error_id' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'error_message', + :'error_id', + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::DisconenctCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DisconenctCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'cause') + self.cause = attributes[:'cause'] + end + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'error_id') + self.error_id = attributes[:'error_id'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + call_id == o.call_id && + direction == o.direction && + call_url == o.call_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + end_time == o.end_time && + cause == o.cause && + error_message == o.error_message && + error_id == o.error_id && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, call_id, direction, call_url, enqueued_time, start_time, answer_time, end_time, cause, error_message, error_id, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/diversion.rb b/lib/bandwidth-sdk/models/diversion.rb new file mode 100644 index 00000000..134746c3 --- /dev/null +++ b/lib/bandwidth-sdk/models/diversion.rb @@ -0,0 +1,280 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class Diversion + # The reason for the diversion. Common values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away. + attr_accessor :reason + + # off or full + attr_accessor :privacy + + # No if the number was provided by the user, yes if the number was provided by the network + attr_accessor :screen + + # The number of diversions that have occurred + attr_accessor :counter + + # The maximum number of diversions allowed for this session + attr_accessor :limit + + # The normal list of values is not exhaustive. Your application must be tolerant of unlisted keys and unlisted values of those keys. + attr_accessor :unknown + + # Always present. Indicates the last telephone number that the call was diverted from. + attr_accessor :orig_to + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'reason' => :'reason', + :'privacy' => :'privacy', + :'screen' => :'screen', + :'counter' => :'counter', + :'limit' => :'limit', + :'unknown' => :'unknown', + :'orig_to' => :'origTo' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'reason' => :'String', + :'privacy' => :'String', + :'screen' => :'String', + :'counter' => :'String', + :'limit' => :'String', + :'unknown' => :'String', + :'orig_to' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Diversion` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Diversion`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'reason') + self.reason = attributes[:'reason'] + end + + if attributes.key?(:'privacy') + self.privacy = attributes[:'privacy'] + end + + if attributes.key?(:'screen') + self.screen = attributes[:'screen'] + end + + if attributes.key?(:'counter') + self.counter = attributes[:'counter'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'unknown') + self.unknown = attributes[:'unknown'] + end + + if attributes.key?(:'orig_to') + self.orig_to = attributes[:'orig_to'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reason == o.reason && + privacy == o.privacy && + screen == o.screen && + counter == o.counter && + limit == o.limit && + unknown == o.unknown && + orig_to == o.orig_to + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [reason, privacy, screen, counter, limit, unknown, orig_to].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/dtmf_callback.rb b/lib/bandwidth-sdk/models/dtmf_callback.rb new file mode 100644 index 00000000..583c0286 --- /dev/null +++ b/lib/bandwidth-sdk/models/dtmf_callback.rb @@ -0,0 +1,383 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The DTMF event is sent for every digit detected after a verb is executed. You may not respond to this event with BXML. + class DtmfCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + # The call id associated with the event. + attr_accessor :call_id + + attr_accessor :direction + + # The digit collected in the call. + attr_accessor :digit + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # (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. + attr_accessor :parent_call_id + + # 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. + attr_accessor :transfer_caller_id + + # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). + attr_accessor :transfer_to + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'call_id' => :'callId', + :'direction' => :'direction', + :'digit' => :'digit', + :'call_url' => :'callUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'parent_call_id' => :'parentCallId', + :'transfer_caller_id' => :'transferCallerId', + :'transfer_to' => :'transferTo', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_id' => :'String', + :'direction' => :'CallDirectionEnum', + :'digit' => :'String', + :'call_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'parent_call_id' => :'String', + :'transfer_caller_id' => :'String', + :'transfer_to' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::DtmfCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DtmfCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'digit') + self.digit = attributes[:'digit'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + + if attributes.key?(:'transfer_caller_id') + self.transfer_caller_id = attributes[:'transfer_caller_id'] + end + + if attributes.key?(:'transfer_to') + self.transfer_to = attributes[:'transfer_to'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + call_id == o.call_id && + direction == o.direction && + digit == o.digit && + call_url == o.call_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + parent_call_id == o.parent_call_id && + transfer_caller_id == o.transfer_caller_id && + transfer_to == o.transfer_to && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, call_id, direction, digit, call_url, enqueued_time, start_time, answer_time, parent_call_id, transfer_caller_id, transfer_to, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/field_error.rb b/lib/bandwidth-sdk/models/field_error.rb new file mode 100644 index 00000000..6b26d374 --- /dev/null +++ b/lib/bandwidth-sdk/models/field_error.rb @@ -0,0 +1,230 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class FieldError + # The name of the field that contains the error + attr_accessor :field_name + + # The error associated with the field + attr_accessor :description + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'field_name' => :'fieldName', + :'description' => :'description' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'field_name' => :'String', + :'description' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::FieldError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::FieldError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'field_name') + self.field_name = attributes[:'field_name'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + field_name == o.field_name && + description == o.description + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [field_name, description].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/file_format_enum.rb b/lib/bandwidth-sdk/models/file_format_enum.rb new file mode 100644 index 00000000..81337dfb --- /dev/null +++ b/lib/bandwidth-sdk/models/file_format_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class FileFormatEnum + MP3 = "mp3".freeze + WAV = "wav".freeze + + def self.all_vars + @all_vars ||= [MP3, WAV].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if FileFormatEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #FileFormatEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/forbidden_request.rb b/lib/bandwidth-sdk/models/forbidden_request.rb new file mode 100644 index 00000000..84cdb631 --- /dev/null +++ b/lib/bandwidth-sdk/models/forbidden_request.rb @@ -0,0 +1,220 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class ForbiddenRequest + # The message containing the reason behind the request being forbidden. + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ForbiddenRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ForbiddenRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/gather_callback.rb b/lib/bandwidth-sdk/models/gather_callback.rb new file mode 100644 index 00000000..4ef625d8 --- /dev/null +++ b/lib/bandwidth-sdk/models/gather_callback.rb @@ -0,0 +1,393 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The gather event is sent after a verb is executed. Its purpose is to report the gathered digits to the calling application. + class GatherCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # (optional) The digits, letters, and/or symbols entered by the user. The string is empty if a timeout occurred before any buttons were pressed. + attr_accessor :digits + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # (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. + attr_accessor :parent_call_id + + # (optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed. + attr_accessor :terminating_digit + + # 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. + attr_accessor :transfer_caller_id + + # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). + attr_accessor :transfer_to + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'digits' => :'digits', + :'call_url' => :'callUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'parent_call_id' => :'parentCallId', + :'terminating_digit' => :'terminatingDigit', + :'transfer_caller_id' => :'transferCallerId', + :'transfer_to' => :'transferTo', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'digits' => :'String', + :'call_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'parent_call_id' => :'String', + :'terminating_digit' => :'String', + :'transfer_caller_id' => :'String', + :'transfer_to' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::GatherCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::GatherCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'digits') + self.digits = attributes[:'digits'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + + if attributes.key?(:'terminating_digit') + self.terminating_digit = attributes[:'terminating_digit'] + end + + if attributes.key?(:'transfer_caller_id') + self.transfer_caller_id = attributes[:'transfer_caller_id'] + end + + if attributes.key?(:'transfer_to') + self.transfer_to = attributes[:'transfer_to'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + digits == o.digits && + call_url == o.call_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + parent_call_id == o.parent_call_id && + terminating_digit == o.terminating_digit && + transfer_caller_id == o.transfer_caller_id && + transfer_to == o.transfer_to && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, digits, call_url, enqueued_time, start_time, answer_time, parent_call_id, terminating_digit, transfer_caller_id, transfer_to, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/initiate_callback.rb b/lib/bandwidth-sdk/models/initiate_callback.rb new file mode 100644 index 00000000..12cfaeb4 --- /dev/null +++ b/lib/bandwidth-sdk/models/initiate_callback.rb @@ -0,0 +1,328 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Initiate event is fired when an inbound call is received for a Telephone Number on your Account. It is sent to the URL specified in the application associated with the location (sip-peer) that the called telephone number belongs to. + class InitiateCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + attr_accessor :diversion + + attr_accessor :stir_shaken + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'start_time' => :'startTime', + :'diversion' => :'diversion', + :'stir_shaken' => :'stirShaken' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'start_time' => :'Time', + :'diversion' => :'Diversion', + :'stir_shaken' => :'StirShaken' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::InitiateCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::InitiateCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'diversion') + self.diversion = attributes[:'diversion'] + end + + if attributes.key?(:'stir_shaken') + self.stir_shaken = attributes[:'stir_shaken'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + start_time == o.start_time && + diversion == o.diversion && + stir_shaken == o.stir_shaken + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, start_time, diversion, stir_shaken].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/list_message_direction_enum.rb b/lib/bandwidth-sdk/models/list_message_direction_enum.rb new file mode 100644 index 00000000..92bd3a71 --- /dev/null +++ b/lib/bandwidth-sdk/models/list_message_direction_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class ListMessageDirectionEnum + INBOUND = "INBOUND".freeze + OUTBOUND = "OUTBOUND".freeze + + def self.all_vars + @all_vars ||= [INBOUND, OUTBOUND].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if ListMessageDirectionEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #ListMessageDirectionEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/list_message_item.rb b/lib/bandwidth-sdk/models/list_message_item.rb new file mode 100644 index 00000000..583a517e --- /dev/null +++ b/lib/bandwidth-sdk/models/list_message_item.rb @@ -0,0 +1,372 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class ListMessageItem + # The message id + attr_accessor :message_id + + # The account id associated with this message. + attr_accessor :account_id + + # The source phone number of the message. + attr_accessor :source_tn + + # The recipient phone number of the message. + attr_accessor :destination_tn + + attr_accessor :message_status + + attr_accessor :message_direction + + attr_accessor :message_type + + # The number of segments the message was sent as. + attr_accessor :segment_count + + # The numeric error code of the message. + attr_accessor :error_code + + # The ISO 8601 datetime of the message. + attr_accessor :receive_time + + # The name of the carrier. Not currently supported for MMS coming soon. + attr_accessor :carrier_name + + # The size of the message including message content and headers. + attr_accessor :message_size + + # The length of the message content. + attr_accessor :message_length + + # The number of attachments the message has. + attr_accessor :attachment_count + + # The number of recipients the message has. + attr_accessor :recipient_count + + # The campaign class of the message if it has one. + attr_accessor :campaign_class + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message_id' => :'messageId', + :'account_id' => :'accountId', + :'source_tn' => :'sourceTn', + :'destination_tn' => :'destinationTn', + :'message_status' => :'messageStatus', + :'message_direction' => :'messageDirection', + :'message_type' => :'messageType', + :'segment_count' => :'segmentCount', + :'error_code' => :'errorCode', + :'receive_time' => :'receiveTime', + :'carrier_name' => :'carrierName', + :'message_size' => :'messageSize', + :'message_length' => :'messageLength', + :'attachment_count' => :'attachmentCount', + :'recipient_count' => :'recipientCount', + :'campaign_class' => :'campaignClass' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'message_id' => :'String', + :'account_id' => :'String', + :'source_tn' => :'String', + :'destination_tn' => :'String', + :'message_status' => :'MessageStatusEnum', + :'message_direction' => :'ListMessageDirectionEnum', + :'message_type' => :'MessageTypeEnum', + :'segment_count' => :'Integer', + :'error_code' => :'Integer', + :'receive_time' => :'String', + :'carrier_name' => :'String', + :'message_size' => :'Integer', + :'message_length' => :'Integer', + :'attachment_count' => :'Integer', + :'recipient_count' => :'Integer', + :'campaign_class' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'carrier_name', + :'message_size', + :'attachment_count', + :'recipient_count', + :'campaign_class' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ListMessageItem` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ListMessageItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message_id') + self.message_id = attributes[:'message_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'source_tn') + self.source_tn = attributes[:'source_tn'] + end + + if attributes.key?(:'destination_tn') + self.destination_tn = attributes[:'destination_tn'] + end + + if attributes.key?(:'message_status') + self.message_status = attributes[:'message_status'] + end + + if attributes.key?(:'message_direction') + self.message_direction = attributes[:'message_direction'] + end + + if attributes.key?(:'message_type') + self.message_type = attributes[:'message_type'] + end + + if attributes.key?(:'segment_count') + self.segment_count = attributes[:'segment_count'] + end + + if attributes.key?(:'error_code') + self.error_code = attributes[:'error_code'] + end + + if attributes.key?(:'receive_time') + self.receive_time = attributes[:'receive_time'] + end + + if attributes.key?(:'carrier_name') + self.carrier_name = attributes[:'carrier_name'] + end + + if attributes.key?(:'message_size') + self.message_size = attributes[:'message_size'] + end + + if attributes.key?(:'message_length') + self.message_length = attributes[:'message_length'] + end + + if attributes.key?(:'attachment_count') + self.attachment_count = attributes[:'attachment_count'] + end + + if attributes.key?(:'recipient_count') + self.recipient_count = attributes[:'recipient_count'] + end + + if attributes.key?(:'campaign_class') + self.campaign_class = attributes[:'campaign_class'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message_id == o.message_id && + account_id == o.account_id && + source_tn == o.source_tn && + destination_tn == o.destination_tn && + message_status == o.message_status && + message_direction == o.message_direction && + message_type == o.message_type && + segment_count == o.segment_count && + error_code == o.error_code && + receive_time == o.receive_time && + carrier_name == o.carrier_name && + message_size == o.message_size && + message_length == o.message_length && + attachment_count == o.attachment_count && + recipient_count == o.recipient_count && + campaign_class == o.campaign_class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message_id, account_id, source_tn, destination_tn, message_status, message_direction, message_type, segment_count, error_code, receive_time, carrier_name, message_size, message_length, attachment_count, recipient_count, campaign_class].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/lookup_request.rb b/lib/bandwidth-sdk/models/lookup_request.rb new file mode 100644 index 00000000..afdf42c8 --- /dev/null +++ b/lib/bandwidth-sdk/models/lookup_request.rb @@ -0,0 +1,227 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # Create phone number lookup request. + class LookupRequest + attr_accessor :tns + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tns' => :'tns' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'tns' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::LookupRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::LookupRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tns') + if (value = attributes[:'tns']).is_a?(Array) + self.tns = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @tns.nil? + invalid_properties.push('invalid value for "tns", tns cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @tns.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tns == o.tns + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tns].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/lookup_result.rb b/lib/bandwidth-sdk/models/lookup_result.rb new file mode 100644 index 00000000..19049309 --- /dev/null +++ b/lib/bandwidth-sdk/models/lookup_result.rb @@ -0,0 +1,301 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # Carrier information results for the specified telephone number. + class LookupResult + # Our vendor's response code. + attr_accessor :response_code + + # Message associated with the response code. + attr_accessor :message + + # The telephone number in E.164 format. + attr_accessor :e_164_format + + # The formatted version of the telephone number. + attr_accessor :formatted + + # The country of the telephone number. + attr_accessor :country + + # The line type of the telephone number. + attr_accessor :line_type + + # The messaging service provider of the telephone number. + attr_accessor :line_provider + + # The first half of the Home Network Identity (HNI). + attr_accessor :mobile_country_code + + # The second half of the HNI. + attr_accessor :mobile_network_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'response_code' => :'Response Code', + :'message' => :'Message', + :'e_164_format' => :'E.164 Format', + :'formatted' => :'Formatted', + :'country' => :'Country', + :'line_type' => :'Line Type', + :'line_provider' => :'Line Provider', + :'mobile_country_code' => :'Mobile Country Code', + :'mobile_network_code' => :'Mobile Network Code' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'response_code' => :'Integer', + :'message' => :'String', + :'e_164_format' => :'String', + :'formatted' => :'String', + :'country' => :'String', + :'line_type' => :'String', + :'line_provider' => :'String', + :'mobile_country_code' => :'String', + :'mobile_network_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::LookupResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::LookupResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'response_code') + self.response_code = attributes[:'response_code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'e_164_format') + self.e_164_format = attributes[:'e_164_format'] + end + + if attributes.key?(:'formatted') + self.formatted = attributes[:'formatted'] + end + + if attributes.key?(:'country') + self.country = attributes[:'country'] + end + + if attributes.key?(:'line_type') + self.line_type = attributes[:'line_type'] + end + + if attributes.key?(:'line_provider') + self.line_provider = attributes[:'line_provider'] + end + + if attributes.key?(:'mobile_country_code') + self.mobile_country_code = attributes[:'mobile_country_code'] + end + + if attributes.key?(:'mobile_network_code') + self.mobile_network_code = attributes[:'mobile_network_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + response_code == o.response_code && + message == o.message && + e_164_format == o.e_164_format && + formatted == o.formatted && + country == o.country && + line_type == o.line_type && + line_provider == o.line_provider && + mobile_country_code == o.mobile_country_code && + mobile_network_code == o.mobile_network_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [response_code, message, e_164_format, formatted, country, line_type, line_provider, mobile_country_code, mobile_network_code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/lookup_status.rb b/lib/bandwidth-sdk/models/lookup_status.rb new file mode 100644 index 00000000..136624c9 --- /dev/null +++ b/lib/bandwidth-sdk/models/lookup_status.rb @@ -0,0 +1,254 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # If requestId exists, the result for that request is returned. See the Examples for details on the various responses that you can receive. Generally, if you see a Response Code of 0 in a result for a TN, information will be available for it. Any other Response Code will indicate no information was available for the TN. + class LookupStatus + # The requestId. + attr_accessor :request_id + + attr_accessor :status + + # The carrier information results for the specified telephone number. + attr_accessor :result + + # The telephone numbers whose lookup failed. + attr_accessor :failed_telephone_numbers + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_id' => :'requestId', + :'status' => :'status', + :'result' => :'result', + :'failed_telephone_numbers' => :'failedTelephoneNumbers' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_id' => :'String', + :'status' => :'LookupStatusEnum', + :'result' => :'Array', + :'failed_telephone_numbers' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::LookupStatus` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::LookupStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'request_id') + self.request_id = attributes[:'request_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'result') + if (value = attributes[:'result']).is_a?(Array) + self.result = value + end + end + + if attributes.key?(:'failed_telephone_numbers') + if (value = attributes[:'failed_telephone_numbers']).is_a?(Array) + self.failed_telephone_numbers = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_id == o.request_id && + status == o.status && + result == o.result && + failed_telephone_numbers == o.failed_telephone_numbers + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_id, status, result, failed_telephone_numbers].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/lookup_status_enum.rb b/lib/bandwidth-sdk/models/lookup_status_enum.rb new file mode 100644 index 00000000..0f0f8eec --- /dev/null +++ b/lib/bandwidth-sdk/models/lookup_status_enum.rb @@ -0,0 +1,42 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class LookupStatusEnum + IN_PROGRESS = "IN_PROGRESS".freeze + COMPLETE = "COMPLETE".freeze + PARTIAL_COMPLETE = "PARTIAL_COMPLETE".freeze + FAILED = "FAILED".freeze + + def self.all_vars + @all_vars ||= [IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, FAILED].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if LookupStatusEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #LookupStatusEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb new file mode 100644 index 00000000..b010a543 --- /dev/null +++ b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb @@ -0,0 +1,354 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # This event is sent to the url informed when requesting a machine detection operation. It contains the machine detection operation result, which can be: human, answering-machine, silence, timeout, error. This event is not sent when sync answering machine detection mode is chosen. + class MachineDetectionCompleteCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete + attr_accessor :machine_detection_result + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'tag' => :'tag', + :'machine_detection_result' => :'machineDetectionResult' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'tag' => :'String', + :'machine_detection_result' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'tag', + :'machine_detection_result' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MachineDetectionCompleteCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MachineDetectionCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'machine_detection_result') + self.machine_detection_result = attributes[:'machine_detection_result'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + tag == o.tag && + machine_detection_result == o.machine_detection_result + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, enqueued_time, start_time, answer_time, tag, machine_detection_result].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/machine_detection_configuration.rb b/lib/bandwidth-sdk/models/machine_detection_configuration.rb new file mode 100644 index 00000000..18d3734f --- /dev/null +++ b/lib/bandwidth-sdk/models/machine_detection_configuration.rb @@ -0,0 +1,478 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The machine detection request used to perform machine detection on the call. + class MachineDetectionConfiguration + attr_accessor :mode + + # 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. + attr_accessor :detection_timeout + + # If no speech is detected in this period, a callback with a 'silence' result is sent. + attr_accessor :silence_timeout + + # 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'. + attr_accessor :speech_threshold + + # Amount of silence (in seconds) before assuming the callee has finished speaking. + attr_accessor :speech_end_threshold + + # 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. + attr_accessor :machine_speech_end_threshold + + # 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. + attr_accessor :delay_result + + # The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode. + attr_accessor :callback_url + + attr_accessor :callback_method + + # Basic auth username. + attr_accessor :username + + # Basic auth password. + attr_accessor :password + + # A fallback URL which, if provided, will be used to retry the machine detection complete webhook delivery in case `callbackUrl` fails to respond + attr_accessor :fallback_url + + attr_accessor :fallback_method + + # Basic auth username. + attr_accessor :fallback_username + + # Basic auth password. + attr_accessor :fallback_password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'mode' => :'mode', + :'detection_timeout' => :'detectionTimeout', + :'silence_timeout' => :'silenceTimeout', + :'speech_threshold' => :'speechThreshold', + :'speech_end_threshold' => :'speechEndThreshold', + :'machine_speech_end_threshold' => :'machineSpeechEndThreshold', + :'delay_result' => :'delayResult', + :'callback_url' => :'callbackUrl', + :'callback_method' => :'callbackMethod', + :'username' => :'username', + :'password' => :'password', + :'fallback_url' => :'fallbackUrl', + :'fallback_method' => :'fallbackMethod', + :'fallback_username' => :'fallbackUsername', + :'fallback_password' => :'fallbackPassword' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'mode' => :'MachineDetectionModeEnum', + :'detection_timeout' => :'Float', + :'silence_timeout' => :'Float', + :'speech_threshold' => :'Float', + :'speech_end_threshold' => :'Float', + :'machine_speech_end_threshold' => :'Float', + :'delay_result' => :'Boolean', + :'callback_url' => :'String', + :'callback_method' => :'CallbackMethodEnum', + :'username' => :'String', + :'password' => :'String', + :'fallback_url' => :'String', + :'fallback_method' => :'CallbackMethodEnum', + :'fallback_username' => :'String', + :'fallback_password' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'detection_timeout', + :'silence_timeout', + :'speech_threshold', + :'speech_end_threshold', + :'machine_speech_end_threshold', + :'delay_result', + :'callback_url', + :'callback_method', + :'username', + :'password', + :'fallback_url', + :'fallback_method', + :'fallback_username', + :'fallback_password' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MachineDetectionConfiguration` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MachineDetectionConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + else + self.mode = 'async' + end + + if attributes.key?(:'detection_timeout') + self.detection_timeout = attributes[:'detection_timeout'] + else + self.detection_timeout = 15 + end + + if attributes.key?(:'silence_timeout') + self.silence_timeout = attributes[:'silence_timeout'] + else + self.silence_timeout = 10 + end + + if attributes.key?(:'speech_threshold') + self.speech_threshold = attributes[:'speech_threshold'] + else + self.speech_threshold = 10 + end + + if attributes.key?(:'speech_end_threshold') + self.speech_end_threshold = attributes[:'speech_end_threshold'] + else + self.speech_end_threshold = 5 + end + + if attributes.key?(:'machine_speech_end_threshold') + self.machine_speech_end_threshold = attributes[:'machine_speech_end_threshold'] + end + + if attributes.key?(:'delay_result') + self.delay_result = attributes[:'delay_result'] + else + self.delay_result = false + end + + if attributes.key?(:'callback_url') + self.callback_url = attributes[:'callback_url'] + end + + if attributes.key?(:'callback_method') + self.callback_method = attributes[:'callback_method'] + else + self.callback_method = 'POST' + end + + if attributes.key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'fallback_url') + self.fallback_url = attributes[:'fallback_url'] + end + + if attributes.key?(:'fallback_method') + self.fallback_method = attributes[:'fallback_method'] + else + self.fallback_method = 'POST' + end + + if attributes.key?(:'fallback_username') + self.fallback_username = attributes[:'fallback_username'] + end + + if attributes.key?(:'fallback_password') + self.fallback_password = attributes[:'fallback_password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@callback_url.nil? && @callback_url.to_s.length > 2048 + invalid_properties.push('invalid value for "callback_url", the character length must be smaller than or equal to 2048.') + end + + if !@username.nil? && @username.to_s.length > 1024 + invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') + end + + if !@password.nil? && @password.to_s.length > 1024 + invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 1024.') + end + + if !@fallback_url.nil? && @fallback_url.to_s.length > 2048 + invalid_properties.push('invalid value for "fallback_url", the character length must be smaller than or equal to 2048.') + end + + if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 + invalid_properties.push('invalid value for "fallback_username", the character length must be smaller than or equal to 1024.') + end + + if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 + invalid_properties.push('invalid value for "fallback_password", the character length must be smaller than or equal to 1024.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@callback_url.nil? && @callback_url.to_s.length > 2048 + return false if !@username.nil? && @username.to_s.length > 1024 + return false if !@password.nil? && @password.to_s.length > 1024 + return false if !@fallback_url.nil? && @fallback_url.to_s.length > 2048 + return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 + return false if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 + true + end + + # Custom attribute writer method with validation + # @param [Object] callback_url Value to be assigned + def callback_url=(callback_url) + if !callback_url.nil? && callback_url.to_s.length > 2048 + fail ArgumentError, 'invalid value for "callback_url", the character length must be smaller than or equal to 2048.' + end + + @callback_url = callback_url + end + + # Custom attribute writer method with validation + # @param [Object] username Value to be assigned + def username=(username) + if !username.nil? && username.to_s.length > 1024 + fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 1024.' + end + + @username = username + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if !password.nil? && password.to_s.length > 1024 + fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 1024.' + end + + @password = password + end + + # Custom attribute writer method with validation + # @param [Object] fallback_url Value to be assigned + def fallback_url=(fallback_url) + if !fallback_url.nil? && fallback_url.to_s.length > 2048 + fail ArgumentError, 'invalid value for "fallback_url", the character length must be smaller than or equal to 2048.' + end + + @fallback_url = fallback_url + end + + # Custom attribute writer method with validation + # @param [Object] fallback_username Value to be assigned + def fallback_username=(fallback_username) + if !fallback_username.nil? && fallback_username.to_s.length > 1024 + fail ArgumentError, 'invalid value for "fallback_username", the character length must be smaller than or equal to 1024.' + end + + @fallback_username = fallback_username + end + + # Custom attribute writer method with validation + # @param [Object] fallback_password Value to be assigned + def fallback_password=(fallback_password) + if !fallback_password.nil? && fallback_password.to_s.length > 1024 + fail ArgumentError, 'invalid value for "fallback_password", the character length must be smaller than or equal to 1024.' + end + + @fallback_password = fallback_password + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + mode == o.mode && + detection_timeout == o.detection_timeout && + silence_timeout == o.silence_timeout && + speech_threshold == o.speech_threshold && + speech_end_threshold == o.speech_end_threshold && + machine_speech_end_threshold == o.machine_speech_end_threshold && + delay_result == o.delay_result && + callback_url == o.callback_url && + callback_method == o.callback_method && + username == o.username && + password == o.password && + fallback_url == o.fallback_url && + fallback_method == o.fallback_method && + fallback_username == o.fallback_username && + fallback_password == o.fallback_password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [mode, detection_timeout, silence_timeout, speech_threshold, speech_end_threshold, machine_speech_end_threshold, delay_result, callback_url, callback_method, username, password, fallback_url, fallback_method, fallback_username, fallback_password].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb new file mode 100644 index 00000000..47c0f42d --- /dev/null +++ b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MachineDetectionModeEnum + SYNC = "sync".freeze + ASYNC = "async".freeze + + def self.all_vars + @all_vars ||= [SYNC, ASYNC].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if MachineDetectionModeEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #MachineDetectionModeEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/media.rb b/lib/bandwidth-sdk/models/media.rb new file mode 100644 index 00000000..610f2797 --- /dev/null +++ b/lib/bandwidth-sdk/models/media.rb @@ -0,0 +1,237 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class Media + attr_accessor :content + + attr_accessor :content_length + + attr_accessor :media_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'content' => :'content', + :'content_length' => :'contentLength', + :'media_name' => :'mediaName' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'content' => :'String', + :'content_length' => :'Integer', + :'media_name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Media` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Media`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'content_length') + self.content_length = attributes[:'content_length'] + end + + if attributes.key?(:'media_name') + self.media_name = attributes[:'media_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + content == o.content && + content_length == o.content_length && + media_name == o.media_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [content, content_length, media_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/message.rb b/lib/bandwidth-sdk/models/message.rb new file mode 100644 index 00000000..203d41e9 --- /dev/null +++ b/lib/bandwidth-sdk/models/message.rb @@ -0,0 +1,344 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class Message + # The id of the message. + attr_accessor :id + + # The Bandwidth phone number associated with the message. + attr_accessor :owner + + # The application ID associated with the message. + attr_accessor :application_id + + # The datetime stamp of the message in ISO 8601 + attr_accessor :time + + # The number of segments the original message from the user is broken into before sending over to carrier networks. + attr_accessor :segment_count + + attr_accessor :direction + + # The phone number recipients of the message. + attr_accessor :to + + # The phone number the message was sent from. + attr_accessor :from + + # The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. + attr_accessor :media + + # The contents of the message. + attr_accessor :text + + # The custom string set by the user. + attr_accessor :tag + + attr_accessor :priority + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'owner' => :'owner', + :'application_id' => :'applicationId', + :'time' => :'time', + :'segment_count' => :'segmentCount', + :'direction' => :'direction', + :'to' => :'to', + :'from' => :'from', + :'media' => :'media', + :'text' => :'text', + :'tag' => :'tag', + :'priority' => :'priority' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'owner' => :'String', + :'application_id' => :'String', + :'time' => :'String', + :'segment_count' => :'Integer', + :'direction' => :'MessageDirectionEnum', + :'to' => :'Array', + :'from' => :'String', + :'media' => :'Array', + :'text' => :'String', + :'tag' => :'String', + :'priority' => :'PriorityEnum' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Message` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Message`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'owner') + self.owner = attributes[:'owner'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'segment_count') + self.segment_count = attributes[:'segment_count'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'to') + if (value = attributes[:'to']).is_a?(Array) + self.to = value + end + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'media') + if (value = attributes[:'media']).is_a?(Array) + self.media = value + end + end + + if attributes.key?(:'text') + self.text = attributes[:'text'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Custom attribute writer method with validation + # @param [Object] to Value to be assigned + def to=(to) + @to = to + end + + # Custom attribute writer method with validation + # @param [Object] media Value to be assigned + def media=(media) + @media = media + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + owner == o.owner && + application_id == o.application_id && + time == o.time && + segment_count == o.segment_count && + direction == o.direction && + to == o.to && + from == o.from && + media == o.media && + text == o.text && + tag == o.tag && + priority == o.priority + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, owner, application_id, time, segment_count, direction, to, from, media, text, tag, priority].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/message_direction_enum.rb b/lib/bandwidth-sdk/models/message_direction_enum.rb new file mode 100644 index 00000000..d62b7108 --- /dev/null +++ b/lib/bandwidth-sdk/models/message_direction_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MessageDirectionEnum + IN = "in".freeze + OUT = "out".freeze + + def self.all_vars + @all_vars ||= [IN, OUT].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if MessageDirectionEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #MessageDirectionEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/message_request.rb b/lib/bandwidth-sdk/models/message_request.rb new file mode 100644 index 00000000..951d904c --- /dev/null +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -0,0 +1,333 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MessageRequest + # The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. + attr_accessor :application_id + + # The phone number(s) the message should be sent to in E164 format. + attr_accessor :to + + # One of your telephone numbers the message should come from in E164 format. + attr_accessor :from + + # The contents of the text message. Must be 2048 characters or less. + attr_accessor :text + + # A list of URLs to include as media attachments as part of the message. + attr_accessor :media + + # A custom string that will be included in callback events of the message. Max 1024 characters. + attr_accessor :tag + + attr_accessor :priority + + # A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. + attr_accessor :expiration + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'application_id' => :'applicationId', + :'to' => :'to', + :'from' => :'from', + :'text' => :'text', + :'media' => :'media', + :'tag' => :'tag', + :'priority' => :'priority', + :'expiration' => :'expiration' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'application_id' => :'String', + :'to' => :'Array', + :'from' => :'String', + :'text' => :'String', + :'media' => :'Array', + :'tag' => :'String', + :'priority' => :'PriorityEnum', + :'expiration' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'to') + if (value = attributes[:'to']).is_a?(Array) + self.to = value + end + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'text') + self.text = attributes[:'text'] + end + + if attributes.key?(:'media') + if (value = attributes[:'media']).is_a?(Array) + self.media = value + end + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'expiration') + self.expiration = attributes[:'expiration'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @application_id.nil? + invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') + end + + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + if @from.nil? + invalid_properties.push('invalid value for "from", from cannot be nil.') + end + + if !@text.nil? && @text.to_s.length > 2048 + invalid_properties.push('invalid value for "text", the character length must be smaller than or equal to 2048.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @application_id.nil? + return false if @to.nil? + return false if @from.nil? + return false if !@text.nil? && @text.to_s.length > 2048 + true + end + + # Custom attribute writer method with validation + # @param [Object] to Value to be assigned + def to=(to) + if to.nil? + fail ArgumentError, 'to cannot be nil' + end + + @to = to + end + + # Custom attribute writer method with validation + # @param [Object] text Value to be assigned + def text=(text) + if !text.nil? && text.to_s.length > 2048 + fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 2048.' + end + + @text = text + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + application_id == o.application_id && + to == o.to && + from == o.from && + text == o.text && + media == o.media && + tag == o.tag && + priority == o.priority && + expiration == o.expiration + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [application_id, to, from, text, media, tag, priority, expiration].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/message_status_enum.rb b/lib/bandwidth-sdk/models/message_status_enum.rb new file mode 100644 index 00000000..bd8c7810 --- /dev/null +++ b/lib/bandwidth-sdk/models/message_status_enum.rb @@ -0,0 +1,46 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MessageStatusEnum + RECEIVED = "RECEIVED".freeze + QUEUED = "QUEUED".freeze + SENDING = "SENDING".freeze + SENT = "SENT".freeze + FAILED = "FAILED".freeze + DELIVERED = "DELIVERED".freeze + ACCEPTED = "ACCEPTED".freeze + UNDELIVERED = "UNDELIVERED".freeze + + def self.all_vars + @all_vars ||= [RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, ACCEPTED, UNDELIVERED].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if MessageStatusEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #MessageStatusEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/message_type_enum.rb b/lib/bandwidth-sdk/models/message_type_enum.rb new file mode 100644 index 00000000..7550e394 --- /dev/null +++ b/lib/bandwidth-sdk/models/message_type_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MessageTypeEnum + SMS = "sms".freeze + MMS = "mms".freeze + + def self.all_vars + @all_vars ||= [SMS, MMS].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if MessageTypeEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #MessageTypeEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/messages_list.rb b/lib/bandwidth-sdk/models/messages_list.rb new file mode 100644 index 00000000..0a7acc45 --- /dev/null +++ b/lib/bandwidth-sdk/models/messages_list.rb @@ -0,0 +1,240 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MessagesList + # Total number of messages matched by the search. + attr_accessor :total_count + + attr_accessor :page_info + + attr_accessor :messages + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'total_count' => :'totalCount', + :'page_info' => :'pageInfo', + :'messages' => :'messages' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'total_count' => :'Integer', + :'page_info' => :'PageInfo', + :'messages' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessagesList` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessagesList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + end + + if attributes.key?(:'page_info') + self.page_info = attributes[:'page_info'] + end + + if attributes.key?(:'messages') + if (value = attributes[:'messages']).is_a?(Array) + self.messages = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_count == o.total_count && + page_info == o.page_info && + messages == o.messages + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [total_count, page_info, messages].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/messaging_code_response.rb b/lib/bandwidth-sdk/models/messaging_code_response.rb new file mode 100644 index 00000000..0da522c8 --- /dev/null +++ b/lib/bandwidth-sdk/models/messaging_code_response.rb @@ -0,0 +1,220 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MessagingCodeResponse + # Messaging API Message ID. + attr_accessor :message_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message_id' => :'messageId' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'message_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessagingCodeResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessagingCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message_id') + self.message_id = attributes[:'message_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message_id == o.message_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/messaging_request_error.rb b/lib/bandwidth-sdk/models/messaging_request_error.rb new file mode 100644 index 00000000..4d91dbda --- /dev/null +++ b/lib/bandwidth-sdk/models/messaging_request_error.rb @@ -0,0 +1,238 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MessagingRequestError + attr_accessor :type + + attr_accessor :description + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'description' => :'description' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'description' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessagingRequestError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessagingRequestError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @description.nil? + invalid_properties.push('invalid value for "description", description cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @description.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + description == o.description + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, description].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb new file mode 100644 index 00000000..45b69d80 --- /dev/null +++ b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb @@ -0,0 +1,220 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MfaForbiddenRequestError + # The message containing the reason behind the request being forbidden. + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MfaForbiddenRequestError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MfaForbiddenRequestError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/mfa_request_error.rb b/lib/bandwidth-sdk/models/mfa_request_error.rb new file mode 100644 index 00000000..cb038e4e --- /dev/null +++ b/lib/bandwidth-sdk/models/mfa_request_error.rb @@ -0,0 +1,230 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MfaRequestError + # A message describing the error with your request. + attr_accessor :error + + # The associated requestId from AWS. + attr_accessor :request_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'error' => :'error', + :'request_id' => :'requestId' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'error' => :'String', + :'request_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MfaRequestError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MfaRequestError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'request_id') + self.request_id = attributes[:'request_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error == o.error && + request_id == o.request_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [error, request_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb new file mode 100644 index 00000000..0c61b29c --- /dev/null +++ b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb @@ -0,0 +1,220 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MfaUnauthorizedRequestError + # Unauthorized + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MfaUnauthorizedRequestError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MfaUnauthorizedRequestError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/page_info.rb b/lib/bandwidth-sdk/models/page_info.rb new file mode 100644 index 00000000..35d739fa --- /dev/null +++ b/lib/bandwidth-sdk/models/page_info.rb @@ -0,0 +1,250 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class PageInfo + # The link to the previous page for pagination. + attr_accessor :prev_page + + # The link to the next page for pagination. + attr_accessor :next_page + + # The isolated pagination token for the previous page. + attr_accessor :prev_page_token + + # The isolated pagination token for the next page. + attr_accessor :next_page_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'prev_page' => :'prevPage', + :'next_page' => :'nextPage', + :'prev_page_token' => :'prevPageToken', + :'next_page_token' => :'nextPageToken' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'prev_page' => :'String', + :'next_page' => :'String', + :'prev_page_token' => :'String', + :'next_page_token' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::PageInfo` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::PageInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'prev_page') + self.prev_page = attributes[:'prev_page'] + end + + if attributes.key?(:'next_page') + self.next_page = attributes[:'next_page'] + end + + if attributes.key?(:'prev_page_token') + self.prev_page_token = attributes[:'prev_page_token'] + end + + if attributes.key?(:'next_page_token') + self.next_page_token = attributes[:'next_page_token'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + prev_page == o.prev_page && + next_page == o.next_page && + prev_page_token == o.prev_page_token && + next_page_token == o.next_page_token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [prev_page, next_page, prev_page_token, next_page_token].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/participant.rb b/lib/bandwidth-sdk/models/participant.rb new file mode 100644 index 00000000..b90fdb83 --- /dev/null +++ b/lib/bandwidth-sdk/models/participant.rb @@ -0,0 +1,292 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # Participant object. + class Participant + # Unique id of the participant. + attr_accessor :id + + # Full callback url to use for notifications about this participant. + attr_accessor :callback_url + + # Defines if this participant can publish audio or video. + attr_accessor :publish_permissions + + # List of session ids this participant is associated with Capped to one Upon creation of a Participant, returns as an empty array. + attr_accessor :sessions + + attr_accessor :subscriptions + + # User defined tag to associate with the participant. + attr_accessor :tag + + attr_accessor :device_api_version + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'callback_url' => :'callbackUrl', + :'publish_permissions' => :'publishPermissions', + :'sessions' => :'sessions', + :'subscriptions' => :'subscriptions', + :'tag' => :'tag', + :'device_api_version' => :'deviceApiVersion' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'callback_url' => :'String', + :'publish_permissions' => :'Array', + :'sessions' => :'Array', + :'subscriptions' => :'Subscriptions', + :'tag' => :'String', + :'device_api_version' => :'DeviceApiVersionEnum' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'callback_url', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Participant` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Participant`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'callback_url') + self.callback_url = attributes[:'callback_url'] + end + + if attributes.key?(:'publish_permissions') + if (value = attributes[:'publish_permissions']).is_a?(Array) + self.publish_permissions = value + end + end + + if attributes.key?(:'sessions') + if (value = attributes[:'sessions']).is_a?(Array) + self.sessions = value + end + end + + if attributes.key?(:'subscriptions') + self.subscriptions = attributes[:'subscriptions'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'device_api_version') + self.device_api_version = attributes[:'device_api_version'] + else + self.device_api_version = 'V3' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Custom attribute writer method with validation + # @param [Object] publish_permissions Value to be assigned + def publish_permissions=(publish_permissions) + @publish_permissions = publish_permissions + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + callback_url == o.callback_url && + publish_permissions == o.publish_permissions && + sessions == o.sessions && + subscriptions == o.subscriptions && + tag == o.tag && + device_api_version == o.device_api_version + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, callback_url, publish_permissions, sessions, subscriptions, tag, device_api_version].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/participant_subscription.rb b/lib/bandwidth-sdk/models/participant_subscription.rb new file mode 100644 index 00000000..7b80e54d --- /dev/null +++ b/lib/bandwidth-sdk/models/participant_subscription.rb @@ -0,0 +1,243 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class ParticipantSubscription + # The Participant the subscriber will be subscribed to + attr_accessor :participant_id + + # (optional) An array of specific streamAliases owned by the Participant that the subscriber will be subscribed to. Background: A streamAlias is created by a WebRTC client when it connects and declares a name for the related stream. The client is responsible for informing the application of any created streamAliases to enable the application to subscribe to specific streamAliases. Subscribing to a `streamAlias` that does not exist is undefined. If the array is empty all aliases are assumed. + attr_accessor :stream_aliases + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'participant_id' => :'participantId', + :'stream_aliases' => :'streamAliases' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'participant_id' => :'String', + :'stream_aliases' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ParticipantSubscription` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ParticipantSubscription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'participant_id') + self.participant_id = attributes[:'participant_id'] + end + + if attributes.key?(:'stream_aliases') + if (value = attributes[:'stream_aliases']).is_a?(Array) + self.stream_aliases = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @participant_id.nil? + invalid_properties.push('invalid value for "participant_id", participant_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @participant_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] stream_aliases Value to be assigned + def stream_aliases=(stream_aliases) + @stream_aliases = stream_aliases + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + participant_id == o.participant_id && + stream_aliases == o.stream_aliases + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [participant_id, stream_aliases].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/priority_enum.rb b/lib/bandwidth-sdk/models/priority_enum.rb new file mode 100644 index 00000000..da52874c --- /dev/null +++ b/lib/bandwidth-sdk/models/priority_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class PriorityEnum + DEFAULT = "default".freeze + HIGH = "high".freeze + + def self.all_vars + @all_vars ||= [DEFAULT, HIGH].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if PriorityEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #PriorityEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/publish_permissions_enum.rb b/lib/bandwidth-sdk/models/publish_permissions_enum.rb new file mode 100644 index 00000000..4f4b93de --- /dev/null +++ b/lib/bandwidth-sdk/models/publish_permissions_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class PublishPermissionsEnum + AUDIO = "AUDIO".freeze + VIDEO = "VIDEO".freeze + + def self.all_vars + @all_vars ||= [AUDIO, VIDEO].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if PublishPermissionsEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #PublishPermissionsEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/recording_available_callback.rb b/lib/bandwidth-sdk/models/recording_available_callback.rb new file mode 100644 index 00000000..8e71d33d --- /dev/null +++ b/lib/bandwidth-sdk/models/recording_available_callback.rb @@ -0,0 +1,432 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Recording Available event is sent after a recording has been processed. It indicates that the recording is available for download. + class RecordingAvailableCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (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. + attr_accessor :parent_call_id + + # The unique ID of this recording + attr_accessor :recording_id + + # The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. + attr_accessor :media_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # The time that the recording ended in ISO-8601 format + attr_accessor :end_time + + # The duration of the recording in ISO-8601 format + attr_accessor :duration + + attr_accessor :file_format + + # 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. + attr_accessor :channels + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # 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. + attr_accessor :status + + # 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. + attr_accessor :transfer_caller_id + + # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). + attr_accessor :transfer_to + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'parent_call_id' => :'parentCallId', + :'recording_id' => :'recordingId', + :'media_url' => :'mediaUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'end_time' => :'endTime', + :'duration' => :'duration', + :'file_format' => :'fileFormat', + :'channels' => :'channels', + :'tag' => :'tag', + :'status' => :'status', + :'transfer_caller_id' => :'transferCallerId', + :'transfer_to' => :'transferTo' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'parent_call_id' => :'String', + :'recording_id' => :'String', + :'media_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'end_time' => :'Time', + :'duration' => :'String', + :'file_format' => :'FileFormatEnum', + :'channels' => :'String', + :'tag' => :'String', + :'status' => :'String', + :'transfer_caller_id' => :'String', + :'transfer_to' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'media_url', + :'enqueued_time', + :'tag', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::RecordingAvailableCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingAvailableCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'media_url') + self.media_url = attributes[:'media_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'file_format') + self.file_format = attributes[:'file_format'] + end + + if attributes.key?(:'channels') + self.channels = attributes[:'channels'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'transfer_caller_id') + self.transfer_caller_id = attributes[:'transfer_caller_id'] + end + + if attributes.key?(:'transfer_to') + self.transfer_to = attributes[:'transfer_to'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + parent_call_id == o.parent_call_id && + recording_id == o.recording_id && + media_url == o.media_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + end_time == o.end_time && + duration == o.duration && + file_format == o.file_format && + channels == o.channels && + tag == o.tag && + status == o.status && + transfer_caller_id == o.transfer_caller_id && + transfer_to == o.transfer_to + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, parent_call_id, recording_id, media_url, enqueued_time, start_time, end_time, duration, file_format, channels, tag, status, transfer_caller_id, transfer_to].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/recording_complete_callback.rb b/lib/bandwidth-sdk/models/recording_complete_callback.rb new file mode 100644 index 00000000..87dfe676 --- /dev/null +++ b/lib/bandwidth-sdk/models/recording_complete_callback.rb @@ -0,0 +1,433 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Record Complete event is sent after a verb has executed if the call is still active. The BXML returned by this callback is executed next. When the recording is available for download, a Recording Available event will be sent. + class RecordingCompleteCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (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. + attr_accessor :parent_call_id + + # The unique ID of this recording + attr_accessor :recording_id + + # The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. + attr_accessor :media_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # The time that the recording ended in ISO-8601 format + attr_accessor :end_time + + # The duration of the recording in ISO-8601 format + attr_accessor :duration + + attr_accessor :file_format + + # Always `1` for conference recordings; multi-channel recordings are not supported on conferences. + attr_accessor :channels + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # 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. + attr_accessor :transfer_caller_id + + # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). + attr_accessor :transfer_to + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'parent_call_id' => :'parentCallId', + :'recording_id' => :'recordingId', + :'media_url' => :'mediaUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'end_time' => :'endTime', + :'duration' => :'duration', + :'file_format' => :'fileFormat', + :'channels' => :'channels', + :'tag' => :'tag', + :'transfer_caller_id' => :'transferCallerId', + :'transfer_to' => :'transferTo' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'parent_call_id' => :'String', + :'recording_id' => :'String', + :'media_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'end_time' => :'Time', + :'duration' => :'String', + :'file_format' => :'FileFormatEnum', + :'channels' => :'Integer', + :'tag' => :'String', + :'transfer_caller_id' => :'String', + :'transfer_to' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'media_url', + :'enqueued_time', + :'answer_time', + :'tag', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::RecordingCompleteCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'media_url') + self.media_url = attributes[:'media_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'file_format') + self.file_format = attributes[:'file_format'] + end + + if attributes.key?(:'channels') + self.channels = attributes[:'channels'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'transfer_caller_id') + self.transfer_caller_id = attributes[:'transfer_caller_id'] + end + + if attributes.key?(:'transfer_to') + self.transfer_to = attributes[:'transfer_to'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + parent_call_id == o.parent_call_id && + recording_id == o.recording_id && + media_url == o.media_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + end_time == o.end_time && + duration == o.duration && + file_format == o.file_format && + channels == o.channels && + tag == o.tag && + transfer_caller_id == o.transfer_caller_id && + transfer_to == o.transfer_to + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, parent_call_id, recording_id, media_url, enqueued_time, start_time, answer_time, end_time, duration, file_format, channels, tag, transfer_caller_id, transfer_to].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/recording_state_enum.rb b/lib/bandwidth-sdk/models/recording_state_enum.rb new file mode 100644 index 00000000..f02572ba --- /dev/null +++ b/lib/bandwidth-sdk/models/recording_state_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class RecordingStateEnum + PAUSED = "paused".freeze + RECORDING = "recording".freeze + + def self.all_vars + @all_vars ||= [PAUSED, RECORDING].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if RecordingStateEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #RecordingStateEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/redirect_callback.rb b/lib/bandwidth-sdk/models/redirect_callback.rb new file mode 100644 index 00000000..abf6c508 --- /dev/null +++ b/lib/bandwidth-sdk/models/redirect_callback.rb @@ -0,0 +1,373 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Redirect event is fired when a verb is executed. Its purpose is to get the next set of verbs from the calling application. + class RedirectCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (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. + attr_accessor :parent_call_id + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # 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. + attr_accessor :transfer_caller_id + + # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). + attr_accessor :transfer_to + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'parent_call_id' => :'parentCallId', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'tag' => :'tag', + :'transfer_caller_id' => :'transferCallerId', + :'transfer_to' => :'transferTo' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'parent_call_id' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'tag' => :'String', + :'transfer_caller_id' => :'String', + :'transfer_to' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'tag', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::RedirectCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RedirectCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'transfer_caller_id') + self.transfer_caller_id = attributes[:'transfer_caller_id'] + end + + if attributes.key?(:'transfer_to') + self.transfer_to = attributes[:'transfer_to'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + parent_call_id == o.parent_call_id && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + tag == o.tag && + transfer_caller_id == o.transfer_caller_id && + transfer_to == o.transfer_to + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, parent_call_id, enqueued_time, start_time, answer_time, tag, transfer_caller_id, transfer_to].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/redirect_method_enum.rb b/lib/bandwidth-sdk/models/redirect_method_enum.rb new file mode 100644 index 00000000..c30fa2ab --- /dev/null +++ b/lib/bandwidth-sdk/models/redirect_method_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class RedirectMethodEnum + GET = "GET".freeze + POST = "POST".freeze + + def self.all_vars + @all_vars ||= [GET, POST].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if RedirectMethodEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #RedirectMethodEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/request_error.rb b/lib/bandwidth-sdk/models/request_error.rb new file mode 100644 index 00000000..ce341b5d --- /dev/null +++ b/lib/bandwidth-sdk/models/request_error.rb @@ -0,0 +1,230 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class RequestError + # A message describing the error with your request. + attr_accessor :error + + # The associated requestId from AWS. + attr_accessor :request_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'error' => :'error', + :'request_id' => :'requestId' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'error' => :'String', + :'request_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::RequestError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RequestError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'request_id') + self.request_id = attributes[:'request_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error == o.error && + request_id == o.request_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [error, request_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/session.rb b/lib/bandwidth-sdk/models/session.rb new file mode 100644 index 00000000..f6c44bfd --- /dev/null +++ b/lib/bandwidth-sdk/models/session.rb @@ -0,0 +1,231 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # Session object. + class Session + # Unique id of the session. + attr_accessor :id + + # User defined tag to associate with the session. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Session` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Session`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/stir_shaken.rb b/lib/bandwidth-sdk/models/stir_shaken.rb new file mode 100644 index 00000000..2e68f124 --- /dev/null +++ b/lib/bandwidth-sdk/models/stir_shaken.rb @@ -0,0 +1,240 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class StirShaken + # (optional) The verification status indicating whether the verification was successful or not. Possible values are TN-Verification-Passed and TN-Verification-Failed. + attr_accessor :verstat + + # (optional) The attestation level verified by Bandwidth. Possible values are A (full), B (partial) or C (gateway). + attr_accessor :attestation_indicator + + # (optional) A unique origination identifier. + attr_accessor :originating_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'verstat' => :'verstat', + :'attestation_indicator' => :'attestationIndicator', + :'originating_id' => :'originatingId' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'verstat' => :'String', + :'attestation_indicator' => :'String', + :'originating_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::StirShaken` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::StirShaken`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'verstat') + self.verstat = attributes[:'verstat'] + end + + if attributes.key?(:'attestation_indicator') + self.attestation_indicator = attributes[:'attestation_indicator'] + end + + if attributes.key?(:'originating_id') + self.originating_id = attributes[:'originating_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + verstat == o.verstat && + attestation_indicator == o.attestation_indicator && + originating_id == o.originating_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [verstat, attestation_indicator, originating_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/subscriptions.rb b/lib/bandwidth-sdk/models/subscriptions.rb new file mode 100644 index 00000000..21831aa8 --- /dev/null +++ b/lib/bandwidth-sdk/models/subscriptions.rb @@ -0,0 +1,232 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class Subscriptions + # If present, and not overridden by the array of participants, it represents the session the subscriptions are associated with. If this is the only field, the subscriber will be subscribed to all participants in the session (including any participants that are later added to the session). Upon creation of a Participant, returns as an empty object. + attr_accessor :session_id + + # (optional) A list of participants in the session that will be subscribed to. If present and not empty or null, this will override any sessionId specified in the body. Returns empty if used during the creation of a Participant. + attr_accessor :participants + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'session_id' => :'sessionId', + :'participants' => :'participants' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'session_id' => :'String', + :'participants' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Subscriptions` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Subscriptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'session_id') + self.session_id = attributes[:'session_id'] + end + + if attributes.key?(:'participants') + if (value = attributes[:'participants']).is_a?(Array) + self.participants = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + session_id == o.session_id && + participants == o.participants + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [session_id, participants].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/tag.rb b/lib/bandwidth-sdk/models/tag.rb new file mode 100644 index 00000000..ce48b5ec --- /dev/null +++ b/lib/bandwidth-sdk/models/tag.rb @@ -0,0 +1,228 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class Tag + attr_accessor :key + + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'key' => :'key', + :'value' => :'value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'key' => :'String', + :'value' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Tag` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Tag`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key == o.key && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [key, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb new file mode 100644 index 00000000..6537ccd5 --- /dev/null +++ b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb @@ -0,0 +1,220 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class TnLookupRequestError + # A description of what validation error occurred. + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TnLookupRequestError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TnLookupRequestError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/transcribe_recording.rb b/lib/bandwidth-sdk/models/transcribe_recording.rb new file mode 100644 index 00000000..bb59784f --- /dev/null +++ b/lib/bandwidth-sdk/models/transcribe_recording.rb @@ -0,0 +1,332 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class TranscribeRecording + # 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. + attr_accessor :callback_url + + attr_accessor :callback_method + + # Basic auth username. + attr_accessor :username + + # Basic auth password. + attr_accessor :password + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # This is the timeout (in seconds) to use when delivering the webhook to `callbackUrl`. Can be any numeric value (including decimals) between 1 and 25. + attr_accessor :callback_timeout + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'callback_url' => :'callbackUrl', + :'callback_method' => :'callbackMethod', + :'username' => :'username', + :'password' => :'password', + :'tag' => :'tag', + :'callback_timeout' => :'callbackTimeout' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'callback_url' => :'String', + :'callback_method' => :'CallbackMethodEnum', + :'username' => :'String', + :'password' => :'String', + :'tag' => :'String', + :'callback_timeout' => :'Float' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'callback_method', + :'username', + :'password', + :'tag', + :'callback_timeout' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TranscribeRecording` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TranscribeRecording`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'callback_url') + self.callback_url = attributes[:'callback_url'] + end + + if attributes.key?(:'callback_method') + self.callback_method = attributes[:'callback_method'] + else + self.callback_method = 'POST' + end + + if attributes.key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'callback_timeout') + self.callback_timeout = attributes[:'callback_timeout'] + else + self.callback_timeout = 15 + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@username.nil? && @username.to_s.length > 1024 + invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') + end + + if !@password.nil? && @password.to_s.length > 1024 + invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 1024.') + end + + if !@callback_timeout.nil? && @callback_timeout > 25 + invalid_properties.push('invalid value for "callback_timeout", must be smaller than or equal to 25.') + end + + if !@callback_timeout.nil? && @callback_timeout < 1 + invalid_properties.push('invalid value for "callback_timeout", must be greater than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@username.nil? && @username.to_s.length > 1024 + return false if !@password.nil? && @password.to_s.length > 1024 + return false if !@callback_timeout.nil? && @callback_timeout > 25 + return false if !@callback_timeout.nil? && @callback_timeout < 1 + true + end + + # Custom attribute writer method with validation + # @param [Object] username Value to be assigned + def username=(username) + if !username.nil? && username.to_s.length > 1024 + fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 1024.' + end + + @username = username + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if !password.nil? && password.to_s.length > 1024 + fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 1024.' + end + + @password = password + end + + # Custom attribute writer method with validation + # @param [Object] callback_timeout Value to be assigned + def callback_timeout=(callback_timeout) + if !callback_timeout.nil? && callback_timeout > 25 + fail ArgumentError, 'invalid value for "callback_timeout", must be smaller than or equal to 25.' + end + + if !callback_timeout.nil? && callback_timeout < 1 + fail ArgumentError, 'invalid value for "callback_timeout", must be greater than or equal to 1.' + end + + @callback_timeout = callback_timeout + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + callback_url == o.callback_url && + callback_method == o.callback_method && + username == o.username && + password == o.password && + tag == o.tag && + callback_timeout == o.callback_timeout + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [callback_url, callback_method, username, password, tag, callback_timeout].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/transcription.rb b/lib/bandwidth-sdk/models/transcription.rb new file mode 100644 index 00000000..acbe1c46 --- /dev/null +++ b/lib/bandwidth-sdk/models/transcription.rb @@ -0,0 +1,230 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class Transcription + # The transcribed text + attr_accessor :text + + # The confidence on the recognized content, ranging from `0.0` to `1.0` with `1.0` being the highest confidence. + attr_accessor :confidence + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'text' => :'text', + :'confidence' => :'confidence' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'text' => :'String', + :'confidence' => :'Float' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Transcription` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Transcription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'text') + self.text = attributes[:'text'] + end + + if attributes.key?(:'confidence') + self.confidence = attributes[:'confidence'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + text == o.text && + confidence == o.confidence + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [text, confidence].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/transcription_available_callback.rb b/lib/bandwidth-sdk/models/transcription_available_callback.rb new file mode 100644 index 00000000..d17422f5 --- /dev/null +++ b/lib/bandwidth-sdk/models/transcription_available_callback.rb @@ -0,0 +1,421 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Transcription Available event is sent when the recording transcription is available to be downloaded. + class TranscriptionAvailableCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. + attr_accessor :media_url + + # (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. + attr_accessor :parent_call_id + + # The unique ID of this recording + attr_accessor :recording_id + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # The time that the recording ended in ISO-8601 format + attr_accessor :end_time + + # The duration of the recording in ISO-8601 format + attr_accessor :duration + + attr_accessor :file_format + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + attr_accessor :transcription + + # 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. + attr_accessor :transfer_caller_id + + # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). + attr_accessor :transfer_to + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'media_url' => :'mediaUrl', + :'parent_call_id' => :'parentCallId', + :'recording_id' => :'recordingId', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'end_time' => :'endTime', + :'duration' => :'duration', + :'file_format' => :'fileFormat', + :'tag' => :'tag', + :'transcription' => :'transcription', + :'transfer_caller_id' => :'transferCallerId', + :'transfer_to' => :'transferTo' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'media_url' => :'String', + :'parent_call_id' => :'String', + :'recording_id' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'end_time' => :'Time', + :'duration' => :'String', + :'file_format' => :'FileFormatEnum', + :'tag' => :'String', + :'transcription' => :'Transcription', + :'transfer_caller_id' => :'String', + :'transfer_to' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'media_url', + :'enqueued_time', + :'tag', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TranscriptionAvailableCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TranscriptionAvailableCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'media_url') + self.media_url = attributes[:'media_url'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'file_format') + self.file_format = attributes[:'file_format'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'transcription') + self.transcription = attributes[:'transcription'] + end + + if attributes.key?(:'transfer_caller_id') + self.transfer_caller_id = attributes[:'transfer_caller_id'] + end + + if attributes.key?(:'transfer_to') + self.transfer_to = attributes[:'transfer_to'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + media_url == o.media_url && + parent_call_id == o.parent_call_id && + recording_id == o.recording_id && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + end_time == o.end_time && + duration == o.duration && + file_format == o.file_format && + tag == o.tag && + transcription == o.transcription && + transfer_caller_id == o.transfer_caller_id && + transfer_to == o.transfer_to + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, media_url, parent_call_id, recording_id, enqueued_time, start_time, end_time, duration, file_format, tag, transcription, transfer_caller_id, transfer_to].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/transcription_list.rb b/lib/bandwidth-sdk/models/transcription_list.rb new file mode 100644 index 00000000..57ea7a72 --- /dev/null +++ b/lib/bandwidth-sdk/models/transcription_list.rb @@ -0,0 +1,221 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class TranscriptionList + attr_accessor :transcripts + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'transcripts' => :'transcripts' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'transcripts' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TranscriptionList` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TranscriptionList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'transcripts') + if (value = attributes[:'transcripts']).is_a?(Array) + self.transcripts = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + transcripts == o.transcripts + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [transcripts].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/transcription_metadata.rb b/lib/bandwidth-sdk/models/transcription_metadata.rb new file mode 100644 index 00000000..b2e6e70a --- /dev/null +++ b/lib/bandwidth-sdk/models/transcription_metadata.rb @@ -0,0 +1,251 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # If the recording was transcribed, metadata about the transcription + class TranscriptionMetadata + # The unique transcription ID + attr_accessor :id + + # 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. + attr_accessor :status + + # The time that the transcription was completed + attr_accessor :completed_time + + # The URL of the [transcription](#operation/getCallTranscription) + attr_accessor :url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'status' => :'status', + :'completed_time' => :'completedTime', + :'url' => :'url' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'status' => :'String', + :'completed_time' => :'String', + :'url' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TranscriptionMetadata` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TranscriptionMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'completed_time') + self.completed_time = attributes[:'completed_time'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + status == o.status && + completed_time == o.completed_time && + url == o.url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, status, completed_time, url].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/transfer_answer_callback.rb b/lib/bandwidth-sdk/models/transfer_answer_callback.rb new file mode 100644 index 00000000..3f471e58 --- /dev/null +++ b/lib/bandwidth-sdk/models/transfer_answer_callback.rb @@ -0,0 +1,363 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # When processing a verb, this event is sent when a called party (B-leg) answers. The event is sent to the endpoint specified in the transferAnswerUrl attribute of the tag that answered. BXML returned by this callback will be executed for the called party only. After all BXML has been executed, the called party will be bridged to the original call. Most BXML verbs are allowed in response to a transferAnswer event, but some are not allowed. + class TransferAnswerCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # 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. + attr_accessor :transfer_caller_id + + # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). + attr_accessor :transfer_to + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'tag' => :'tag', + :'transfer_caller_id' => :'transferCallerId', + :'transfer_to' => :'transferTo' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'tag' => :'String', + :'transfer_caller_id' => :'String', + :'transfer_to' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'tag', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TransferAnswerCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TransferAnswerCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'transfer_caller_id') + self.transfer_caller_id = attributes[:'transfer_caller_id'] + end + + if attributes.key?(:'transfer_to') + self.transfer_to = attributes[:'transfer_to'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + tag == o.tag && + transfer_caller_id == o.transfer_caller_id && + transfer_to == o.transfer_to + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, enqueued_time, start_time, answer_time, tag, transfer_caller_id, transfer_to].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/transfer_complete_callback.rb b/lib/bandwidth-sdk/models/transfer_complete_callback.rb new file mode 100644 index 00000000..c6df9e55 --- /dev/null +++ b/lib/bandwidth-sdk/models/transfer_complete_callback.rb @@ -0,0 +1,395 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # This event is sent to the transferCompleteUrl of the A-leg's verb when the transferred call (B-leg) completes. In a simultaneous ringing scenario, only one B-leg succeeds and this event corresponds to that successful leg. If none of the calls were answered, the transferComplete event corresponds to one of the legs. + class TransferCompleteCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # 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. + attr_accessor :transfer_caller_id + + # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). + attr_accessor :transfer_to + + # Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. + attr_accessor :cause + + # Text explaining the reason that caused the call to fail in case of errors. + attr_accessor :error_message + + # Bandwidth's internal id that references the error event. + attr_accessor :error_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'tag' => :'tag', + :'transfer_caller_id' => :'transferCallerId', + :'transfer_to' => :'transferTo', + :'cause' => :'cause', + :'error_message' => :'errorMessage', + :'error_id' => :'errorId' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'tag' => :'String', + :'transfer_caller_id' => :'String', + :'transfer_to' => :'String', + :'cause' => :'String', + :'error_message' => :'String', + :'error_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'tag', + :'error_message', + :'error_id' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TransferCompleteCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TransferCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'transfer_caller_id') + self.transfer_caller_id = attributes[:'transfer_caller_id'] + end + + if attributes.key?(:'transfer_to') + self.transfer_to = attributes[:'transfer_to'] + end + + if attributes.key?(:'cause') + self.cause = attributes[:'cause'] + end + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'error_id') + self.error_id = attributes[:'error_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + tag == o.tag && + transfer_caller_id == o.transfer_caller_id && + transfer_to == o.transfer_to && + cause == o.cause && + error_message == o.error_message && + error_id == o.error_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, enqueued_time, start_time, answer_time, tag, transfer_caller_id, transfer_to, cause, error_message, error_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb new file mode 100644 index 00000000..bf5b3920 --- /dev/null +++ b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb @@ -0,0 +1,415 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # This event is sent to the transferDisconnectUrl of each tag when its respective call leg ends for any reason. The event is sent in the normal case, when the transferred leg is answered and later hung up, but is also sent if the new leg was never answered in the first place, if it was rejected, and if the original call leg hung up before the transferred leg. + class TransferDisconnectCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + attr_accessor :direction + + # The call id associated with the event. + attr_accessor :call_id + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (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. + attr_accessor :parent_call_id + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # The time that the recording ended in ISO-8601 format + attr_accessor :end_time + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + # 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. + attr_accessor :transfer_caller_id + + # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). + attr_accessor :transfer_to + + # Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. + attr_accessor :cause + + # Text explaining the reason that caused the call to fail in case of errors. + attr_accessor :error_message + + # Bandwidth's internal id that references the error event. + attr_accessor :error_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'direction' => :'direction', + :'call_id' => :'callId', + :'call_url' => :'callUrl', + :'parent_call_id' => :'parentCallId', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'end_time' => :'endTime', + :'tag' => :'tag', + :'transfer_caller_id' => :'transferCallerId', + :'transfer_to' => :'transferTo', + :'cause' => :'cause', + :'error_message' => :'errorMessage', + :'error_id' => :'errorId' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_id' => :'String', + :'call_url' => :'String', + :'parent_call_id' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'end_time' => :'Time', + :'tag' => :'String', + :'transfer_caller_id' => :'String', + :'transfer_to' => :'String', + :'cause' => :'String', + :'error_message' => :'String', + :'error_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'tag', + :'error_message', + :'error_id' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TransferDisconnectCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TransferDisconnectCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'transfer_caller_id') + self.transfer_caller_id = attributes[:'transfer_caller_id'] + end + + if attributes.key?(:'transfer_to') + self.transfer_to = attributes[:'transfer_to'] + end + + if attributes.key?(:'cause') + self.cause = attributes[:'cause'] + end + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'error_id') + self.error_id = attributes[:'error_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + direction == o.direction && + call_id == o.call_id && + call_url == o.call_url && + parent_call_id == o.parent_call_id && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + end_time == o.end_time && + tag == o.tag && + transfer_caller_id == o.transfer_caller_id && + transfer_to == o.transfer_to && + cause == o.cause && + error_message == o.error_message && + error_id == o.error_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, parent_call_id, enqueued_time, start_time, answer_time, end_time, tag, transfer_caller_id, transfer_to, cause, error_message, error_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/unauthorized_request.rb b/lib/bandwidth-sdk/models/unauthorized_request.rb new file mode 100644 index 00000000..563f9f91 --- /dev/null +++ b/lib/bandwidth-sdk/models/unauthorized_request.rb @@ -0,0 +1,220 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class UnauthorizedRequest + # Unauthorized + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::UnauthorizedRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::UnauthorizedRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/update_call.rb b/lib/bandwidth-sdk/models/update_call.rb new file mode 100644 index 00000000..a0d92dfd --- /dev/null +++ b/lib/bandwidth-sdk/models/update_call.rb @@ -0,0 +1,389 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class UpdateCall + attr_accessor :state + + # 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`. + attr_accessor :redirect_url + + attr_accessor :redirect_method + + # Basic auth username. + attr_accessor :username + + # Basic auth password. + attr_accessor :password + + # A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond + attr_accessor :redirect_fallback_url + + attr_accessor :redirect_fallback_method + + # Basic auth username. + attr_accessor :fallback_username + + # Basic auth password. + attr_accessor :fallback_password + + # 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`. + attr_accessor :tag + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state' => :'state', + :'redirect_url' => :'redirectUrl', + :'redirect_method' => :'redirectMethod', + :'username' => :'username', + :'password' => :'password', + :'redirect_fallback_url' => :'redirectFallbackUrl', + :'redirect_fallback_method' => :'redirectFallbackMethod', + :'fallback_username' => :'fallbackUsername', + :'fallback_password' => :'fallbackPassword', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'state' => :'CallStateEnum', + :'redirect_url' => :'String', + :'redirect_method' => :'RedirectMethodEnum', + :'username' => :'String', + :'password' => :'String', + :'redirect_fallback_url' => :'String', + :'redirect_fallback_method' => :'RedirectMethodEnum', + :'fallback_username' => :'String', + :'fallback_password' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'state', + :'redirect_url', + :'redirect_method', + :'username', + :'password', + :'redirect_fallback_url', + :'redirect_fallback_method', + :'fallback_username', + :'fallback_password', + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::UpdateCall` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::UpdateCall`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'state') + self.state = attributes[:'state'] + else + self.state = 'active' + end + + if attributes.key?(:'redirect_url') + self.redirect_url = attributes[:'redirect_url'] + end + + if attributes.key?(:'redirect_method') + self.redirect_method = attributes[:'redirect_method'] + else + self.redirect_method = 'POST' + end + + if attributes.key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'redirect_fallback_url') + self.redirect_fallback_url = attributes[:'redirect_fallback_url'] + end + + if attributes.key?(:'redirect_fallback_method') + self.redirect_fallback_method = attributes[:'redirect_fallback_method'] + else + self.redirect_fallback_method = 'POST' + end + + if attributes.key?(:'fallback_username') + self.fallback_username = attributes[:'fallback_username'] + end + + if attributes.key?(:'fallback_password') + self.fallback_password = attributes[:'fallback_password'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@username.nil? && @username.to_s.length > 1024 + invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') + end + + if !@password.nil? && @password.to_s.length > 1024 + invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 1024.') + end + + if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 + invalid_properties.push('invalid value for "fallback_username", the character length must be smaller than or equal to 1024.') + end + + if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 + invalid_properties.push('invalid value for "fallback_password", the character length must be smaller than or equal to 1024.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@username.nil? && @username.to_s.length > 1024 + return false if !@password.nil? && @password.to_s.length > 1024 + return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 + return false if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 + true + end + + # Custom attribute writer method with validation + # @param [Object] username Value to be assigned + def username=(username) + if !username.nil? && username.to_s.length > 1024 + fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 1024.' + end + + @username = username + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if !password.nil? && password.to_s.length > 1024 + fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 1024.' + end + + @password = password + end + + # Custom attribute writer method with validation + # @param [Object] fallback_username Value to be assigned + def fallback_username=(fallback_username) + if !fallback_username.nil? && fallback_username.to_s.length > 1024 + fail ArgumentError, 'invalid value for "fallback_username", the character length must be smaller than or equal to 1024.' + end + + @fallback_username = fallback_username + end + + # Custom attribute writer method with validation + # @param [Object] fallback_password Value to be assigned + def fallback_password=(fallback_password) + if !fallback_password.nil? && fallback_password.to_s.length > 1024 + fail ArgumentError, 'invalid value for "fallback_password", the character length must be smaller than or equal to 1024.' + end + + @fallback_password = fallback_password + end + + # Custom attribute writer method with validation + # @param [Object] tag Value to be assigned + def tag=(tag) + @tag = tag + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + state == o.state && + redirect_url == o.redirect_url && + redirect_method == o.redirect_method && + username == o.username && + password == o.password && + redirect_fallback_url == o.redirect_fallback_url && + redirect_fallback_method == o.redirect_fallback_method && + fallback_username == o.fallback_username && + fallback_password == o.fallback_password && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [state, redirect_url, redirect_method, username, password, redirect_fallback_url, redirect_fallback_method, fallback_username, fallback_password, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/update_call_recording.rb b/lib/bandwidth-sdk/models/update_call_recording.rb new file mode 100644 index 00000000..5dde4551 --- /dev/null +++ b/lib/bandwidth-sdk/models/update_call_recording.rb @@ -0,0 +1,224 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class UpdateCallRecording + attr_accessor :state + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state' => :'state' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'state' => :'RecordingStateEnum' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::UpdateCallRecording` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::UpdateCallRecording`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @state.nil? + invalid_properties.push('invalid value for "state", state cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @state.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + state == o.state + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [state].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/update_conference.rb b/lib/bandwidth-sdk/models/update_conference.rb new file mode 100644 index 00000000..854ae3e8 --- /dev/null +++ b/lib/bandwidth-sdk/models/update_conference.rb @@ -0,0 +1,372 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class UpdateConference + attr_accessor :status + + # 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` + attr_accessor :redirect_url + + attr_accessor :redirect_method + + # Basic auth username. + attr_accessor :username + + # Basic auth password. + attr_accessor :password + + # 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`. + attr_accessor :redirect_fallback_url + + attr_accessor :redirect_fallback_method + + # Basic auth username. + attr_accessor :fallback_username + + # Basic auth password. + attr_accessor :fallback_password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'status' => :'status', + :'redirect_url' => :'redirectUrl', + :'redirect_method' => :'redirectMethod', + :'username' => :'username', + :'password' => :'password', + :'redirect_fallback_url' => :'redirectFallbackUrl', + :'redirect_fallback_method' => :'redirectFallbackMethod', + :'fallback_username' => :'fallbackUsername', + :'fallback_password' => :'fallbackPassword' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'status' => :'ConferenceStateEnum', + :'redirect_url' => :'String', + :'redirect_method' => :'RedirectMethodEnum', + :'username' => :'String', + :'password' => :'String', + :'redirect_fallback_url' => :'String', + :'redirect_fallback_method' => :'RedirectMethodEnum', + :'fallback_username' => :'String', + :'fallback_password' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'status', + :'redirect_url', + :'redirect_method', + :'username', + :'password', + :'redirect_fallback_url', + :'redirect_fallback_method', + :'fallback_username', + :'fallback_password' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::UpdateConference` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::UpdateConference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = 'active' + end + + if attributes.key?(:'redirect_url') + self.redirect_url = attributes[:'redirect_url'] + end + + if attributes.key?(:'redirect_method') + self.redirect_method = attributes[:'redirect_method'] + else + self.redirect_method = 'POST' + end + + if attributes.key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'redirect_fallback_url') + self.redirect_fallback_url = attributes[:'redirect_fallback_url'] + end + + if attributes.key?(:'redirect_fallback_method') + self.redirect_fallback_method = attributes[:'redirect_fallback_method'] + else + self.redirect_fallback_method = 'POST' + end + + if attributes.key?(:'fallback_username') + self.fallback_username = attributes[:'fallback_username'] + end + + if attributes.key?(:'fallback_password') + self.fallback_password = attributes[:'fallback_password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@username.nil? && @username.to_s.length > 1024 + invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') + end + + if !@password.nil? && @password.to_s.length > 1024 + invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 1024.') + end + + if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 + invalid_properties.push('invalid value for "fallback_username", the character length must be smaller than or equal to 1024.') + end + + if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 + invalid_properties.push('invalid value for "fallback_password", the character length must be smaller than or equal to 1024.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@username.nil? && @username.to_s.length > 1024 + return false if !@password.nil? && @password.to_s.length > 1024 + return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 + return false if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 + true + end + + # Custom attribute writer method with validation + # @param [Object] username Value to be assigned + def username=(username) + if !username.nil? && username.to_s.length > 1024 + fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 1024.' + end + + @username = username + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if !password.nil? && password.to_s.length > 1024 + fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 1024.' + end + + @password = password + end + + # Custom attribute writer method with validation + # @param [Object] fallback_username Value to be assigned + def fallback_username=(fallback_username) + if !fallback_username.nil? && fallback_username.to_s.length > 1024 + fail ArgumentError, 'invalid value for "fallback_username", the character length must be smaller than or equal to 1024.' + end + + @fallback_username = fallback_username + end + + # Custom attribute writer method with validation + # @param [Object] fallback_password Value to be assigned + def fallback_password=(fallback_password) + if !fallback_password.nil? && fallback_password.to_s.length > 1024 + fail ArgumentError, 'invalid value for "fallback_password", the character length must be smaller than or equal to 1024.' + end + + @fallback_password = fallback_password + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status && + redirect_url == o.redirect_url && + redirect_method == o.redirect_method && + username == o.username && + password == o.password && + redirect_fallback_url == o.redirect_fallback_url && + redirect_fallback_method == o.redirect_fallback_method && + fallback_username == o.fallback_username && + fallback_password == o.fallback_password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [status, redirect_url, redirect_method, username, password, redirect_fallback_url, redirect_fallback_method, fallback_username, fallback_password].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/update_conference_member.rb b/lib/bandwidth-sdk/models/update_conference_member.rb new file mode 100644 index 00000000..c99f970e --- /dev/null +++ b/lib/bandwidth-sdk/models/update_conference_member.rb @@ -0,0 +1,243 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class UpdateConferenceMember + # Whether or not this member is currently muted. Members who are muted are still able to hear other participants. Updates this member's mute status. Has no effect if omitted. + attr_accessor :mute + + # Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. Updates this member's hold status. Has no effect if omitted. + attr_accessor :hold + + # If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. Modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join. + attr_accessor :call_ids_to_coach + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'mute' => :'mute', + :'hold' => :'hold', + :'call_ids_to_coach' => :'callIdsToCoach' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'mute' => :'Boolean', + :'hold' => :'Boolean', + :'call_ids_to_coach' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_ids_to_coach' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::UpdateConferenceMember` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::UpdateConferenceMember`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'mute') + self.mute = attributes[:'mute'] + end + + if attributes.key?(:'hold') + self.hold = attributes[:'hold'] + end + + if attributes.key?(:'call_ids_to_coach') + if (value = attributes[:'call_ids_to_coach']).is_a?(Array) + self.call_ids_to_coach = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + mute == o.mute && + hold == o.hold && + call_ids_to_coach == o.call_ids_to_coach + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [mute, hold, call_ids_to_coach].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/verify_code_request.rb b/lib/bandwidth-sdk/models/verify_code_request.rb new file mode 100644 index 00000000..7d1a45c5 --- /dev/null +++ b/lib/bandwidth-sdk/models/verify_code_request.rb @@ -0,0 +1,342 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class VerifyCodeRequest + # The phone number to send the mfa code to. + attr_accessor :to + + # An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\". + attr_accessor :scope + + # The time period, in minutes, to validate the mfa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively. + attr_accessor :expiration_time_in_minutes + + # The generated mfa code to check if valid. + attr_accessor :code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'to' => :'to', + :'scope' => :'scope', + :'expiration_time_in_minutes' => :'expirationTimeInMinutes', + :'code' => :'code' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'to' => :'String', + :'scope' => :'String', + :'expiration_time_in_minutes' => :'Float', + :'code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::VerifyCodeRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::VerifyCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'scope') + self.scope = attributes[:'scope'] + end + + if attributes.key?(:'expiration_time_in_minutes') + self.expiration_time_in_minutes = attributes[:'expiration_time_in_minutes'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + pattern = Regexp.new(/^\+[1-9]\d{1,14}$/) + if @to !~ pattern + invalid_properties.push("invalid value for \"to\", must conform to the pattern #{pattern}.") + end + + if @expiration_time_in_minutes.nil? + invalid_properties.push('invalid value for "expiration_time_in_minutes", expiration_time_in_minutes cannot be nil.') + end + + if @expiration_time_in_minutes > 15 + invalid_properties.push('invalid value for "expiration_time_in_minutes", must be smaller than or equal to 15.') + end + + if @expiration_time_in_minutes < 1 + invalid_properties.push('invalid value for "expiration_time_in_minutes", must be greater than or equal to 1.') + end + + if @code.nil? + invalid_properties.push('invalid value for "code", code cannot be nil.') + end + + if @code.to_s.length > 8 + invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 8.') + end + + if @code.to_s.length < 4 + invalid_properties.push('invalid value for "code", the character length must be great than or equal to 4.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @to.nil? + return false if @to !~ Regexp.new(/^\+[1-9]\d{1,14}$/) + return false if @expiration_time_in_minutes.nil? + return false if @expiration_time_in_minutes > 15 + return false if @expiration_time_in_minutes < 1 + return false if @code.nil? + return false if @code.to_s.length > 8 + return false if @code.to_s.length < 4 + true + end + + # Custom attribute writer method with validation + # @param [Object] to Value to be assigned + def to=(to) + if to.nil? + fail ArgumentError, 'to cannot be nil' + end + + pattern = Regexp.new(/^\+[1-9]\d{1,14}$/) + if to !~ pattern + fail ArgumentError, "invalid value for \"to\", must conform to the pattern #{pattern}." + end + + @to = to + end + + # Custom attribute writer method with validation + # @param [Object] expiration_time_in_minutes Value to be assigned + def expiration_time_in_minutes=(expiration_time_in_minutes) + if expiration_time_in_minutes.nil? + fail ArgumentError, 'expiration_time_in_minutes cannot be nil' + end + + if expiration_time_in_minutes > 15 + fail ArgumentError, 'invalid value for "expiration_time_in_minutes", must be smaller than or equal to 15.' + end + + if expiration_time_in_minutes < 1 + fail ArgumentError, 'invalid value for "expiration_time_in_minutes", must be greater than or equal to 1.' + end + + @expiration_time_in_minutes = expiration_time_in_minutes + end + + # Custom attribute writer method with validation + # @param [Object] code Value to be assigned + def code=(code) + if code.nil? + fail ArgumentError, 'code cannot be nil' + end + + if code.to_s.length > 8 + fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 8.' + end + + if code.to_s.length < 4 + fail ArgumentError, 'invalid value for "code", the character length must be great than or equal to 4.' + end + + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + to == o.to && + scope == o.scope && + expiration_time_in_minutes == o.expiration_time_in_minutes && + code == o.code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [to, scope, expiration_time_in_minutes, code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/verify_code_response.rb b/lib/bandwidth-sdk/models/verify_code_response.rb new file mode 100644 index 00000000..8b4b1167 --- /dev/null +++ b/lib/bandwidth-sdk/models/verify_code_response.rb @@ -0,0 +1,220 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class VerifyCodeResponse + # Whether or not the supplied code is valid. + attr_accessor :valid + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'valid' => :'valid' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'valid' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::VerifyCodeResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::VerifyCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'valid') + self.valid = attributes[:'valid'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + valid == o.valid + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [valid].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/voice_api_error.rb b/lib/bandwidth-sdk/models/voice_api_error.rb new file mode 100644 index 00000000..d2dae274 --- /dev/null +++ b/lib/bandwidth-sdk/models/voice_api_error.rb @@ -0,0 +1,238 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class VoiceApiError + attr_accessor :type + + attr_accessor :description + + attr_accessor :id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'description' => :'description', + :'id' => :'id' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'description' => :'String', + :'id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::VoiceApiError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::VoiceApiError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + description == o.description && + id == o.id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, description, id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/voice_code_response.rb b/lib/bandwidth-sdk/models/voice_code_response.rb new file mode 100644 index 00000000..84cd5b97 --- /dev/null +++ b/lib/bandwidth-sdk/models/voice_code_response.rb @@ -0,0 +1,220 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class VoiceCodeResponse + # Programmable Voice API Call ID. + attr_accessor :call_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'call_id' => :'callId' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'call_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::VoiceCodeResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::VoiceCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + call_id == o.call_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [call_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/version.rb b/lib/bandwidth-sdk/version.rb new file mode 100644 index 00000000..ab9b8e47 --- /dev/null +++ b/lib/bandwidth-sdk/version.rb @@ -0,0 +1,15 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +module Bandwidth + VERSION = '11.0.0' +end diff --git a/openapi-config.yml b/openapi-config.yml new file mode 100644 index 00000000..6fd5c7db --- /dev/null +++ b/openapi-config.yml @@ -0,0 +1,11 @@ +gemAuthor: Bandwidth +gemAuthorEmail: dx@bandwidth.com +gemDescription: The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs +gemHomepage: https://github.com/Bandwidth/ruby-sdk +gemLicense: MIT +gemName: bandwidth-sdk +gemRequiredRubyVersion: '>=2.4' +gemSummary: Bandwidth Ruby SDK +gemVersion: 11.0.0 +library: faraday +moduleName: Bandwidth \ No newline at end of file diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 00000000..7f8d0939 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "6.2.0" + } +} diff --git a/ruby-notes.md b/ruby-notes.md new file mode 100644 index 00000000..95501dbc --- /dev/null +++ b/ruby-notes.md @@ -0,0 +1,71 @@ +# Config and Basic Auth + +## APIMatic + +```ruby +bandwidth_client = Bandwidth::Client.new( + messaging_basic_auth_user_name: BW_USERNAME, + messaging_basic_auth_password: BW_PASSWORD +) +messaging_client = bandwidth_client.messaging_client.client +``` + +## OpenAPIGenerator + +```ruby +OpenapiClient.configure do |config| + config.username = BW_USERNAME + config.password = BW_PASSWORD +end +messaging_client = OpenapiClient::MessagesApi.new() +``` + +# Send SMS + +## APIMatic +```ruby +account_id = BW_ACCOUNT_ID + +body = MessageRequest.new +body.application_id = BW_MESSAGING_APPLICATION_ID +body.to = [USER_NUMBER] +body.from = BW_NUMBER +body.text = "Hello World!" + +messaging_client.create_message(account_id, body) +``` + +## OpenAPIGenerator + +```ruby +account_id = BW_ACCOUNT_ID + +body = OpenapiClient::MessageRequest.new( + application_id: BW_MESSAGING_APPLICATION_ID.to_s, + to: [USER_NUMBER], + from: BW_NUMBER, + text: "ruby new sdk test" +) + +messaging_client.create_message(account_id, body) +``` + +# OpenApiGenerator Quirks + +* The Get Messages function defaults its return type to 'File', this downloads a temporary file that must be written to the disk to be accessed. + * Adding `debug_return_type: 'String'` to the function arguments overrides this and saves the file data as a string. +* All of the files in `openapi_client.rb` needed their `require` to be changed to `require_relative`. +* Using the configs default HTTP client, typhoeus, generates libcurl issues on Windows Machines. +* Switching to Farady for the HTTP client fixes the libcurl issue, but the SDK uses a deprecated form of Faraday's `basic_auth`. This looks like its fixed in a PR on their repo, but its not in prod yet. Changing `conn.basic_auth(config.username, config.password)` to `conn.request(:basic_auth, config.username, config.password)` in `api_client.rb` line 59 is the fix. +* The sdk generator writes code in the gemspec file that cannot be run in Windows, resulting in an empty gem if used. + * `s.files = Dir['./**/*']` and `s.test_files = Dir['spec/*']` fixes this +* To get a custom url, instead of setting the `environment` parameter in the config, you must make a custom operation in `configuration.rb` +``` ruby +"Pipedream": [ + { + url: "https://d6979da481772c167be0edcd10eb64d7.m.pipedream.net", + description: "testing" + } + ], +``` +this must go in `operation_server_settings` and then `:operation => :"Pipedream",` must go in `new_options = opts.merge(` for the method you are calling within the `?_api.rb` file for the specific api diff --git a/spec/api/calls_api_spec.rb b/spec/api/calls_api_spec.rb new file mode 100644 index 00000000..72b7df75 --- /dev/null +++ b/spec/api/calls_api_spec.rb @@ -0,0 +1,89 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Bandwidth::CallsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'CallsApi' do + before do + # run before each test + @api_instance = Bandwidth::CallsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of CallsApi' do + it 'should create an instance of CallsApi' do + expect(@api_instance).to be_instance_of(Bandwidth::CallsApi) + end + end + + # unit tests for create_call + # Create Call + # Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. <b>Please note:</b> Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed. + # @param account_id Your Bandwidth Account ID + # @param create_call JSON object containing information to create an outbound call + # @param [Hash] opts the optional parameters + # @return [CreateCallResponse] + describe 'create_call test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_call_state + # Get Call State Information + # Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: 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 HTTP 404 response. + # @param account_id Your Bandwidth Account ID + # @param call_id Programmable Voice API Call ID + # @param [Hash] opts the optional parameters + # @return [CallState] + describe 'get_call_state test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_call + # Update Call + # Interrupts and redirects a call to a different URL that should return a BXML document. + # @param account_id Your Bandwidth Account ID + # @param call_id Programmable Voice API Call ID + # @param update_call JSON object containing information to redirect an existing call to a new BXML document + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_call test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_call_bxml + # Update Call BXML + # Interrupts and replaces an active call's BXML document. + # @param account_id Your Bandwidth Account ID + # @param call_id Programmable Voice API Call ID + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_call_bxml test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/api/conferences_api_spec.rb b/spec/api/conferences_api_spec.rb new file mode 100644 index 00000000..1f7353cf --- /dev/null +++ b/spec/api/conferences_api_spec.rb @@ -0,0 +1,163 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Bandwidth::ConferencesApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ConferencesApi' do + before do + # run before each test + @api_instance = Bandwidth::ConferencesApi.new + end + + after do + # run after each test + end + + describe 'test an instance of ConferencesApi' do + it 'should create an instance of ConferencesApi' do + expect(@api_instance).to be_instance_of(Bandwidth::ConferencesApi) + end + end + + # unit tests for download_conference_recording + # Download Conference Recording + # Downloads the specified recording file. + # @param account_id Your Bandwidth Account ID + # @param conference_id Programmable Voice API Conference ID + # @param recording_id Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [File] + describe 'download_conference_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_conference + # Get Conference Information + # Returns information about the specified conference. + # @param account_id Your Bandwidth Account ID + # @param conference_id Programmable Voice API Conference ID + # @param [Hash] opts the optional parameters + # @return [Conference] + describe 'get_conference test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_conference_member + # Get Conference Member + # Returns information about the specified conference member. + # @param account_id Your Bandwidth Account ID + # @param conference_id Programmable Voice API Conference ID + # @param member_id Programmable Voice API Conference Member ID + # @param [Hash] opts the optional parameters + # @return [ConferenceMember] + describe 'get_conference_member test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_conference_recording + # Get Conference Recording Information + # Returns metadata for the specified recording. + # @param account_id Your Bandwidth Account ID + # @param conference_id Programmable Voice API Conference ID + # @param recording_id Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [ConferenceRecordingMetadata] + describe 'get_conference_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for list_conference_recordings + # Get Conference Recordings + # Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. + # @param account_id Your Bandwidth Account ID + # @param conference_id Programmable Voice API Conference ID + # @param [Hash] opts the optional parameters + # @return [Array] + describe 'list_conference_recordings test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for list_conferences + # Get Conferences + # Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences 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 conference records. + # @param account_id Your Bandwidth Account ID + # @param [Hash] opts the optional parameters + # @option opts [String] :name Filter results by the `name` field. + # @option opts [String] :min_created_time Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). + # @option opts [String] :max_created_time Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). + # @option opts [Integer] :page_size Specifies the max number of conferences that will be returned. + # @option opts [String] :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. + # @return [Array] + describe 'list_conferences test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_conference + # Update Conference + # Update the conference state. + # @param account_id Your Bandwidth Account ID + # @param conference_id Programmable Voice API Conference ID + # @param update_conference + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_conference test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_conference_bxml + # Update Conference BXML + # Update the conference BXML document. + # @param account_id Your Bandwidth Account ID + # @param conference_id Programmable Voice API Conference ID + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_conference_bxml test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_conference_member + # Update Conference Member + # Updates settings for a particular conference member. + # @param account_id Your Bandwidth Account ID + # @param conference_id Programmable Voice API Conference ID + # @param member_id Programmable Voice API Conference Member ID + # @param update_conference_member + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_conference_member test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/api/media_api_spec.rb b/spec/api/media_api_spec.rb new file mode 100644 index 00000000..829887ff --- /dev/null +++ b/spec/api/media_api_spec.rb @@ -0,0 +1,90 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Bandwidth::MediaApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'MediaApi' do + before do + # run before each test + @api_instance = Bandwidth::MediaApi.new + end + + after do + # run after each test + end + + describe 'test an instance of MediaApi' do + it 'should create an instance of MediaApi' do + expect(@api_instance).to be_instance_of(Bandwidth::MediaApi) + end + end + + # unit tests for delete_media + # Delete Media + # Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name. + # @param account_id Your Bandwidth Account ID. + # @param media_id Media ID to retrieve. + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_media test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_media + # Get Media + # Downloads a media file you previously uploaded. + # @param account_id Your Bandwidth Account ID. + # @param media_id Media ID to retrieve. + # @param [Hash] opts the optional parameters + # @return [File] + describe 'get_media test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for list_media + # List Media + # Gets a list of your media files. No query parameters are supported. + # @param account_id Your Bandwidth Account ID. + # @param [Hash] opts the optional parameters + # @option opts [String] :continuation_token Continuation token used to retrieve subsequent media. + # @return [Array] + describe 'list_media test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for upload_media + # Upload Media + # Upload a file. You may add headers to the request in order to provide some control to your media file. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). + # @param account_id Your Bandwidth Account ID. + # @param media_id Media ID to retrieve. + # @param body + # @param [Hash] opts the optional parameters + # @option opts [String] :content_type The media type of the entity-body. + # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + # @return [nil] + describe 'upload_media test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/api/messages_api_spec.rb b/spec/api/messages_api_spec.rb new file mode 100644 index 00000000..266d42e0 --- /dev/null +++ b/spec/api/messages_api_spec.rb @@ -0,0 +1,73 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Bandwidth::MessagesApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'MessagesApi' do + before do + # run before each test + @api_instance = Bandwidth::MessagesApi.new + end + + after do + # run after each test + end + + describe 'test an instance of MessagesApi' do + it 'should create an instance of MessagesApi' do + expect(@api_instance).to be_instance_of(Bandwidth::MessagesApi) + end + end + + # unit tests for create_message + # Create Message + # Endpoint for sending text messages and picture messages using V2 messaging. + # @param account_id Your Bandwidth Account ID. + # @param message_request + # @param [Hash] opts the optional parameters + # @return [Message] + describe 'create_message test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for list_messages + # List Messages + # Returns a list of messages based on query parameters. + # @param account_id Your Bandwidth Account ID. + # @param [Hash] opts the optional parameters + # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + # @option opts [ListMessageDirectionEnum] :message_direction The direction of the message. One of INBOUND OUTBOUND. + # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + # @option opts [MessageTypeEnum] :message_type The type of message. Either sms or mms. + # @option opts [Integer] :error_code The error code of the message. + # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. + # @option opts [String] :page_token A base64 encoded value used for pagination of results. + # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + # @return [MessagesList] + describe 'list_messages test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/api/mfa_api_spec.rb b/spec/api/mfa_api_spec.rb new file mode 100644 index 00000000..7865d905 --- /dev/null +++ b/spec/api/mfa_api_spec.rb @@ -0,0 +1,74 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Bandwidth::MFAApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'MFAApi' do + before do + # run before each test + @api_instance = Bandwidth::MFAApi.new + end + + after do + # run after each test + end + + describe 'test an instance of MFAApi' do + it 'should create an instance of MFAApi' do + expect(@api_instance).to be_instance_of(Bandwidth::MFAApi) + end + end + + # unit tests for generate_messaging_code + # Messaging Authentication Code + # Send an MFA code via text message (SMS). + # @param account_id Bandwidth Account ID with Voice service enabled. + # @param code_request MFA code request body. + # @param [Hash] opts the optional parameters + # @return [MessagingCodeResponse] + describe 'generate_messaging_code test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for generate_voice_code + # Voice Authentication Code + # Send an MFA Code via a phone call. + # @param account_id Bandwidth Account ID with Voice service enabled. + # @param code_request MFA code request body. + # @param [Hash] opts the optional parameters + # @return [VoiceCodeResponse] + describe 'generate_voice_code test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for verify_code + # Verify Authentication Code + # Verify a previously sent MFA code. + # @param account_id Bandwidth Account ID with Voice service enabled. + # @param verify_code_request MFA code verify request body. + # @param [Hash] opts the optional parameters + # @return [VerifyCodeResponse] + describe 'verify_code test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/api/participants_api_spec.rb b/spec/api/participants_api_spec.rb new file mode 100644 index 00000000..36643c2c --- /dev/null +++ b/spec/api/participants_api_spec.rb @@ -0,0 +1,74 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Bandwidth::ParticipantsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ParticipantsApi' do + before do + # run before each test + @api_instance = Bandwidth::ParticipantsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of ParticipantsApi' do + it 'should create an instance of ParticipantsApi' do + expect(@api_instance).to be_instance_of(Bandwidth::ParticipantsApi) + end + end + + # unit tests for create_participant + # Create Participant + # Create a new participant under this account. Participants are idempotent, so relevant parameters must be set in this function if desired. + # @param account_id Account ID + # @param [Hash] opts the optional parameters + # @option opts [CreateParticipantRequest] :create_participant_request Create participant request body. + # @return [CreateParticipantResponse] + describe 'create_participant test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_participant + # Delete Participant + # Delete participant by ID. + # @param account_id Account ID + # @param participant_id Participant ID + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_participant test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_participant + # Get Participant + # Get participant by ID. + # @param account_id Account ID + # @param participant_id Participant ID + # @param [Hash] opts the optional parameters + # @return [Participant] + describe 'get_participant test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/api/phone_number_lookup_api_spec.rb b/spec/api/phone_number_lookup_api_spec.rb new file mode 100644 index 00000000..7ebb5b72 --- /dev/null +++ b/spec/api/phone_number_lookup_api_spec.rb @@ -0,0 +1,61 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Bandwidth::PhoneNumberLookupApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PhoneNumberLookupApi' do + before do + # run before each test + @api_instance = Bandwidth::PhoneNumberLookupApi.new + end + + after do + # run after each test + end + + describe 'test an instance of PhoneNumberLookupApi' do + it 'should create an instance of PhoneNumberLookupApi' do + expect(@api_instance).to be_instance_of(Bandwidth::PhoneNumberLookupApi) + end + end + + # unit tests for create_lookup + # Create Lookup + # Create a Phone Number Lookup Request. + # @param account_id The ID of the Bandwidth account that the user belongs to. + # @param lookup_request Phone number lookup request. + # @param [Hash] opts the optional parameters + # @return [CreateLookupResponse] + describe 'create_lookup test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_lookup_status + # Get Lookup Request Status + # Get an existing Phone Number Lookup Request. + # @param account_id The ID of the Bandwidth account that the user belongs to. + # @param request_id The phone number lookup request ID from Bandwidth. + # @param [Hash] opts the optional parameters + # @return [LookupStatus] + describe 'get_lookup_status test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/api/recordings_api_spec.rb b/spec/api/recordings_api_spec.rb new file mode 100644 index 00000000..658c55f0 --- /dev/null +++ b/spec/api/recordings_api_spec.rb @@ -0,0 +1,177 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Bandwidth::RecordingsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'RecordingsApi' do + before do + # run before each test + @api_instance = Bandwidth::RecordingsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of RecordingsApi' do + it 'should create an instance of RecordingsApi' do + expect(@api_instance).to be_instance_of(Bandwidth::RecordingsApi) + end + end + + # unit tests for delete_call_transcription + # Delete Transcription + # 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 + # @param call_id Programmable Voice API Call ID + # @param recording_id Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_call_transcription test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_recording + # Delete Recording + # 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 + # @param call_id Programmable Voice API Call ID + # @param recording_id Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_recording_media + # Delete Recording Media + # Deletes the specified recording's media. + # @param account_id Your Bandwidth Account ID + # @param call_id Programmable Voice API Call ID + # @param recording_id Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_recording_media test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for download_call_recording + # Download Recording + # Downloads the specified recording. + # @param account_id Your Bandwidth Account ID + # @param call_id Programmable Voice API Call ID + # @param recording_id Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [File] + describe 'download_call_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_call_recording + # Get Call Recording + # Returns metadata for the specified recording. + # @param account_id Your Bandwidth Account ID + # @param call_id Programmable Voice API Call ID + # @param recording_id Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [CallRecordingMetadata] + describe 'get_call_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_call_transcription + # 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 [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/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 + # @param call_id Programmable Voice API Call ID + # @param recording_id Programmable Voice API Recording ID + # @param [Hash] opts the optional parameters + # @return [TranscriptionList] + describe 'get_call_transcription test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for list_account_call_recordings + # Get Call Recordings + # Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria. + # @param account_id Your Bandwidth Account ID + # @param [Hash] opts the optional parameters + # @option opts [String] :to Filter results by the `to` field. + # @option opts [String] :from Filter results by the `from` field. + # @option opts [String] :min_start_time Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). + # @option opts [String] :max_start_time Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). + # @return [Array] + describe 'list_account_call_recordings test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for list_call_recordings + # List Call Recordings + # Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. + # @param account_id Your Bandwidth Account ID + # @param call_id Programmable Voice API Call ID + # @param [Hash] opts the optional parameters + # @return [Array] + describe 'list_call_recordings test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for transcribe_call_recording + # Create Transcription Request + # Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. + # @param account_id Your Bandwidth Account ID + # @param call_id Programmable Voice API Call ID + # @param recording_id Programmable Voice API Recording ID + # @param transcribe_recording + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'transcribe_call_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_call_recording_state + # Update Recording + # Pause or resume a recording on an active phone call. + # @param account_id Your Bandwidth Account ID + # @param call_id Programmable Voice API Call ID + # @param update_call_recording + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_call_recording_state test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/api/sessions_api_spec.rb b/spec/api/sessions_api_spec.rb new file mode 100644 index 00000000..998dc22e --- /dev/null +++ b/spec/api/sessions_api_spec.rb @@ -0,0 +1,145 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Bandwidth::SessionsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SessionsApi' do + before do + # run before each test + @api_instance = Bandwidth::SessionsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of SessionsApi' do + it 'should create an instance of SessionsApi' do + expect(@api_instance).to be_instance_of(Bandwidth::SessionsApi) + end + end + + # unit tests for add_participant_to_session + # Add Participant to Session + # Add a participant to a session. Subscriptions can optionally be provided as part of this call. + # @param account_id Account ID + # @param session_id Session ID + # @param participant_id Participant ID + # @param [Hash] opts the optional parameters + # @option opts [Subscriptions] :subscriptions The Body describes an optional set of subscriptions to apply to the participant. Calling this endpoint with no/empty body will only add the participant to the session, and will not subscribe the Participant to any media. The request body for this endpoint is OPTIONAL and provided as a convenience to avoid additional calls to the Update Participant Subscriptions endpoint. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created + # @return [nil] + describe 'add_participant_to_session test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_session + # Create Session + # Create a new session. Sessions are idempotent, so relevant parameters must be set in this function if desired. + # @param account_id Account ID + # @param [Hash] opts the optional parameters + # @option opts [Session] :session Create session request body. + # @return [Session] + describe 'create_session test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_session + # Delete Session + # Delete session by ID. + # @param account_id Account ID + # @param session_id Session ID + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_session test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_participant_subscriptions + # Get Participant Subscriptions + # Get a participant's subscriptions. + # @param account_id Account ID + # @param session_id Session ID + # @param participant_id Participant ID + # @param [Hash] opts the optional parameters + # @return [Subscriptions] + describe 'get_participant_subscriptions test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_session + # Get Session + # Get session by ID. + # @param account_id Account ID + # @param session_id Session ID + # @param [Hash] opts the optional parameters + # @return [Session] + describe 'get_session test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for list_session_participants + # List Participants in Session + # List participants in a session. + # @param account_id Account ID + # @param session_id Session ID + # @param [Hash] opts the optional parameters + # @return [Array] + describe 'list_session_participants test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for remove_participant_from_session + # Remove Participant from Session + # Remove a participant from a session. This will automatically remove any subscriptions the participant has associated with this session. + # @param account_id Account ID + # @param session_id Session ID + # @param participant_id Participant ID + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'remove_participant_from_session test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_participant_subscriptions + # Update Participant Subscriptions + # Update a participant's subscriptions. This is a full update that will replace the participant's subscriptions. It allows subscription to the entire Session, a subset list of Participants in that Session, or specific media streams on any of the listed Participants. First call `getParticipantSubscriptions` if you need the current subscriptions. Calling this API with no `Subscriptions` object to remove all subscriptions. + # @param account_id Account ID + # @param session_id Session ID + # @param participant_id Participant ID + # @param [Hash] opts the optional parameters + # @option opts [Subscriptions] :subscriptions The body describes the desired subscriptions for the Participant. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created + # @return [nil] + describe 'update_participant_subscriptions test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/api/statistics_api_spec.rb b/spec/api/statistics_api_spec.rb new file mode 100644 index 00000000..bbeb8c9c --- /dev/null +++ b/spec/api/statistics_api_spec.rb @@ -0,0 +1,47 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Bandwidth::StatisticsApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StatisticsApi' do + before do + # run before each test + @api_instance = Bandwidth::StatisticsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of StatisticsApi' do + it 'should create an instance of StatisticsApi' do + expect(@api_instance).to be_instance_of(Bandwidth::StatisticsApi) + end + end + + # unit tests for get_statistics + # Get Account Statistics + # Returns details about the current state of the account. + # @param account_id Your Bandwidth Account ID + # @param [Hash] opts the optional parameters + # @return [AccountStatistics] + describe 'get_statistics test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb new file mode 100644 index 00000000..c712477f --- /dev/null +++ b/spec/api_client_spec.rb @@ -0,0 +1,188 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' + +describe Bandwidth::ApiClient do + context 'initialization' do + context 'URL stuff' do + context 'host' do + it 'removes http from host' do + Bandwidth.configure { |c| c.host = 'http://example.com' } + expect(Bandwidth::Configuration.default.host).to eq('example.com') + end + + it 'removes https from host' do + Bandwidth.configure { |c| c.host = 'https://wookiee.com' } + expect(Bandwidth::ApiClient.default.config.host).to eq('wookiee.com') + end + + it 'removes trailing path from host' do + Bandwidth.configure { |c| c.host = 'hobo.com/v4' } + expect(Bandwidth::Configuration.default.host).to eq('hobo.com') + end + end + + context 'base_path' do + it "prepends a slash to base_path" do + Bandwidth.configure { |c| c.base_path = 'v4/dog' } + expect(Bandwidth::Configuration.default.base_path).to eq('/v4/dog') + end + + it "doesn't prepend a slash if one is already there" do + Bandwidth.configure { |c| c.base_path = '/v4/dog' } + expect(Bandwidth::Configuration.default.base_path).to eq('/v4/dog') + end + + it "ends up as a blank string if nil" do + Bandwidth.configure { |c| c.base_path = nil } + expect(Bandwidth::Configuration.default.base_path).to eq('') + end + end + end + end + + describe '#deserialize' do + it "handles Array" do + api_client = Bandwidth::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '[12, 34]') + data = api_client.deserialize(response, 'Array') + expect(data).to be_instance_of(Array) + expect(data).to eq([12, 34]) + end + + it 'handles Array>' do + api_client = Bandwidth::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '[[12, 34], [56]]') + data = api_client.deserialize(response, 'Array>') + expect(data).to be_instance_of(Array) + expect(data).to eq([[12, 34], [56]]) + end + + it 'handles Hash' do + api_client = Bandwidth::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '{"message": "Hello"}') + data = api_client.deserialize(response, 'Hash') + expect(data).to be_instance_of(Hash) + expect(data).to eq(:message => 'Hello') + end + end + + describe "#object_to_hash" do + it 'ignores nils and includes empty arrays' do + # uncomment below to test object_to_hash for model + # api_client = Bandwidth::ApiClient.new + # _model = Bandwidth::ModelName.new + # update the model attribute below + # _model.id = 1 + # update the expected value (hash) below + # expected = {id: 1, name: '', tags: []} + # expect(api_client.object_to_hash(_model)).to eq(expected) + end + end + + describe '#build_collection_param' do + let(:param) { ['aa', 'bb', 'cc'] } + let(:api_client) { Bandwidth::ApiClient.new } + + it 'works for csv' do + expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') + end + + it 'works for ssv' do + expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc') + end + + it 'works for tsv' do + expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") + end + + it 'works for pipes' do + expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc') + end + + it 'works for multi' do + expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) + end + + it 'fails for invalid collection format' do + expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') + end + end + + describe '#json_mime?' do + let(:api_client) { Bandwidth::ApiClient.new } + + it 'works' do + expect(api_client.json_mime?(nil)).to eq false + expect(api_client.json_mime?('')).to eq false + + expect(api_client.json_mime?('application/json')).to eq true + expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true + expect(api_client.json_mime?('APPLICATION/JSON')).to eq true + + expect(api_client.json_mime?('application/xml')).to eq false + expect(api_client.json_mime?('text/plain')).to eq false + expect(api_client.json_mime?('application/jsonp')).to eq false + end + end + + describe '#select_header_accept' do + let(:api_client) { Bandwidth::ApiClient.new } + + it 'works' do + expect(api_client.select_header_accept(nil)).to be_nil + expect(api_client.select_header_accept([])).to be_nil + + expect(api_client.select_header_accept(['application/json'])).to eq('application/json') + expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + + expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml') + expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') + end + end + + describe '#select_header_content_type' do + let(:api_client) { Bandwidth::ApiClient.new } + + it 'works' do + expect(api_client.select_header_content_type(nil)).to be_nil + expect(api_client.select_header_content_type([])).to be_nil + + expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') + expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml') + expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') + end + end + + describe '#sanitize_filename' do + let(:api_client) { Bandwidth::ApiClient.new } + + it 'works' do + expect(api_client.sanitize_filename('sun')).to eq('sun') + expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif') + end + end +end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb new file mode 100644 index 00000000..e75eac3d --- /dev/null +++ b/spec/configuration_spec.rb @@ -0,0 +1,42 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' + +describe Bandwidth::Configuration do + let(:config) { Bandwidth::Configuration.default } + + before(:each) do + # uncomment below to setup host and base_path + # require 'URI' + # uri = URI.parse("http://localhost") + # Bandwidth.configure do |c| + # c.host = uri.host + # c.base_path = uri.path + # end + end + + describe '#base_url' do + it 'should have the default value' do + # uncomment below to test default value of the base path + # expect(config.base_url).to eq("http://localhost") + end + + it 'should remove trailing slashes' do + [nil, '', '/', '//'].each do |base_path| + config.base_path = base_path + # uncomment below to test trailing slashes + # expect(config.base_url).to eq("http://localhost") + end + end + end +end diff --git a/spec/models/account_statistics_spec.rb b/spec/models/account_statistics_spec.rb new file mode 100644 index 00000000..851f5ade --- /dev/null +++ b/spec/models/account_statistics_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::AccountStatistics +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::AccountStatistics do + let(:instance) { Bandwidth::AccountStatistics.new } + + describe 'test an instance of AccountStatistics' do + it 'should create an instance of AccountStatistics' do + expect(instance).to be_instance_of(Bandwidth::AccountStatistics) + end + end + describe 'test attribute "current_call_queue_size"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "max_call_queue_size"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/answer_callback_spec.rb b/spec/models/answer_callback_spec.rb new file mode 100644 index 00000000..b509abe8 --- /dev/null +++ b/spec/models/answer_callback_spec.rb @@ -0,0 +1,112 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::AnswerCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::AnswerCallback do + let(:instance) { Bandwidth::AnswerCallback.new } + + describe 'test an instance of AnswerCallback' do + it 'should create an instance of AnswerCallback' do + expect(instance).to be_instance_of(Bandwidth::AnswerCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "machine_detection_result"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/bridge_complete_callback_spec.rb b/spec/models/bridge_complete_callback_spec.rb new file mode 100644 index 00000000..7f7dd7b2 --- /dev/null +++ b/spec/models/bridge_complete_callback_spec.rb @@ -0,0 +1,124 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::BridgeCompleteCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::BridgeCompleteCallback do + let(:instance) { Bandwidth::BridgeCompleteCallback.new } + + describe 'test an instance of BridgeCompleteCallback' do + it 'should create an instance of BridgeCompleteCallback' do + expect(instance).to be_instance_of(Bandwidth::BridgeCompleteCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "cause"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "error_message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "error_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/bridge_target_complete_callback_spec.rb b/spec/models/bridge_target_complete_callback_spec.rb new file mode 100644 index 00000000..941df01e --- /dev/null +++ b/spec/models/bridge_target_complete_callback_spec.rb @@ -0,0 +1,106 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::BridgeTargetCompleteCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::BridgeTargetCompleteCallback do + let(:instance) { Bandwidth::BridgeTargetCompleteCallback.new } + + describe 'test an instance of BridgeTargetCompleteCallback' do + it 'should create an instance of BridgeTargetCompleteCallback' do + expect(instance).to be_instance_of(Bandwidth::BridgeTargetCompleteCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/call_direction_enum_spec.rb b/spec/models/call_direction_enum_spec.rb new file mode 100644 index 00000000..01899927 --- /dev/null +++ b/spec/models/call_direction_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CallDirectionEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CallDirectionEnum do + let(:instance) { Bandwidth::CallDirectionEnum.new } + + describe 'test an instance of CallDirectionEnum' do + it 'should create an instance of CallDirectionEnum' do + expect(instance).to be_instance_of(Bandwidth::CallDirectionEnum) + end + end +end diff --git a/spec/models/call_recording_metadata_spec.rb b/spec/models/call_recording_metadata_spec.rb new file mode 100644 index 00000000..8894b7ce --- /dev/null +++ b/spec/models/call_recording_metadata_spec.rb @@ -0,0 +1,136 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CallRecordingMetadata +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CallRecordingMetadata do + let(:instance) { Bandwidth::CallRecordingMetadata.new } + + describe 'test an instance of CallRecordingMetadata' do + it 'should create an instance of CallRecordingMetadata' do + expect(instance).to be_instance_of(Bandwidth::CallRecordingMetadata) + end + end + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_caller_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "duration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "channels"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "file_format"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transcription"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/call_state_enum_spec.rb b/spec/models/call_state_enum_spec.rb new file mode 100644 index 00000000..4c340713 --- /dev/null +++ b/spec/models/call_state_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CallStateEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CallStateEnum do + let(:instance) { Bandwidth::CallStateEnum.new } + + describe 'test an instance of CallStateEnum' do + it 'should create an instance of CallStateEnum' do + expect(instance).to be_instance_of(Bandwidth::CallStateEnum) + end + end +end diff --git a/spec/models/call_state_spec.rb b/spec/models/call_state_spec.rb new file mode 100644 index 00000000..fb758eb8 --- /dev/null +++ b/spec/models/call_state_spec.rb @@ -0,0 +1,136 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CallState +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CallState do + let(:instance) { Bandwidth::CallState.new } + + describe 'test an instance of CallState' do + it 'should create an instance of CallState' do + expect(instance).to be_instance_of(Bandwidth::CallState) + end + end + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "state"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "stir_shaken"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "identity"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disconnect_cause"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "error_message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "error_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_update"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/callback_method_enum_spec.rb b/spec/models/callback_method_enum_spec.rb new file mode 100644 index 00000000..abe6c97f --- /dev/null +++ b/spec/models/callback_method_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CallbackMethodEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CallbackMethodEnum do + let(:instance) { Bandwidth::CallbackMethodEnum.new } + + describe 'test an instance of CallbackMethodEnum' do + it 'should create an instance of CallbackMethodEnum' do + expect(instance).to be_instance_of(Bandwidth::CallbackMethodEnum) + end + end +end diff --git a/spec/models/code_request_spec.rb b/spec/models/code_request_spec.rb new file mode 100644 index 00000000..a2a8754f --- /dev/null +++ b/spec/models/code_request_spec.rb @@ -0,0 +1,64 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CodeRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CodeRequest do + let(:instance) { Bandwidth::CodeRequest.new } + + describe 'test an instance of CodeRequest' do + it 'should create an instance of CodeRequest' do + expect(instance).to be_instance_of(Bandwidth::CodeRequest) + end + end + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "scope"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "digits"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/conference_completed_callback_spec.rb b/spec/models/conference_completed_callback_spec.rb new file mode 100644 index 00000000..4818af21 --- /dev/null +++ b/spec/models/conference_completed_callback_spec.rb @@ -0,0 +1,58 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ConferenceCompletedCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ConferenceCompletedCallback do + let(:instance) { Bandwidth::ConferenceCompletedCallback.new } + + describe 'test an instance of ConferenceCompletedCallback' do + it 'should create an instance of ConferenceCompletedCallback' do + expect(instance).to be_instance_of(Bandwidth::ConferenceCompletedCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "conference_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/conference_created_callback_spec.rb b/spec/models/conference_created_callback_spec.rb new file mode 100644 index 00000000..91de0613 --- /dev/null +++ b/spec/models/conference_created_callback_spec.rb @@ -0,0 +1,58 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ConferenceCreatedCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ConferenceCreatedCallback do + let(:instance) { Bandwidth::ConferenceCreatedCallback.new } + + describe 'test an instance of ConferenceCreatedCallback' do + it 'should create an instance of ConferenceCreatedCallback' do + expect(instance).to be_instance_of(Bandwidth::ConferenceCreatedCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "conference_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/conference_member_exit_callback_spec.rb b/spec/models/conference_member_exit_callback_spec.rb new file mode 100644 index 00000000..74b8b58e --- /dev/null +++ b/spec/models/conference_member_exit_callback_spec.rb @@ -0,0 +1,76 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ConferenceMemberExitCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ConferenceMemberExitCallback do + let(:instance) { Bandwidth::ConferenceMemberExitCallback.new } + + describe 'test an instance of ConferenceMemberExitCallback' do + it 'should create an instance of ConferenceMemberExitCallback' do + expect(instance).to be_instance_of(Bandwidth::ConferenceMemberExitCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "conference_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/conference_member_join_callback_spec.rb b/spec/models/conference_member_join_callback_spec.rb new file mode 100644 index 00000000..70cfe293 --- /dev/null +++ b/spec/models/conference_member_join_callback_spec.rb @@ -0,0 +1,76 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ConferenceMemberJoinCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ConferenceMemberJoinCallback do + let(:instance) { Bandwidth::ConferenceMemberJoinCallback.new } + + describe 'test an instance of ConferenceMemberJoinCallback' do + it 'should create an instance of ConferenceMemberJoinCallback' do + expect(instance).to be_instance_of(Bandwidth::ConferenceMemberJoinCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "conference_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/conference_member_spec.rb b/spec/models/conference_member_spec.rb new file mode 100644 index 00000000..45ecbddc --- /dev/null +++ b/spec/models/conference_member_spec.rb @@ -0,0 +1,64 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ConferenceMember +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ConferenceMember do + let(:instance) { Bandwidth::ConferenceMember.new } + + describe 'test an instance of ConferenceMember' do + it 'should create an instance of ConferenceMember' do + expect(instance).to be_instance_of(Bandwidth::ConferenceMember) + end + end + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "conference_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "member_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "mute"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "hold"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_ids_to_coach"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/conference_recording_available_callback_spec.rb b/spec/models/conference_recording_available_callback_spec.rb new file mode 100644 index 00000000..d2815d66 --- /dev/null +++ b/spec/models/conference_recording_available_callback_spec.rb @@ -0,0 +1,112 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ConferenceRecordingAvailableCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ConferenceRecordingAvailableCallback do + let(:instance) { Bandwidth::ConferenceRecordingAvailableCallback.new } + + describe 'test an instance of ConferenceRecordingAvailableCallback' do + it 'should create an instance of ConferenceRecordingAvailableCallback' do + expect(instance).to be_instance_of(Bandwidth::ConferenceRecordingAvailableCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "conference_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "channels"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "duration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "file_format"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/conference_recording_metadata_spec.rb b/spec/models/conference_recording_metadata_spec.rb new file mode 100644 index 00000000..a8f1f83d --- /dev/null +++ b/spec/models/conference_recording_metadata_spec.rb @@ -0,0 +1,94 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ConferenceRecordingMetadata +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ConferenceRecordingMetadata do + let(:instance) { Bandwidth::ConferenceRecordingMetadata.new } + + describe 'test an instance of ConferenceRecordingMetadata' do + it 'should create an instance of ConferenceRecordingMetadata' do + expect(instance).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) + end + end + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "conference_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "duration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "channels"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "file_format"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/conference_redirect_callback_spec.rb b/spec/models/conference_redirect_callback_spec.rb new file mode 100644 index 00000000..48d6f44a --- /dev/null +++ b/spec/models/conference_redirect_callback_spec.rb @@ -0,0 +1,58 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ConferenceRedirectCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ConferenceRedirectCallback do + let(:instance) { Bandwidth::ConferenceRedirectCallback.new } + + describe 'test an instance of ConferenceRedirectCallback' do + it 'should create an instance of ConferenceRedirectCallback' do + expect(instance).to be_instance_of(Bandwidth::ConferenceRedirectCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "conference_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/conference_spec.rb b/spec/models/conference_spec.rb new file mode 100644 index 00000000..ab02d8b2 --- /dev/null +++ b/spec/models/conference_spec.rb @@ -0,0 +1,76 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::Conference +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::Conference do + let(:instance) { Bandwidth::Conference.new } + + describe 'test an instance of Conference' do + it 'should create an instance of Conference' do + expect(instance).to be_instance_of(Bandwidth::Conference) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "created_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "completed_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "conference_event_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "conference_event_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "active_members"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/conference_state_enum_spec.rb b/spec/models/conference_state_enum_spec.rb new file mode 100644 index 00000000..02e84d21 --- /dev/null +++ b/spec/models/conference_state_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ConferenceStateEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ConferenceStateEnum do + let(:instance) { Bandwidth::ConferenceStateEnum.new } + + describe 'test an instance of ConferenceStateEnum' do + it 'should create an instance of ConferenceStateEnum' do + expect(instance).to be_instance_of(Bandwidth::ConferenceStateEnum) + end + end +end diff --git a/spec/models/create_call_response_spec.rb b/spec/models/create_call_response_spec.rb new file mode 100644 index 00000000..d58c0087 --- /dev/null +++ b/spec/models/create_call_response_spec.rb @@ -0,0 +1,154 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CreateCallResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CreateCallResponse do + let(:instance) { Bandwidth::CreateCallResponse.new } + + describe 'test an instance of CreateCallResponse' do + it 'should create an instance of CreateCallResponse' do + expect(instance).to be_instance_of(Bandwidth::CreateCallResponse) + end + end + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_timeout"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "callback_timeout"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_fallback_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_fallback_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disconnect_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disconnect_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/create_call_spec.rb b/spec/models/create_call_spec.rb new file mode 100644 index 00000000..831416b1 --- /dev/null +++ b/spec/models/create_call_spec.rb @@ -0,0 +1,142 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CreateCall +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CreateCall do + let(:instance) { Bandwidth::CreateCall.new } + + describe 'test an instance of CreateCall' do + it 'should create an instance of CreateCall' do + expect(instance).to be_instance_of(Bandwidth::CreateCall) + end + end + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "uui"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_fallback_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_fallback_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disconnect_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disconnect_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_timeout"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "callback_timeout"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "machine_detection"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/create_lookup_response_spec.rb b/spec/models/create_lookup_response_spec.rb new file mode 100644 index 00000000..d9fab670 --- /dev/null +++ b/spec/models/create_lookup_response_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CreateLookupResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CreateLookupResponse do + let(:instance) { Bandwidth::CreateLookupResponse.new } + + describe 'test an instance of CreateLookupResponse' do + it 'should create an instance of CreateLookupResponse' do + expect(instance).to be_instance_of(Bandwidth::CreateLookupResponse) + end + end + describe 'test attribute "request_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/create_message_request_error_spec.rb b/spec/models/create_message_request_error_spec.rb new file mode 100644 index 00000000..8da9af6f --- /dev/null +++ b/spec/models/create_message_request_error_spec.rb @@ -0,0 +1,46 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CreateMessageRequestError +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CreateMessageRequestError do + let(:instance) { Bandwidth::CreateMessageRequestError.new } + + describe 'test an instance of CreateMessageRequestError' do + it 'should create an instance of CreateMessageRequestError' do + expect(instance).to be_instance_of(Bandwidth::CreateMessageRequestError) + end + end + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "field_errors"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/create_participant_request_spec.rb b/spec/models/create_participant_request_spec.rb new file mode 100644 index 00000000..c1a8963d --- /dev/null +++ b/spec/models/create_participant_request_spec.rb @@ -0,0 +1,52 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CreateParticipantRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CreateParticipantRequest do + let(:instance) { Bandwidth::CreateParticipantRequest.new } + + describe 'test an instance of CreateParticipantRequest' do + it 'should create an instance of CreateParticipantRequest' do + expect(instance).to be_instance_of(Bandwidth::CreateParticipantRequest) + end + end + describe 'test attribute "callback_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "publish_permissions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "device_api_version"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/create_participant_response_spec.rb b/spec/models/create_participant_response_spec.rb new file mode 100644 index 00000000..1789e895 --- /dev/null +++ b/spec/models/create_participant_response_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::CreateParticipantResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::CreateParticipantResponse do + let(:instance) { Bandwidth::CreateParticipantResponse.new } + + describe 'test an instance of CreateParticipantResponse' do + it 'should create an instance of CreateParticipantResponse' do + expect(instance).to be_instance_of(Bandwidth::CreateParticipantResponse) + end + end + describe 'test attribute "participant"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "token"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/deferred_result_spec.rb b/spec/models/deferred_result_spec.rb new file mode 100644 index 00000000..c5b53816 --- /dev/null +++ b/spec/models/deferred_result_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::DeferredResult +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::DeferredResult do + let(:instance) { Bandwidth::DeferredResult.new } + + describe 'test an instance of DeferredResult' do + it 'should create an instance of DeferredResult' do + expect(instance).to be_instance_of(Bandwidth::DeferredResult) + end + end + describe 'test attribute "result"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "set_or_expired"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/device_api_version_enum_spec.rb b/spec/models/device_api_version_enum_spec.rb new file mode 100644 index 00000000..c416bb4e --- /dev/null +++ b/spec/models/device_api_version_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::DeviceApiVersionEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::DeviceApiVersionEnum do + let(:instance) { Bandwidth::DeviceApiVersionEnum.new } + + describe 'test an instance of DeviceApiVersionEnum' do + it 'should create an instance of DeviceApiVersionEnum' do + expect(instance).to be_instance_of(Bandwidth::DeviceApiVersionEnum) + end + end +end diff --git a/spec/models/disconenct_callback_spec.rb b/spec/models/disconenct_callback_spec.rb new file mode 100644 index 00000000..14b75b51 --- /dev/null +++ b/spec/models/disconenct_callback_spec.rb @@ -0,0 +1,130 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::DisconenctCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::DisconenctCallback do + let(:instance) { Bandwidth::DisconenctCallback.new } + + describe 'test an instance of DisconenctCallback' do + it 'should create an instance of DisconenctCallback' do + expect(instance).to be_instance_of(Bandwidth::DisconenctCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "cause"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "error_message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "error_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/diversion_spec.rb b/spec/models/diversion_spec.rb new file mode 100644 index 00000000..f6b60d2d --- /dev/null +++ b/spec/models/diversion_spec.rb @@ -0,0 +1,70 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::Diversion +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::Diversion do + let(:instance) { Bandwidth::Diversion.new } + + describe 'test an instance of Diversion' do + it 'should create an instance of Diversion' do + expect(instance).to be_instance_of(Bandwidth::Diversion) + end + end + describe 'test attribute "reason"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "privacy"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "screen"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "counter"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "limit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "unknown"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "orig_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/dtmf_callback_spec.rb b/spec/models/dtmf_callback_spec.rb new file mode 100644 index 00000000..17526ad7 --- /dev/null +++ b/spec/models/dtmf_callback_spec.rb @@ -0,0 +1,130 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::DtmfCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::DtmfCallback do + let(:instance) { Bandwidth::DtmfCallback.new } + + describe 'test an instance of DtmfCallback' do + it 'should create an instance of DtmfCallback' do + expect(instance).to be_instance_of(Bandwidth::DtmfCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "digit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_caller_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/field_error_spec.rb b/spec/models/field_error_spec.rb new file mode 100644 index 00000000..8398d090 --- /dev/null +++ b/spec/models/field_error_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::FieldError +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::FieldError do + let(:instance) { Bandwidth::FieldError.new } + + describe 'test an instance of FieldError' do + it 'should create an instance of FieldError' do + expect(instance).to be_instance_of(Bandwidth::FieldError) + end + end + describe 'test attribute "field_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/file_format_enum_spec.rb b/spec/models/file_format_enum_spec.rb new file mode 100644 index 00000000..f2660e38 --- /dev/null +++ b/spec/models/file_format_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::FileFormatEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::FileFormatEnum do + let(:instance) { Bandwidth::FileFormatEnum.new } + + describe 'test an instance of FileFormatEnum' do + it 'should create an instance of FileFormatEnum' do + expect(instance).to be_instance_of(Bandwidth::FileFormatEnum) + end + end +end diff --git a/spec/models/forbidden_request_spec.rb b/spec/models/forbidden_request_spec.rb new file mode 100644 index 00000000..ec55d16e --- /dev/null +++ b/spec/models/forbidden_request_spec.rb @@ -0,0 +1,34 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ForbiddenRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ForbiddenRequest do + let(:instance) { Bandwidth::ForbiddenRequest.new } + + describe 'test an instance of ForbiddenRequest' do + it 'should create an instance of ForbiddenRequest' do + expect(instance).to be_instance_of(Bandwidth::ForbiddenRequest) + end + end + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/gather_callback_spec.rb b/spec/models/gather_callback_spec.rb new file mode 100644 index 00000000..a1cfa3f5 --- /dev/null +++ b/spec/models/gather_callback_spec.rb @@ -0,0 +1,136 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::GatherCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::GatherCallback do + let(:instance) { Bandwidth::GatherCallback.new } + + describe 'test an instance of GatherCallback' do + it 'should create an instance of GatherCallback' do + expect(instance).to be_instance_of(Bandwidth::GatherCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "digits"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "terminating_digit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_caller_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/initiate_callback_spec.rb b/spec/models/initiate_callback_spec.rb new file mode 100644 index 00000000..b02bff81 --- /dev/null +++ b/spec/models/initiate_callback_spec.rb @@ -0,0 +1,100 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::InitiateCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::InitiateCallback do + let(:instance) { Bandwidth::InitiateCallback.new } + + describe 'test an instance of InitiateCallback' do + it 'should create an instance of InitiateCallback' do + expect(instance).to be_instance_of(Bandwidth::InitiateCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "diversion"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "stir_shaken"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/list_message_direction_enum_spec.rb b/spec/models/list_message_direction_enum_spec.rb new file mode 100644 index 00000000..247a0db5 --- /dev/null +++ b/spec/models/list_message_direction_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ListMessageDirectionEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ListMessageDirectionEnum do + let(:instance) { Bandwidth::ListMessageDirectionEnum.new } + + describe 'test an instance of ListMessageDirectionEnum' do + it 'should create an instance of ListMessageDirectionEnum' do + expect(instance).to be_instance_of(Bandwidth::ListMessageDirectionEnum) + end + end +end diff --git a/spec/models/list_message_item_spec.rb b/spec/models/list_message_item_spec.rb new file mode 100644 index 00000000..f8a96026 --- /dev/null +++ b/spec/models/list_message_item_spec.rb @@ -0,0 +1,124 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ListMessageItem +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ListMessageItem do + let(:instance) { Bandwidth::ListMessageItem.new } + + describe 'test an instance of ListMessageItem' do + it 'should create an instance of ListMessageItem' do + expect(instance).to be_instance_of(Bandwidth::ListMessageItem) + end + end + describe 'test attribute "message_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "source_tn"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "destination_tn"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message_direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "segment_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "error_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "receive_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "carrier_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message_size"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message_length"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "attachment_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "recipient_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "campaign_class"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/lookup_request_spec.rb b/spec/models/lookup_request_spec.rb new file mode 100644 index 00000000..1abfe2dd --- /dev/null +++ b/spec/models/lookup_request_spec.rb @@ -0,0 +1,34 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::LookupRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::LookupRequest do + let(:instance) { Bandwidth::LookupRequest.new } + + describe 'test an instance of LookupRequest' do + it 'should create an instance of LookupRequest' do + expect(instance).to be_instance_of(Bandwidth::LookupRequest) + end + end + describe 'test attribute "tns"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/lookup_result_spec.rb b/spec/models/lookup_result_spec.rb new file mode 100644 index 00000000..6d1a6c2f --- /dev/null +++ b/spec/models/lookup_result_spec.rb @@ -0,0 +1,82 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::LookupResult +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::LookupResult do + let(:instance) { Bandwidth::LookupResult.new } + + describe 'test an instance of LookupResult' do + it 'should create an instance of LookupResult' do + expect(instance).to be_instance_of(Bandwidth::LookupResult) + end + end + describe 'test attribute "response_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "e_164_format"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "formatted"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "country"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "line_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "line_provider"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "mobile_country_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "mobile_network_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/lookup_status_enum_spec.rb b/spec/models/lookup_status_enum_spec.rb new file mode 100644 index 00000000..3aa47050 --- /dev/null +++ b/spec/models/lookup_status_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::LookupStatusEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::LookupStatusEnum do + let(:instance) { Bandwidth::LookupStatusEnum.new } + + describe 'test an instance of LookupStatusEnum' do + it 'should create an instance of LookupStatusEnum' do + expect(instance).to be_instance_of(Bandwidth::LookupStatusEnum) + end + end +end diff --git a/spec/models/lookup_status_spec.rb b/spec/models/lookup_status_spec.rb new file mode 100644 index 00000000..cae09792 --- /dev/null +++ b/spec/models/lookup_status_spec.rb @@ -0,0 +1,52 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::LookupStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::LookupStatus do + let(:instance) { Bandwidth::LookupStatus.new } + + describe 'test an instance of LookupStatus' do + it 'should create an instance of LookupStatus' do + expect(instance).to be_instance_of(Bandwidth::LookupStatus) + end + end + describe 'test attribute "request_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "result"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "failed_telephone_numbers"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/machine_detection_complete_callback_spec.rb b/spec/models/machine_detection_complete_callback_spec.rb new file mode 100644 index 00000000..ce7b1713 --- /dev/null +++ b/spec/models/machine_detection_complete_callback_spec.rb @@ -0,0 +1,112 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MachineDetectionCompleteCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MachineDetectionCompleteCallback do + let(:instance) { Bandwidth::MachineDetectionCompleteCallback.new } + + describe 'test an instance of MachineDetectionCompleteCallback' do + it 'should create an instance of MachineDetectionCompleteCallback' do + expect(instance).to be_instance_of(Bandwidth::MachineDetectionCompleteCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "machine_detection_result"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/machine_detection_configuration_spec.rb b/spec/models/machine_detection_configuration_spec.rb new file mode 100644 index 00000000..5b43a656 --- /dev/null +++ b/spec/models/machine_detection_configuration_spec.rb @@ -0,0 +1,118 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MachineDetectionConfiguration +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MachineDetectionConfiguration do + let(:instance) { Bandwidth::MachineDetectionConfiguration.new } + + describe 'test an instance of MachineDetectionConfiguration' do + it 'should create an instance of MachineDetectionConfiguration' do + expect(instance).to be_instance_of(Bandwidth::MachineDetectionConfiguration) + end + end + describe 'test attribute "mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "detection_timeout"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "silence_timeout"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "speech_threshold"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "speech_end_threshold"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "machine_speech_end_threshold"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "delay_result"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "callback_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "callback_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/machine_detection_mode_enum_spec.rb b/spec/models/machine_detection_mode_enum_spec.rb new file mode 100644 index 00000000..95be97a1 --- /dev/null +++ b/spec/models/machine_detection_mode_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MachineDetectionModeEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MachineDetectionModeEnum do + let(:instance) { Bandwidth::MachineDetectionModeEnum.new } + + describe 'test an instance of MachineDetectionModeEnum' do + it 'should create an instance of MachineDetectionModeEnum' do + expect(instance).to be_instance_of(Bandwidth::MachineDetectionModeEnum) + end + end +end diff --git a/spec/models/media_spec.rb b/spec/models/media_spec.rb new file mode 100644 index 00000000..2c7de4fc --- /dev/null +++ b/spec/models/media_spec.rb @@ -0,0 +1,46 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::Media +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::Media do + let(:instance) { Bandwidth::Media.new } + + describe 'test an instance of Media' do + it 'should create an instance of Media' do + expect(instance).to be_instance_of(Bandwidth::Media) + end + end + describe 'test attribute "content"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "content_length"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/message_direction_enum_spec.rb b/spec/models/message_direction_enum_spec.rb new file mode 100644 index 00000000..b30c5d47 --- /dev/null +++ b/spec/models/message_direction_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessageDirectionEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessageDirectionEnum do + let(:instance) { Bandwidth::MessageDirectionEnum.new } + + describe 'test an instance of MessageDirectionEnum' do + it 'should create an instance of MessageDirectionEnum' do + expect(instance).to be_instance_of(Bandwidth::MessageDirectionEnum) + end + end +end diff --git a/spec/models/message_request_spec.rb b/spec/models/message_request_spec.rb new file mode 100644 index 00000000..44398b71 --- /dev/null +++ b/spec/models/message_request_spec.rb @@ -0,0 +1,76 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessageRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessageRequest do + let(:instance) { Bandwidth::MessageRequest.new } + + describe 'test an instance of MessageRequest' do + it 'should create an instance of MessageRequest' do + expect(instance).to be_instance_of(Bandwidth::MessageRequest) + end + end + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "text"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "expiration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/message_spec.rb b/spec/models/message_spec.rb new file mode 100644 index 00000000..28d2d72c --- /dev/null +++ b/spec/models/message_spec.rb @@ -0,0 +1,100 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::Message +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::Message do + let(:instance) { Bandwidth::Message.new } + + describe 'test an instance of Message' do + it 'should create an instance of Message' do + expect(instance).to be_instance_of(Bandwidth::Message) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "owner"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "segment_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "text"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/message_status_enum_spec.rb b/spec/models/message_status_enum_spec.rb new file mode 100644 index 00000000..4c7d46df --- /dev/null +++ b/spec/models/message_status_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessageStatusEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessageStatusEnum do + let(:instance) { Bandwidth::MessageStatusEnum.new } + + describe 'test an instance of MessageStatusEnum' do + it 'should create an instance of MessageStatusEnum' do + expect(instance).to be_instance_of(Bandwidth::MessageStatusEnum) + end + end +end diff --git a/spec/models/message_type_enum_spec.rb b/spec/models/message_type_enum_spec.rb new file mode 100644 index 00000000..9bcd42b0 --- /dev/null +++ b/spec/models/message_type_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessageTypeEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessageTypeEnum do + let(:instance) { Bandwidth::MessageTypeEnum.new } + + describe 'test an instance of MessageTypeEnum' do + it 'should create an instance of MessageTypeEnum' do + expect(instance).to be_instance_of(Bandwidth::MessageTypeEnum) + end + end +end diff --git a/spec/models/messages_list_spec.rb b/spec/models/messages_list_spec.rb new file mode 100644 index 00000000..feb08023 --- /dev/null +++ b/spec/models/messages_list_spec.rb @@ -0,0 +1,46 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessagesList +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessagesList do + let(:instance) { Bandwidth::MessagesList.new } + + describe 'test an instance of MessagesList' do + it 'should create an instance of MessagesList' do + expect(instance).to be_instance_of(Bandwidth::MessagesList) + end + end + describe 'test attribute "total_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "page_info"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "messages"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/messaging_code_response_spec.rb b/spec/models/messaging_code_response_spec.rb new file mode 100644 index 00000000..418ca83f --- /dev/null +++ b/spec/models/messaging_code_response_spec.rb @@ -0,0 +1,34 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessagingCodeResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessagingCodeResponse do + let(:instance) { Bandwidth::MessagingCodeResponse.new } + + describe 'test an instance of MessagingCodeResponse' do + it 'should create an instance of MessagingCodeResponse' do + expect(instance).to be_instance_of(Bandwidth::MessagingCodeResponse) + end + end + describe 'test attribute "message_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/messaging_request_error_spec.rb b/spec/models/messaging_request_error_spec.rb new file mode 100644 index 00000000..3ac66e4c --- /dev/null +++ b/spec/models/messaging_request_error_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessagingRequestError +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessagingRequestError do + let(:instance) { Bandwidth::MessagingRequestError.new } + + describe 'test an instance of MessagingRequestError' do + it 'should create an instance of MessagingRequestError' do + expect(instance).to be_instance_of(Bandwidth::MessagingRequestError) + end + end + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/mfa_forbidden_request_error_spec.rb b/spec/models/mfa_forbidden_request_error_spec.rb new file mode 100644 index 00000000..d984520d --- /dev/null +++ b/spec/models/mfa_forbidden_request_error_spec.rb @@ -0,0 +1,34 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MfaForbiddenRequestError +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MfaForbiddenRequestError do + let(:instance) { Bandwidth::MfaForbiddenRequestError.new } + + describe 'test an instance of MfaForbiddenRequestError' do + it 'should create an instance of MfaForbiddenRequestError' do + expect(instance).to be_instance_of(Bandwidth::MfaForbiddenRequestError) + end + end + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/mfa_request_error_spec.rb b/spec/models/mfa_request_error_spec.rb new file mode 100644 index 00000000..6be0f529 --- /dev/null +++ b/spec/models/mfa_request_error_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MfaRequestError +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MfaRequestError do + let(:instance) { Bandwidth::MfaRequestError.new } + + describe 'test an instance of MfaRequestError' do + it 'should create an instance of MfaRequestError' do + expect(instance).to be_instance_of(Bandwidth::MfaRequestError) + end + end + describe 'test attribute "error"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "request_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/mfa_unauthorized_request_error_spec.rb b/spec/models/mfa_unauthorized_request_error_spec.rb new file mode 100644 index 00000000..a8ace718 --- /dev/null +++ b/spec/models/mfa_unauthorized_request_error_spec.rb @@ -0,0 +1,34 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MfaUnauthorizedRequestError +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MfaUnauthorizedRequestError do + let(:instance) { Bandwidth::MfaUnauthorizedRequestError.new } + + describe 'test an instance of MfaUnauthorizedRequestError' do + it 'should create an instance of MfaUnauthorizedRequestError' do + expect(instance).to be_instance_of(Bandwidth::MfaUnauthorizedRequestError) + end + end + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/page_info_spec.rb b/spec/models/page_info_spec.rb new file mode 100644 index 00000000..1c6c52fe --- /dev/null +++ b/spec/models/page_info_spec.rb @@ -0,0 +1,52 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::PageInfo +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::PageInfo do + let(:instance) { Bandwidth::PageInfo.new } + + describe 'test an instance of PageInfo' do + it 'should create an instance of PageInfo' do + expect(instance).to be_instance_of(Bandwidth::PageInfo) + end + end + describe 'test attribute "prev_page"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "next_page"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prev_page_token"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "next_page_token"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/participant_spec.rb b/spec/models/participant_spec.rb new file mode 100644 index 00000000..8daaa249 --- /dev/null +++ b/spec/models/participant_spec.rb @@ -0,0 +1,70 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::Participant +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::Participant do + let(:instance) { Bandwidth::Participant.new } + + describe 'test an instance of Participant' do + it 'should create an instance of Participant' do + expect(instance).to be_instance_of(Bandwidth::Participant) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "callback_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "publish_permissions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sessions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subscriptions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "device_api_version"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/participant_subscription_spec.rb b/spec/models/participant_subscription_spec.rb new file mode 100644 index 00000000..f6613345 --- /dev/null +++ b/spec/models/participant_subscription_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::ParticipantSubscription +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::ParticipantSubscription do + let(:instance) { Bandwidth::ParticipantSubscription.new } + + describe 'test an instance of ParticipantSubscription' do + it 'should create an instance of ParticipantSubscription' do + expect(instance).to be_instance_of(Bandwidth::ParticipantSubscription) + end + end + describe 'test attribute "participant_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "stream_aliases"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/priority_enum_spec.rb b/spec/models/priority_enum_spec.rb new file mode 100644 index 00000000..f7782332 --- /dev/null +++ b/spec/models/priority_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::PriorityEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::PriorityEnum do + let(:instance) { Bandwidth::PriorityEnum.new } + + describe 'test an instance of PriorityEnum' do + it 'should create an instance of PriorityEnum' do + expect(instance).to be_instance_of(Bandwidth::PriorityEnum) + end + end +end diff --git a/spec/models/publish_permissions_enum_spec.rb b/spec/models/publish_permissions_enum_spec.rb new file mode 100644 index 00000000..f368ce13 --- /dev/null +++ b/spec/models/publish_permissions_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::PublishPermissionsEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::PublishPermissionsEnum do + let(:instance) { Bandwidth::PublishPermissionsEnum.new } + + describe 'test an instance of PublishPermissionsEnum' do + it 'should create an instance of PublishPermissionsEnum' do + expect(instance).to be_instance_of(Bandwidth::PublishPermissionsEnum) + end + end +end diff --git a/spec/models/recording_available_callback_spec.rb b/spec/models/recording_available_callback_spec.rb new file mode 100644 index 00000000..f2f01978 --- /dev/null +++ b/spec/models/recording_available_callback_spec.rb @@ -0,0 +1,160 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::RecordingAvailableCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::RecordingAvailableCallback do + let(:instance) { Bandwidth::RecordingAvailableCallback.new } + + describe 'test an instance of RecordingAvailableCallback' do + it 'should create an instance of RecordingAvailableCallback' do + expect(instance).to be_instance_of(Bandwidth::RecordingAvailableCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "duration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "file_format"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "channels"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_caller_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/recording_complete_callback_spec.rb b/spec/models/recording_complete_callback_spec.rb new file mode 100644 index 00000000..f8fde485 --- /dev/null +++ b/spec/models/recording_complete_callback_spec.rb @@ -0,0 +1,160 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::RecordingCompleteCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::RecordingCompleteCallback do + let(:instance) { Bandwidth::RecordingCompleteCallback.new } + + describe 'test an instance of RecordingCompleteCallback' do + it 'should create an instance of RecordingCompleteCallback' do + expect(instance).to be_instance_of(Bandwidth::RecordingCompleteCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "duration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "file_format"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "channels"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_caller_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/recording_state_enum_spec.rb b/spec/models/recording_state_enum_spec.rb new file mode 100644 index 00000000..946f1c9b --- /dev/null +++ b/spec/models/recording_state_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::RecordingStateEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::RecordingStateEnum do + let(:instance) { Bandwidth::RecordingStateEnum.new } + + describe 'test an instance of RecordingStateEnum' do + it 'should create an instance of RecordingStateEnum' do + expect(instance).to be_instance_of(Bandwidth::RecordingStateEnum) + end + end +end diff --git a/spec/models/redirect_callback_spec.rb b/spec/models/redirect_callback_spec.rb new file mode 100644 index 00000000..f1a5e498 --- /dev/null +++ b/spec/models/redirect_callback_spec.rb @@ -0,0 +1,124 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::RedirectCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::RedirectCallback do + let(:instance) { Bandwidth::RedirectCallback.new } + + describe 'test an instance of RedirectCallback' do + it 'should create an instance of RedirectCallback' do + expect(instance).to be_instance_of(Bandwidth::RedirectCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_caller_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/redirect_method_enum_spec.rb b/spec/models/redirect_method_enum_spec.rb new file mode 100644 index 00000000..97b673b5 --- /dev/null +++ b/spec/models/redirect_method_enum_spec.rb @@ -0,0 +1,28 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::RedirectMethodEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::RedirectMethodEnum do + let(:instance) { Bandwidth::RedirectMethodEnum.new } + + describe 'test an instance of RedirectMethodEnum' do + it 'should create an instance of RedirectMethodEnum' do + expect(instance).to be_instance_of(Bandwidth::RedirectMethodEnum) + end + end +end diff --git a/spec/models/request_error_spec.rb b/spec/models/request_error_spec.rb new file mode 100644 index 00000000..ae7a29dd --- /dev/null +++ b/spec/models/request_error_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::RequestError +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::RequestError do + let(:instance) { Bandwidth::RequestError.new } + + describe 'test an instance of RequestError' do + it 'should create an instance of RequestError' do + expect(instance).to be_instance_of(Bandwidth::RequestError) + end + end + describe 'test attribute "error"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "request_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/session_spec.rb b/spec/models/session_spec.rb new file mode 100644 index 00000000..e935320d --- /dev/null +++ b/spec/models/session_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::Session +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::Session do + let(:instance) { Bandwidth::Session.new } + + describe 'test an instance of Session' do + it 'should create an instance of Session' do + expect(instance).to be_instance_of(Bandwidth::Session) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/stir_shaken_spec.rb b/spec/models/stir_shaken_spec.rb new file mode 100644 index 00000000..b005cc6f --- /dev/null +++ b/spec/models/stir_shaken_spec.rb @@ -0,0 +1,46 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::StirShaken +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::StirShaken do + let(:instance) { Bandwidth::StirShaken.new } + + describe 'test an instance of StirShaken' do + it 'should create an instance of StirShaken' do + expect(instance).to be_instance_of(Bandwidth::StirShaken) + end + end + describe 'test attribute "verstat"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "attestation_indicator"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "originating_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/subscriptions_spec.rb b/spec/models/subscriptions_spec.rb new file mode 100644 index 00000000..a0627602 --- /dev/null +++ b/spec/models/subscriptions_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::Subscriptions +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::Subscriptions do + let(:instance) { Bandwidth::Subscriptions.new } + + describe 'test an instance of Subscriptions' do + it 'should create an instance of Subscriptions' do + expect(instance).to be_instance_of(Bandwidth::Subscriptions) + end + end + describe 'test attribute "session_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "participants"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/tag_spec.rb b/spec/models/tag_spec.rb new file mode 100644 index 00000000..4822b89f --- /dev/null +++ b/spec/models/tag_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::Tag +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::Tag do + let(:instance) { Bandwidth::Tag.new } + + describe 'test an instance of Tag' do + it 'should create an instance of Tag' do + expect(instance).to be_instance_of(Bandwidth::Tag) + end + end + describe 'test attribute "key"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/tn_lookup_request_error_spec.rb b/spec/models/tn_lookup_request_error_spec.rb new file mode 100644 index 00000000..c543069b --- /dev/null +++ b/spec/models/tn_lookup_request_error_spec.rb @@ -0,0 +1,34 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::TnLookupRequestError +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::TnLookupRequestError do + let(:instance) { Bandwidth::TnLookupRequestError.new } + + describe 'test an instance of TnLookupRequestError' do + it 'should create an instance of TnLookupRequestError' do + expect(instance).to be_instance_of(Bandwidth::TnLookupRequestError) + end + end + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/transcribe_recording_spec.rb b/spec/models/transcribe_recording_spec.rb new file mode 100644 index 00000000..ee409d1a --- /dev/null +++ b/spec/models/transcribe_recording_spec.rb @@ -0,0 +1,64 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::TranscribeRecording +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::TranscribeRecording do + let(:instance) { Bandwidth::TranscribeRecording.new } + + describe 'test an instance of TranscribeRecording' do + it 'should create an instance of TranscribeRecording' do + expect(instance).to be_instance_of(Bandwidth::TranscribeRecording) + end + end + describe 'test attribute "callback_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "callback_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "callback_timeout"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/transcription_available_callback_spec.rb b/spec/models/transcription_available_callback_spec.rb new file mode 100644 index 00000000..ddc7dad1 --- /dev/null +++ b/spec/models/transcription_available_callback_spec.rb @@ -0,0 +1,154 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::TranscriptionAvailableCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::TranscriptionAvailableCallback do + let(:instance) { Bandwidth::TranscriptionAvailableCallback.new } + + describe 'test an instance of TranscriptionAvailableCallback' do + it 'should create an instance of TranscriptionAvailableCallback' do + expect(instance).to be_instance_of(Bandwidth::TranscriptionAvailableCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "duration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "file_format"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transcription"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_caller_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/transcription_list_spec.rb b/spec/models/transcription_list_spec.rb new file mode 100644 index 00000000..8e8e8e3a --- /dev/null +++ b/spec/models/transcription_list_spec.rb @@ -0,0 +1,34 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::TranscriptionList +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::TranscriptionList do + let(:instance) { Bandwidth::TranscriptionList.new } + + describe 'test an instance of TranscriptionList' do + it 'should create an instance of TranscriptionList' do + expect(instance).to be_instance_of(Bandwidth::TranscriptionList) + end + end + describe 'test attribute "transcripts"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/transcription_metadata_spec.rb b/spec/models/transcription_metadata_spec.rb new file mode 100644 index 00000000..56f68251 --- /dev/null +++ b/spec/models/transcription_metadata_spec.rb @@ -0,0 +1,52 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::TranscriptionMetadata +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::TranscriptionMetadata do + let(:instance) { Bandwidth::TranscriptionMetadata.new } + + describe 'test an instance of TranscriptionMetadata' do + it 'should create an instance of TranscriptionMetadata' do + expect(instance).to be_instance_of(Bandwidth::TranscriptionMetadata) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "completed_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/transcription_spec.rb b/spec/models/transcription_spec.rb new file mode 100644 index 00000000..30b9f819 --- /dev/null +++ b/spec/models/transcription_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::Transcription +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::Transcription do + let(:instance) { Bandwidth::Transcription.new } + + describe 'test an instance of Transcription' do + it 'should create an instance of Transcription' do + expect(instance).to be_instance_of(Bandwidth::Transcription) + end + end + describe 'test attribute "text"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "confidence"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/transfer_answer_callback_spec.rb b/spec/models/transfer_answer_callback_spec.rb new file mode 100644 index 00000000..98adc4ba --- /dev/null +++ b/spec/models/transfer_answer_callback_spec.rb @@ -0,0 +1,118 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::TransferAnswerCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::TransferAnswerCallback do + let(:instance) { Bandwidth::TransferAnswerCallback.new } + + describe 'test an instance of TransferAnswerCallback' do + it 'should create an instance of TransferAnswerCallback' do + expect(instance).to be_instance_of(Bandwidth::TransferAnswerCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_caller_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/transfer_complete_callback_spec.rb b/spec/models/transfer_complete_callback_spec.rb new file mode 100644 index 00000000..bd399abd --- /dev/null +++ b/spec/models/transfer_complete_callback_spec.rb @@ -0,0 +1,136 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::TransferCompleteCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::TransferCompleteCallback do + let(:instance) { Bandwidth::TransferCompleteCallback.new } + + describe 'test an instance of TransferCompleteCallback' do + it 'should create an instance of TransferCompleteCallback' do + expect(instance).to be_instance_of(Bandwidth::TransferCompleteCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_caller_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "cause"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "error_message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "error_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/transfer_disconnect_callback_spec.rb b/spec/models/transfer_disconnect_callback_spec.rb new file mode 100644 index 00000000..39f21d8d --- /dev/null +++ b/spec/models/transfer_disconnect_callback_spec.rb @@ -0,0 +1,148 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::TransferDisconnectCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::TransferDisconnectCallback do + let(:instance) { Bandwidth::TransferDisconnectCallback.new } + + describe 'test an instance of TransferDisconnectCallback' do + it 'should create an instance of TransferDisconnectCallback' do + expect(instance).to be_instance_of(Bandwidth::TransferDisconnectCallback) + end + end + describe 'test attribute "event_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "event_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enqueued_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "start_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "answer_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "end_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_caller_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "transfer_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "cause"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "error_message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "error_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/unauthorized_request_spec.rb b/spec/models/unauthorized_request_spec.rb new file mode 100644 index 00000000..f0192761 --- /dev/null +++ b/spec/models/unauthorized_request_spec.rb @@ -0,0 +1,34 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::UnauthorizedRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::UnauthorizedRequest do + let(:instance) { Bandwidth::UnauthorizedRequest.new } + + describe 'test an instance of UnauthorizedRequest' do + it 'should create an instance of UnauthorizedRequest' do + expect(instance).to be_instance_of(Bandwidth::UnauthorizedRequest) + end + end + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/update_call_recording_spec.rb b/spec/models/update_call_recording_spec.rb new file mode 100644 index 00000000..92b4ef09 --- /dev/null +++ b/spec/models/update_call_recording_spec.rb @@ -0,0 +1,34 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::UpdateCallRecording +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::UpdateCallRecording do + let(:instance) { Bandwidth::UpdateCallRecording.new } + + describe 'test an instance of UpdateCallRecording' do + it 'should create an instance of UpdateCallRecording' do + expect(instance).to be_instance_of(Bandwidth::UpdateCallRecording) + end + end + describe 'test attribute "state"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/update_call_spec.rb b/spec/models/update_call_spec.rb new file mode 100644 index 00000000..38dd1a80 --- /dev/null +++ b/spec/models/update_call_spec.rb @@ -0,0 +1,88 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::UpdateCall +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::UpdateCall do + let(:instance) { Bandwidth::UpdateCall.new } + + describe 'test an instance of UpdateCall' do + it 'should create an instance of UpdateCall' do + expect(instance).to be_instance_of(Bandwidth::UpdateCall) + end + end + describe 'test attribute "state"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "redirect_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "redirect_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "redirect_fallback_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "redirect_fallback_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/update_conference_member_spec.rb b/spec/models/update_conference_member_spec.rb new file mode 100644 index 00000000..791e586b --- /dev/null +++ b/spec/models/update_conference_member_spec.rb @@ -0,0 +1,46 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::UpdateConferenceMember +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::UpdateConferenceMember do + let(:instance) { Bandwidth::UpdateConferenceMember.new } + + describe 'test an instance of UpdateConferenceMember' do + it 'should create an instance of UpdateConferenceMember' do + expect(instance).to be_instance_of(Bandwidth::UpdateConferenceMember) + end + end + describe 'test attribute "mute"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "hold"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "call_ids_to_coach"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/update_conference_spec.rb b/spec/models/update_conference_spec.rb new file mode 100644 index 00000000..13f7c61e --- /dev/null +++ b/spec/models/update_conference_spec.rb @@ -0,0 +1,82 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::UpdateConference +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::UpdateConference do + let(:instance) { Bandwidth::UpdateConference.new } + + describe 'test an instance of UpdateConference' do + it 'should create an instance of UpdateConference' do + expect(instance).to be_instance_of(Bandwidth::UpdateConference) + end + end + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "redirect_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "redirect_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "redirect_fallback_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "redirect_fallback_method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fallback_password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/verify_code_request_spec.rb b/spec/models/verify_code_request_spec.rb new file mode 100644 index 00000000..88cb3ac3 --- /dev/null +++ b/spec/models/verify_code_request_spec.rb @@ -0,0 +1,52 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::VerifyCodeRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::VerifyCodeRequest do + let(:instance) { Bandwidth::VerifyCodeRequest.new } + + describe 'test an instance of VerifyCodeRequest' do + it 'should create an instance of VerifyCodeRequest' do + expect(instance).to be_instance_of(Bandwidth::VerifyCodeRequest) + end + end + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "scope"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "expiration_time_in_minutes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/verify_code_response_spec.rb b/spec/models/verify_code_response_spec.rb new file mode 100644 index 00000000..34eec213 --- /dev/null +++ b/spec/models/verify_code_response_spec.rb @@ -0,0 +1,34 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::VerifyCodeResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::VerifyCodeResponse do + let(:instance) { Bandwidth::VerifyCodeResponse.new } + + describe 'test an instance of VerifyCodeResponse' do + it 'should create an instance of VerifyCodeResponse' do + expect(instance).to be_instance_of(Bandwidth::VerifyCodeResponse) + end + end + describe 'test attribute "valid"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/voice_api_error_spec.rb b/spec/models/voice_api_error_spec.rb new file mode 100644 index 00000000..c8b1b010 --- /dev/null +++ b/spec/models/voice_api_error_spec.rb @@ -0,0 +1,46 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::VoiceApiError +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::VoiceApiError do + let(:instance) { Bandwidth::VoiceApiError.new } + + describe 'test an instance of VoiceApiError' do + it 'should create an instance of VoiceApiError' do + expect(instance).to be_instance_of(Bandwidth::VoiceApiError) + end + end + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/voice_code_response_spec.rb b/spec/models/voice_code_response_spec.rb new file mode 100644 index 00000000..41be139d --- /dev/null +++ b/spec/models/voice_code_response_spec.rb @@ -0,0 +1,34 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::VoiceCodeResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::VoiceCodeResponse do + let(:instance) { Bandwidth::VoiceCodeResponse.new } + + describe 'test an instance of VoiceCodeResponse' do + it 'should create an instance of VoiceCodeResponse' do + expect(instance).to be_instance_of(Bandwidth::VoiceCodeResponse) + end + end + describe 'test attribute "call_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 00000000..1b482845 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,111 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.0 + +=end + +# load the gem +require 'bandwidth-sdk' + +# The following was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end diff --git a/spec/test.rb b/spec/test.rb new file mode 100644 index 00000000..f6834bad --- /dev/null +++ b/spec/test.rb @@ -0,0 +1,453 @@ +require 'test/unit' +require_relative '../lib/openapi_ruby_sdk.rb' +require 'securerandom' +require 'set' +include RubySdk + +DATA = 0 # index for response array related to the response data +CODE = 1 # index for response array related to the status code + +begin + BW_USERNAME = ENV.fetch("BW_USERNAME") + BW_PASSWORD = ENV.fetch("BW_PASSWORD") + BW_ACCOUNT_ID = ENV.fetch("BW_ACCOUNT_ID") + BW_VOICE_APPLICATION_ID = ENV.fetch("BW_VOICE_APPLICATION_ID") + BW_MESSAGING_APPLICATION_ID = ENV.fetch("BW_MESSAGING_APPLICATION_ID") + BASE_CALLBACK_URL = ENV.fetch("BASE_CALLBACK_URL") + BW_NUMBER = ENV.fetch("BW_NUMBER") + USER_NUMBER = ENV.fetch("USER_NUMBER") +rescue + puts "Environmental variables not found" + exit(-1) +end + +class ValidationTest < Test::Unit::TestCase + RubySdk.configure do |config| + # Configure HTTP basic authorization: httpBasic + config.username = BW_USERNAME + config.password = BW_PASSWORD + #config.ssl_verify = false # remove for testing on push + end + + #-----------Messaging and Media Tests----------- + $api_instance_msg = RubySdk::MessagesApi.new() + $api_instance_media = RubySdk::MediaApi.new() + + def test_create_message_sms # Test sending an SMS message + message_text = "ruby sdk test SMS" + body = RubySdk::MessageRequest.new( + application_id: BW_MESSAGING_APPLICATION_ID, + to: [USER_NUMBER], + from: BW_NUMBER, + text: message_text + ) + response = $api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) + assert_equal(202, response[CODE], "incorrect response code") + assert_equal(29, response[DATA].id.length, "id not set") + assert_equal(BW_NUMBER, response[DATA].owner, "message owner not correct") + assert_equal(BW_NUMBER, response[DATA].from, "from number does not match") + assert_equal([USER_NUMBER], response[DATA].to, "to number does not match") + assert_equal(body.tag, response[DATA].tag, "tags do not match") + assert_equal(body.media,response[DATA].media, "media does not match") + assert_equal(message_text, response[DATA].text, "message text does not match") + end + + def test_create_message_mms # Test sending an MMS message + message_text = "ruby sdk test MMS" + body = RubySdk::MessageRequest.new( + application_id: BW_MESSAGING_APPLICATION_ID, + to: [USER_NUMBER], + from: BW_NUMBER, + text: message_text, + media: ["https://cdn2.thecatapi.com/images/MTY3ODIyMQ.jpg"] + ) + response = $api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) + assert_equal(202, response[CODE], "incorrect response code") + assert_equal(29, response[DATA].id.length, "id not set") + assert_equal(BW_NUMBER, response[DATA].owner, "message owner not correct") + assert_equal(BW_NUMBER, response[DATA].from, "from number does not match") + assert_equal([USER_NUMBER], response[DATA].to, "to number does not match") + assert_equal(body.tag, response[DATA].tag, "tags do not match") + assert_equal(body.media,response[DATA].media, "media does not match") + assert_equal(message_text, response[DATA].text, "message text does not match") + end + + def test_get_message # Test to get most recent message from the BW_NUMBER + get_opts = { + :source_tn => BW_NUMBER, + :message_direction => "OUTBOUND" + } + response = $api_instance_msg.get_messages_with_http_info(BW_ACCOUNT_ID, get_opts) + assert_equal(200, response[CODE], "incorrect response code") + assert_equal(BW_ACCOUNT_ID, response[DATA].messages[0].account_id, "account ids do not match") + assert_equal("OUTBOUND", response[DATA].messages[0].message_direction, "message directions do not match") + assert_equal(BW_NUMBER, response[DATA].messages[0].source_tn, "failed to get message from BW_NUMBER") + end + + def test_create_message_invalid_phone_number # Test to make sure correct errors are thrown when trying to send a text to an invalid number + body = RubySdk::MessageRequest.new( + application_id: BW_MESSAGING_APPLICATION_ID, + to: ["+1invalid"], + from: BW_NUMBER, + text: "ruby sdk test" + ) + e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $response = $api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) + + end + resp_body = JSON.parse(e.response_body) + expected_desc = "\'+1invalid\' must be replaced with a valid E164 formatted telephone number" + assert_equal(400, e.code, "incorrect response code") + assert_equal("request-validation", resp_body['type'], "response type does not match") + assert_equal(expected_desc, resp_body['fieldErrors'][0]['description'], "error description does not match expected") + end + + def test_valid_media # Test Media Upload, List, Download, and Delete + media_name = 'ruby_media' + SecureRandom.uuid + media_data = '123456' + + # upload media + up_response = $api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, media_name, media_data) + assert_equal(204, up_response[CODE], "incorrect response code") + + # list media + list_media = $api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID) + assert_equal(200, list_media[CODE], "incorrect response code") + assert(list_media[DATA][0].content_length > 0, "media data does not exist") + + # download media + downloaded_media = $api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, media_name, debug_return_type: 'String') + assert_equal(200, downloaded_media[CODE], "incorrect response code") + assert_equal(media_data, downloaded_media[DATA], "downloaded media file not equal to upload") + + # delete media + del_response = $api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, media_name) + assert_equal(204, del_response[CODE], "incorrect response code") + end + + def test_get_delete_invalid_media # Test to make sure correct errors are thrown when trying to list and get media that does not exist + media_name = "invalid_media" + # get media + e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, media_name, debug_return_type: 'String') + end + assert_equal(404, e.code, "incorrect response code") + assert_equal("object-not-found", JSON.parse(e.response_body)['type'], "response error type does not match") + + # delete media (the fact that this returns a 204 is actually painful, but we need to verify ¯\_(ツ)_/¯) + del_response = $api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, media_name) + assert_equal(204, del_response[CODE], "incorrect response code") + end + + + #-----------Voice Tests----------- + $api_instance_voice = RubySdk::CallsApi.new() + + def test_create_call_and_get_call_state # Test to create an outbound call and get its state + amd_config = RubySdk::MachineDetectionConfiguration.new( + mode: "async", + detection_timeout: 5.0, + silence_timeout: 5.0, + speech_threshold: 5.0, + speech_end_threshold: 5.0, + delay_result: true, + callback_url: BASE_CALLBACK_URL + "/machineDetection", + callback_method: "POST" + ) + call_body = RubySdk::CreateCallRequest.new( + application_id: BW_VOICE_APPLICATION_ID, + to: USER_NUMBER, + from: BW_NUMBER, + answer_url: BASE_CALLBACK_URL + "/callbacks/answer", + answer_method: "POST", + disconnect_url: BASE_CALLBACK_URL + "/callbacks/disconnect", + disconnect_method: "GET", + machine_detection: amd_config + ) + call_response = $api_instance_voice.create_call_with_http_info(BW_ACCOUNT_ID, call_body) + sleep(3) + # asserts for creating call + assert_equal(201, call_response[CODE], "incorrect response code") + assert_equal(47, call_response[DATA].call_id.length, "id not set") + assert_equal(BW_ACCOUNT_ID, call_response[DATA].account_id, "account id does not match") + assert_equal(BW_VOICE_APPLICATION_ID, call_response[DATA].application_id, "application id does not match") + assert_equal(USER_NUMBER, call_response[DATA].to, "to number does not match") + assert_equal(BW_NUMBER, call_response[DATA].from, "from number does not match") + assert_equal("https://voice.bandwidth.com/api/v2/accounts/" + BW_ACCOUNT_ID + "/calls/" + call_response[DATA].call_id, call_response[DATA].call_url, "call url does not match") + assert(call_response[DATA].call_timeout.is_a?(Float), "incorrect call timeout data type") + assert(call_response[DATA].callback_timeout.is_a?(Float), "incorrect callback timeout data type") + assert(call_response[DATA].start_time.is_a?(Time), "incorrect start time data type") + assert_equal("POST", call_response[DATA].answer_method, "answer method does not match") + assert_equal("GET", call_response[DATA].disconnect_method, "disconnect method does not match") + assert_equal(BASE_CALLBACK_URL + "/callbacks/answer", call_response[DATA].answer_url, "answer url does not match") + assert_equal(BASE_CALLBACK_URL + "/callbacks/disconnect", call_response[DATA].disconnect_url, "disconnect url does not match") + + + get_call_response = $api_instance_voice.get_call_with_http_info(BW_ACCOUNT_ID, call_response[DATA].call_id) + #asserts for getting call state + assert_equal(200, get_call_response[CODE], "incorrect response code") + assert_equal(call_response[DATA].call_id, get_call_response[DATA].call_id, "call id does not match") + assert_equal(BW_ACCOUNT_ID, get_call_response[DATA].account_id, "account id does not match") + assert_equal(BW_VOICE_APPLICATION_ID, get_call_response[DATA].application_id, "application id does not match") + assert(get_call_response[DATA].start_time.is_a?(Time), "incorrect start time data type") + assert(get_call_response[DATA].last_update.is_a?(Time), "incorrect last update time data type") + if get_call_response[DATA].answer_time + assert(get_call_response[DATA].answer_time.is_a?(Time), "incorrect answer time data type") + end + if get_call_response[DATA].end_time + assert(get_call_response[DATA].end_time.is_a?(Time), "incorrect end time data type") + end + if get_call_response[DATA].disconnect_cause == "error" + assert(get_call_response[DATA].error_message.is_a?(String), "incorrect error message data type") + assert_equal(36, get_call_response[DATA].error_id.length, "error id not set") + end + end + + def test_create_get_failed_call # Test to make sure correct errors are thrown when trying to create a call incorrectly and get a call that does not exist + call_body = RubySdk::CreateCallRequest.new( + application_id: BW_VOICE_APPLICATION_ID, + to: "+1invalid", + from: BW_NUMBER, + answer_url: BASE_CALLBACK_URL + "/callbacks/answer", + answer_method: "POST", + disconnect_url: BASE_CALLBACK_URL + "/callbacks/disconnect", + disconnect_method: "GET" + ) + + dne_id = "does-not-exist" + + call_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $api_instance_voice.create_call_with_http_info(BW_ACCOUNT_ID, call_body) + end + get_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $api_instance_voice.get_call_with_http_info(BW_ACCOUNT_ID, dne_id) + end + + # asserts for creating bad call + assert_equal(400, call_e.code, "incorrect response code") + assert_equal("validation", JSON.parse(call_e.response_body)['type'], "response error type does not match") + assert(JSON.parse(call_e.response_body)['description'].is_a?(String), "incorrect error description type") + + # asserts for getting non-existent call + assert_equal(404, get_e.code, "incorrect response code") + #assert_equal("", JSON.parse(get_e.response_body)['type'], "response error type does not match") for some reason, this doesnt have a response body 🙃 + #assert(JSON.parse(get_e.response_body)['description'], "incorrect error description type") + end + + #-----------MFA Tests----------- + $api_instance_mfa = RubySdk::MFAApi.new() + + def test_mfa_messaging # Test to send a messaging mfa code + req_schema = RubySdk::TwoFactorCodeRequestSchema.new( + to: USER_NUMBER, + from: BW_NUMBER, + application_id: BW_MESSAGING_APPLICATION_ID, + message: "Your temporary {NAME} {SCOPE} code is: {CODE}", + digits: 6 + ) + mfa_response = $api_instance_mfa.messaging_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) + assert_equal(200, mfa_response[CODE], "incorrect response code") + assert_equal(29, mfa_response[DATA].message_id.length, "message id not set") + end + + def test_failed_mfa_messaging # Test to make sure correct errors are thrown when trying to send a messaging mfa code incorrectly + req_schema = RubySdk::TwoFactorCodeRequestSchema.new( + to: USER_NUMBER, + from: BW_NUMBER, + application_id: BW_MESSAGING_APPLICATION_ID, + message: "Your temporary {NAME} {SCOPE} code is: ", + digits: 6 + ) + e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $api_instance_mfa.messaging_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) + end + assert_equal(400, e.code, "incorrect response code") + assert_equal("{CODE} is required in MFA message", JSON.parse(e.response_body)['error'], "response error does not match") + end + + def test_mfa_voice # Test to send a voice mfa code + req_schema = RubySdk::TwoFactorCodeRequestSchema.new( + to: USER_NUMBER, + from: BW_NUMBER, + application_id: BW_VOICE_APPLICATION_ID, + message: "Your temporary {NAME} {SCOPE} code is: {CODE}", + digits: 6 + ) + mfa_response = $api_instance_mfa.voice_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) + assert_equal(200, mfa_response[CODE], "incorrect response code") + assert_equal(47, mfa_response[DATA].call_id.length, "call id not set") + end + + def test_failed_mfa_voice # Test to make sure correct errors are thrown when trying to send a voice mfa code incorrectly + req_schema = RubySdk::TwoFactorCodeRequestSchema.new( + to: USER_NUMBER, + from: BW_NUMBER, + application_id: BW_VOICE_APPLICATION_ID, + message: "Your temporary {NAME} {SCOPE} code is: ", + digits: 6 + ) + e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $api_instance_mfa.voice_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) + end + assert_equal(400, e.code, "incorrect response code") + assert_equal("{CODE} is required in MFA message", JSON.parse(e.response_body)['error'], "response error does not match") + end + + def test_mfa_verify # Test to verify a correct received mfa code + omit("Currently no way to do this without receiving callbacks") + req_schema = RubySdk::TwoFactorVerifyRequestSchema.new( + to: "+1000" + rand(1...10000000).to_s, + application_id: BW_VOICE_APPLICATION_ID, + expiration_time_in_minutes: 3, + code: "123456" + ) + mfa_response = $api_instance_mfa.verify_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) + assert_equal(200, mfa_response[CODE], "incorrect response code") + assert(mfa_response[DATA].valid.is_a?(TrueClass), "incorrect valid data type") + end + + def test_failed_mfa_verify # Test to verify an incorrect received mfa code + req_schema = RubySdk::TwoFactorVerifyRequestSchema.new( + to: "+1000" + rand(1...10000000).to_s, + application_id: BW_VOICE_APPLICATION_ID, + expiration_time_in_minutes: 3, + code: "12345" # 5 digits so as to never match one randomly generated by previous tests + ) + mfa_response = $api_instance_mfa.verify_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) + assert_equal(200, mfa_response[CODE], "incorrect response code") + assert(mfa_response[DATA].valid.is_a?(FalseClass), "incorrect valid data type") + end + + #-----------WebRTC Tests----------- + $api_instance_webrtc = RubySdk::SessionsApi.new() + $api_instance_participants = RubySdk::ParticipantsApi.new() + + def test_webrtc_create_get_delete_session # Test to create, get, and delete a webrtc session + session_body = RubySdk::Session.new( + tag: "ruby sdk test" + ) + create_response = $api_instance_webrtc.create_session_with_http_info(BW_ACCOUNT_ID, session: session_body) + assert_equal(200, create_response[CODE], "incorrect response code") + assert_equal(36, create_response[DATA].id.length, "session id not set") + assert_equal(session_body.tag.to_s, create_response[DATA].tag, "created session tag does not match expected") + + get_response = $api_instance_webrtc.get_session_with_http_info(BW_ACCOUNT_ID, create_response[DATA].id) + assert_equal(200, get_response[CODE], "incorrect response code") + assert_equal(create_response[DATA].id, get_response[DATA].id, "session id does not match") + assert_equal(session_body.tag.to_s, get_response[DATA].tag, "gotten session tag does not match expected") + + del_response = $api_instance_webrtc.delete_session_with_http_info(BW_ACCOUNT_ID, create_response[DATA].id) + assert_equal(204, del_response[CODE], "incorrect response code") + end + + def test_failed_get_session # Test to make sure correct errors are thrown when improperly trying to get session details + malf_id = "invalid" + dne_id = "11111111-2222-3333-4444-555555555555" + expected_error = "Could not find session for id " + dne_id + malf_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $api_instance_webrtc.get_session_with_http_info(BW_ACCOUNT_ID, malf_id) + end + assert_equal(400, malf_e.code, "incorrect response code") + assert_equal("Malformed session id", JSON.parse(malf_e.response_body)['error'], "response error does not match") + + dne_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $api_instance_webrtc.get_session_with_http_info(BW_ACCOUNT_ID, dne_id) + end + assert_equal(404, dne_e.code, "incorrect response code") + assert_equal(expected_error, JSON.parse(dne_e.response_body)['error'], "response error does not match") + end + + def test_create_get_delete_participant # Test to successfully create, get, and delete a webrtc participant + part_body = RubySdk::Participant.new( + publish_permissions: ["VIDEO", "AUDIO"], + device_api_version: "V3", + tag: "ruby sdk test" + ) + create_response = $api_instance_participants.create_participant_with_http_info(BW_ACCOUNT_ID, participant: part_body) + part_id = create_response[DATA].participant.id + assert_equal(200, create_response[CODE], "incorrect response code") + assert_equal(36, create_response[DATA].participant.id.length, "participant id not set") + assert_equal(part_body.publish_permissions.to_set, create_response[DATA].participant.publish_permissions.to_set, "participant permissions do not match") + assert_equal(part_body.device_api_version, create_response[DATA].participant.device_api_version, "participant api version does not match") + assert_equal(part_body.tag, create_response[DATA].participant.tag, "participant tag does not match") + + get_response = $api_instance_participants.get_participant_with_http_info(BW_ACCOUNT_ID, part_id) + assert_equal(200, get_response[CODE], "incorrect response code") + assert_equal(part_id, get_response[DATA].id, "participant id does not match") + assert_equal(part_body.publish_permissions.to_set, get_response[DATA].publish_permissions.to_set, "participant permissions do not match") + assert_equal(part_body.device_api_version, get_response[DATA].device_api_version, "participant api version does not match") + assert_equal(part_body.tag, get_response[DATA].tag, "participant tag does not match") + + del_response = $api_instance_participants.delete_participant_with_http_info(BW_ACCOUNT_ID, part_id) + assert_equal(204, del_response[CODE], "incorrect response code") + end + + def test_failed_create_get_delete_participant # Test to make sure correct errors are thrown when using invalid participant info + part_body_bad = RubySdk::Participant.new( + publish_permissions: ["AUDIO", "VIDEO", "INVALID"], + device_api_version: "V3", + tag: "ruby sdk test invalid" + ) + dne_id = "11111111-2222-3333-4444-555555555555" + expected_error = "Could not find participant for id " + dne_id + + create_e = assert_raise(RubySdk::ApiError, "expected ecpetion not raised") do + $api_instance_participants.create_participant_with_http_info(BW_ACCOUNT_ID, participant: part_body_bad) + end + assert_equal(400, create_e.code, "incorrect response code") + + get_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $api_instance_participants.get_participant_with_http_info(BW_ACCOUNT_ID, dne_id) + end + assert_equal(404, get_e.code, "incorrect response code") + assert_equal(expected_error, JSON.parse(get_e.response_body)['error'], "response error does not match") + + del_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $api_instance_participants.delete_participant_with_http_info(BW_ACCOUNT_ID, dne_id) + end + assert_equal(404, del_e.code, "incorrect response code") + assert_equal(expected_error, JSON.parse(del_e.response_body)['error'], "response error does not match") + end + + #-----------TN Lookup Tests----------- + $api_instance_tnlookup = RubySdk::PhoneNumberLookupApi.new() + + def test_create_get_tn_lookup # Test to create and get the status of a TN Lookup Request + tn_body = RubySdk::OrderRequest.new( + tns: [BW_NUMBER] + ) + create_response = $api_instance_tnlookup.lookup_request_with_http_info(BW_ACCOUNT_ID, tn_body) + assert_equal(202, create_response[CODE], "incorrect response code") + assert_equal(36, create_response[DATA].request_id.length, "request id not set") + assert(create_response[DATA].status.is_a?(String), "incorrect status data type") + + sleep(1) + + req_id = create_response[DATA].request_id + get_response = $api_instance_tnlookup.lookup_request_status_with_http_info(BW_ACCOUNT_ID, req_id) + assert_equal(200, get_response[CODE], "incorrect response code") + assert_equal(req_id, get_response[DATA].request_id, "request id does not match") + assert(get_response[DATA].status.is_a?(String), "incorrect response status type") + assert(get_response[DATA].result[0].response_code.is_a?(Integer), "incorrect response code type") + assert_equal(BW_NUMBER, get_response[DATA].result[0].e_164_format, "phone number does not match") + end + + def test_failed_create_get_tn_lookup # Test to make sure correct errors are thrown when trying to improperly create and get a TN Lookup Request + tn_body_bad = RubySdk::OrderRequest.new( + tns: ["+1invalid"] + ) + req_id_dne = "invalid" + expected_error = "Some tns do not match e164 format: " + tn_body_bad.tns[0] + #req_id_dne = "11111111-2222-3333-4444-555555555555" + create_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $api_instance_tnlookup.lookup_request_with_http_info(BW_ACCOUNT_ID, tn_body_bad) + end + assert_equal(400, create_e.code, "incorrect response type") + assert_equal(expected_error, JSON.parse(create_e.response_body)['message'], "response error does not match") + + get_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + $api_instance_tnlookup.lookup_request_status_with_http_info(BW_ACCOUNT_ID, req_id_dne) + end + assert_equal(404, get_e.code, "incorrect response type") + end +end diff --git a/test/integration/test_integration.rb b/test/integration/test_integration.rb deleted file mode 100644 index 6a3e8a9e..00000000 --- a/test/integration/test_integration.rb +++ /dev/null @@ -1,760 +0,0 @@ -# test_integration.rb -# -# A simple integration test against Bandwidth's APIs - -require 'test/unit' -require 'securerandom' -require_relative '../../lib/bandwidth.rb' - -include Bandwidth -include Bandwidth::Voice -include Bandwidth::Messaging -include Bandwidth::MultiFactorAuth -include Bandwidth::WebRtc - -begin - BW_USERNAME = ENV.fetch("BW_USERNAME") - BW_PASSWORD = ENV.fetch("BW_PASSWORD") - BW_ACCOUNT_ID = ENV.fetch("BW_ACCOUNT_ID") - BW_VOICE_APPLICATION_ID = ENV.fetch("BW_VOICE_APPLICATION_ID") - BW_MESSAGING_APPLICATION_ID = ENV.fetch("BW_MESSAGING_APPLICATION_ID") - BASE_CALLBACK_URL = ENV.fetch("BASE_CALLBACK_URL") - BW_NUMBER = ENV.fetch("BW_NUMBER") - USER_NUMBER = ENV.fetch("USER_NUMBER") -rescue - puts "Environmental variables not found" - exit(-1) -end - -class IntegrationTest < Test::Unit::TestCase - def setup - @bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: BW_USERNAME, - voice_basic_auth_password: BW_PASSWORD, - messaging_basic_auth_user_name: BW_USERNAME, - messaging_basic_auth_password: BW_PASSWORD, - multi_factor_auth_basic_auth_user_name: BW_USERNAME, - multi_factor_auth_basic_auth_password: BW_PASSWORD, - phone_number_lookup_basic_auth_user_name: BW_USERNAME, - phone_number_lookup_basic_auth_password: BW_PASSWORD - ) - - @bandwidth_client_invalid_auth = Bandwidth::Client.new( - voice_basic_auth_user_name: "bad_username", - voice_basic_auth_password: "bad_password", - messaging_basic_auth_user_name: "bad_username", - messaging_basic_auth_password: "bad_password", - multi_factor_auth_basic_auth_user_name: "bad_username", - multi_factor_auth_basic_auth_password: "bad_password", - phone_number_lookup_basic_auth_user_name: "bad_username", - phone_number_lookup_basic_auth_password: "bad_password" - ) - end - - def test_create_message - body = MessageRequest.new - body.application_id = BW_MESSAGING_APPLICATION_ID - body.to = [USER_NUMBER] - body.from = BW_NUMBER - body.text = "Ruby Integration" - response = @bandwidth_client.messaging_client.client.create_message(BW_ACCOUNT_ID, body) - assert(response.data.id.length > 0, "id value not set") #validate that _some_ id was returned - end - - def test_create_message_invalid_phone_number - body = MessageRequest.new - body.application_id = BW_MESSAGING_APPLICATION_ID - body.to = ["+1invalid"] - body.from = BW_NUMBER - body.text = "Ruby Integration" - begin - @bandwidth_client.messaging_client.client.create_message(BW_ACCOUNT_ID, body) - #workaround to make sure that if the above error is not raised, the build will fail - assert(false, "Expected exception not raised") - rescue MessagingException => e - assert(e.description.length > 0, "description value not set") - end - end - - def test_upload_download_media - #define constants for upload media and download media - media_id = "text-media-id-" + SecureRandom.uuid - media = "Hello world" - - #media upload - @bandwidth_client.messaging_client.client.upload_media(BW_ACCOUNT_ID, media_id, media, :content_type => "text/plain", :cache_control => "no-cache") - - #media download - downloaded_media = @bandwidth_client.messaging_client.client.get_media(BW_ACCOUNT_ID, media_id).data - - assert_equal(downloaded_media, media, "Downloaded media file not equal to upload") - end - - def test_get_message - # Send a successful request to the GET messages API - response = @bandwidth_client.messaging_client.client.get_messages(BW_ACCOUNT_ID, :message_id => "abc123") - assert_equal(response.status_code, 200, "API did not return a 200 OK") - end - - def test_get_message_invalid_auth - # Send an unsuccessful request to the GET messages API - assert_raise MessagingException do - response = @bandwidth_client_invalid_auth.messaging_client.client.get_messages(BW_ACCOUNT_ID) - end - end - - def test_create_call_and_get_call_state - body = CreateCallRequest.new - body.from = BW_NUMBER - body.to = USER_NUMBER - body.application_id = BW_VOICE_APPLICATION_ID - body.answer_url = BASE_CALLBACK_URL - response = @bandwidth_client.voice_client.client.create_call(BW_ACCOUNT_ID, body) - assert(response.data.call_id.length > 0, "call_id value not set") - assert_not_nil(response.data.enqueued_time, "enqueued time is nil") - assert(response.data.enqueued_time.is_a?(DateTime), "enqueued time is not a DateTime object") - - #Get phone call information - sleep 1 - response = @bandwidth_client.voice_client.client.get_call(BW_ACCOUNT_ID, response.data.call_id) - assert(response.data.state.length > 0, "state value not set") - assert_not_nil(response.data.enqueued_time, "enqueued time is nil") - assert(response.data.enqueued_time.is_a?(DateTime), "enqueued time is not a DateTime object") - end - - def test_create_call_with_amd_and_get_call_state - machine_detection = MachineDetectionConfiguration.new - machine_detection.mode = 'async' - machine_detection.detection_timeout = 5.0 - machine_detection.silence_timeout = 5.0 - machine_detection.speech_threshold = 5.0 - machine_detection.speech_end_threshold = 5.0 - machine_detection.delay_result = true - machine_detection.callback_url = BASE_CALLBACK_URL + '/machineDetection' - machine_detection.callback_method = 'POST' - machine_detection.machine_speech_end_threshold = 3.2 - - body = CreateCallRequest.new - body.from = BW_NUMBER - body.to = USER_NUMBER - body.application_id = BW_VOICE_APPLICATION_ID - body.answer_url = BASE_CALLBACK_URL - body.machine_detection = machine_detection - response = @bandwidth_client.voice_client.client.create_call(BW_ACCOUNT_ID, body) - assert(response.data.call_id.length > 0, "call_id value not set") - - #Get phone call information - response = @bandwidth_client.voice_client.client.get_call(BW_ACCOUNT_ID, response.data.call_id) - assert(response.data.state.length > 0, "state value not set") - end - - def test_create_call_with_priority - body = CreateCallRequest.new - body.from = BW_NUMBER - body.to = USER_NUMBER - body.application_id = BW_VOICE_APPLICATION_ID - body.answer_url = BASE_CALLBACK_URL - body.priority = 1 - - response = @bandwidth_client.voice_client.client.create_call(BW_ACCOUNT_ID, body) - assert(response.data.call_id.length > 0, "call_id value not set") - assert(response.data.priority == 1, "priority not set") - end - - def test_create_call_invalid_phone_number - body = CreateCallRequest.new - body.from = BW_NUMBER - body.to = "+1invalid" - body.application_id = BW_VOICE_APPLICATION_ID - body.answer_url = BASE_CALLBACK_URL - - begin - @bandwidth_client.voice_client.client.create_call(BW_ACCOUNT_ID, :body => body) - #workaround to make sure that if the above error is not raised, the build will fail - assert(false, "Expected exception not raised") - rescue ApiErrorException => e - assert(e.description.length > 0, "description value not set") - end - end - - def test_forward - forward = Bandwidth::Voice::Forward.new({ - :to => "+15554443333", - :from => "+13334445555", - :call_timeout => 25, - :diversion_treatment => "none", - :diversion_reason => "away" - }) - - response = Bandwidth::Voice::Response.new() - response.push(forward) - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_gather - gather = Bandwidth::Voice::Gather.new({ - :gather_url => "https://test.com", - :gather_method => "POST", - :username => "user", - :password => "pass", - :tag => "tag", - :terminating_digits => "#", - :max_digits => 3, - :inter_digit_timeout => 5, - :first_digit_timeout => "10", - :repeat_count => 1, - :gather_fallback_url => "https://test.com", - :gather_fallback_method => "GET", - :fallback_username => "fuser", - :fallback_password => "fpass" - }) - - response = Bandwidth::Voice::Response.new() - response.push(gather) - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_gather_nested_speak_sentence - speak_sentence = Bandwidth::Voice::SpeakSentence.new({ - :sentence => "test" - }) - gather = Bandwidth::Voice::Gather.new({ - :speak_sentence => speak_sentence - }) - - response = Bandwidth::Voice::Response.new() - response.push(gather) - expected = 'test' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_gather_nested_play_audio - play_audio = Bandwidth::Voice::PlayAudio.new({ - :url => "https://test.com" - }) - gather = Bandwidth::Voice::Gather.new({ - :play_audio => play_audio - }) - - response = Bandwidth::Voice::Response.new() - response.push(gather) - expected = 'https://test.com' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_gather_multiple_nested_verbs - play_audio = Bandwidth::Voice::PlayAudio.new({ - :url => "https://test.com" - }) - speak_sentence = Bandwidth::Voice::SpeakSentence.new({ - :sentence => "test" - }) - gather = Bandwidth::Voice::Gather.new({ - :nested_verbs => [play_audio, speak_sentence] - }) - - response = Bandwidth::Voice::Response.new() - response.push(gather) - expected = 'https://test.comtest' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_empty_bxml_verb - bxml = Bandwidth::Voice::Bxml.new() - - expected = '' - actual = bxml.to_bxml() - assert_equal(expected, actual) - end - - def test_speak_sentence_pause - bxml = Bandwidth::Voice::Bxml.new() - - speak_sentence = Bandwidth::Voice::SpeakSentence.new({ - :sentence => "new modify call bxml is pog", - :voice => "Julie" - }) - - pause = Bandwidth::Voice::Pause.new({ - :duration => 6 - }) - - bxml.push(speak_sentence) - bxml.push(pause) - - expected = 'new modify call bxml is pog' - actual = bxml.to_bxml() - assert_equal(expected, actual) - end - - def test_hangup - hangup = Bandwidth::Voice::Hangup.new() - - response = Bandwidth::Voice::Response.new() - response.push(hangup) - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_pause - pause = Bandwidth::Voice::Pause.new({ - :duration => 2 - }) - - response = Bandwidth::Voice::Response.new() - response.push(pause) - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_pause_recording - pause_recording = Bandwidth::Voice::PauseRecording.new() - - response = Bandwidth::Voice::Response.new() - response.push(pause_recording) - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_play_audio - play_audio = Bandwidth::Voice::PlayAudio.new({ - :url => "https://test.com", - :username => "user", - :password => "pass" - }) - - response = Bandwidth::Voice::Response.new() - response.push(play_audio) - expected = 'https://test.com' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_record - record = Bandwidth::Voice::Record.new({ - :record_complete_url => "https://complete.com", - :record_complete_method => "POST", - :recording_available_url => "https://available.com", - :recording_available_method => "GET", - :transcribe => false, - :transcription_available_url => "https://transcribe.com", - :transcription_available_method => "POST", - :username => "user", - :password => "pass", - :tag => "tag", - :terminating_digits => "#", - :max_duration => 3, - :silence_timeout => 5, - :file_format => "wav", - :record_complete_fallback_url => "https://test.com", - :record_complete_fallback_method => "GET", - :fallback_username => "fuser", - :fallback_password => "fpass" - }) - - response = Bandwidth::Voice::Response.new() - response.push(record) - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_redirect - redirect = Bandwidth::Voice::Redirect.new({ - :redirect_url => "https://redirect.com", - :redirect_method => "GET", - :username => "user", - :password => "pass", - :tag => "tag", - :redirect_fallback_url => "https://test.com", - :redirect_fallback_method => "GET", - :fallback_username => "fuser", - :fallback_password => "fpass" - }) - - response = Bandwidth::Voice::Response.new() - response.push(redirect) - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_resume_recording - resume_recording = Bandwidth::Voice::ResumeRecording.new() - - response = Bandwidth::Voice::Response.new() - response.push(resume_recording) - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_send_dtmf - send_dtmf = Bandwidth::Voice::SendDtmf.new({ - :dtmf => "12w34", - :tone_duration => 75, - :tone_interval => 65 - }) - - response = Bandwidth::Voice::Response.new() - response.push(send_dtmf) - expected = '12w34' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_speak_sentence - speak_sentence = Bandwidth::Voice::SpeakSentence.new({ - :sentence => "test", - :voice => "julie", - :gender => "female", - :locale => "en_US" - }) - - response = Bandwidth::Voice::Response.new() - response.push(speak_sentence) - expected = 'test' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_speak_sentence_ssml - speak_sentence = Bandwidth::Voice::SpeakSentence.new({ - :sentence => 'Hello, you have reached the home of Antonio Mendoza.Please leave a message.', - }) - - response = Bandwidth::Voice::Response.new() - response.push(speak_sentence) - expected = 'Hello, you have reached the home of Antonio Mendoza.Please leave a message.' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_start_recording - start_recording = Bandwidth::Voice::StartRecording.new({ - :recording_available_url => "https://available.com", - :recording_available_method => "POST", - :transcribe => false, - :transcription_available_url => "https://transcribe.com", - :transcription_available_method => "GET", - :username => "user", - :password => "pass", - :tag => "tag", - :file_format => "mp3", - :multi_channel => true - }) - - response = Bandwidth::Voice::Response.new() - response.push(start_recording) - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_stop_recording - stop_recording = Bandwidth::Voice::StopRecording.new() - - response = Bandwidth::Voice::Response.new() - response.push(stop_recording) - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_transfer - phone_number = Bandwidth::Voice::PhoneNumber.new({ - :number => "+15554443333", - :transfer_answer_url => "https://phoneanswer.com", - :transfer_answer_method => "GET", - :transfer_disconnect_url => "https://phonedisconnect.com", - :transfer_disconnect_method => "POST", - :username => "phoneuser", - :password => "phonepassword", - :tag => "phonetag", - :transfer_answer_fallback_url => "https://test.com", - :transfer_answer_fallback_method => "GET", - :fallback_username => "fuser", - :fallback_password => "fpass" - }) - transfer = Bandwidth::Voice::Transfer.new({ - :transfer_caller_id => "+13334445555", - :call_timeout => 3, - :transfer_complete_url => "https://transfercomplete.com", - :transfer_complete_method => "POST", - :username => "transferuser", - :password => "transferpass", - :tag => "transfertag", - :diversion_treatment => "none", - :diversion_reason => "away", - :phone_numbers => [phone_number], - :transfer_complete_fallback_url => "https://test.com", - :transfer_complete_fallback_method => "GET", - :fallback_username => "fusern", - :fallback_password => "fpassw" - }) - - response = Bandwidth::Voice::Response.new() - response.push(transfer) - expected = '+15554443333' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_conference - conference = Bandwidth::Voice::Conference.new({ - :conference_name => 'my-conference', - :mute => false, - :hold => true, - :call_ids_to_coach => "c-123,c-234", - :conference_event_url => "https://test.com", - :conference_event_method => "POST", - :username => "user", - :password => "pass", - :tag => "tag", - :conference_event_fallback_url => "https://test2.com", - :conference_event_fallback_method => "POST", - :fallback_username => "fuser", - :fallback_password => "fpass" - }) - response = Bandwidth::Voice::Response.new() - response.push(conference) - - expected = 'my-conference' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_conference_coach_ids_array - conference = Bandwidth::Voice::Conference.new({ - :conference_name => 'my-conference', - :call_ids_to_coach => ["c-123", "c-234"], - }) - response = Bandwidth::Voice::Response.new() - response.push(conference) - - expected = 'my-conference' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_conference_no_coach - conference = Bandwidth::Voice::Conference.new({ - :conference_name => 'my-conference' - }) - response = Bandwidth::Voice::Response.new() - response.push(conference) - - expected = 'my-conference' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_mfa_messaging - body = TwoFactorCodeRequestSchema.new - body.from = BW_NUMBER - body.to = USER_NUMBER - body.application_id = BW_MESSAGING_APPLICATION_ID - body.scope = "scope" - body.digits = 6 - body.message = "Your temporary {NAME} {SCOPE} code is {CODE}" - - response = @bandwidth_client.multi_factor_auth_client.mfa.create_messaging_two_factor(BW_ACCOUNT_ID, body) - assert(response.data.message_id.length > 0, "message id value not set") - end - - def test_mfa_voice - body = TwoFactorCodeRequestSchema.new - body.from = BW_NUMBER - body.to = USER_NUMBER - body.application_id = BW_VOICE_APPLICATION_ID - body.scope = "scope" - body.digits = 6 - body.message = "Your temporary {NAME} {SCOPE} code is {CODE}" - - response = @bandwidth_client.multi_factor_auth_client.mfa.create_voice_two_factor(BW_ACCOUNT_ID, body) - assert(response.data.call_id.length > 0, "call id value not set") - end - - def test_mfa_verify - body = TwoFactorVerifyRequestSchema.new - body.to = "+1000" + rand(1111111..9999999).to_s - body.application_id = BW_VOICE_APPLICATION_ID - body.scope = "scope" - body.code = "123456" - body.expiration_time_in_minutes = 3 - response = @bandwidth_client.multi_factor_auth_client.mfa.create_verify_two_factor(BW_ACCOUNT_ID, body) - #Ruby has no check to see if variables are of type boolean - #An explicit true/false check is required - assert(response.data.valid == true || response.data.valid == false, "'valid' variable is not a boolean") - end - - def test_bridge - bridge = Bandwidth::Voice::Bridge.new({ - :call_id => "c-c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d", - :bridge_complete_url => "https://test.com", - :bridge_complete_method => "POST", - :bridge_target_complete_url => "https://test2.com", - :bridge_target_complete_method => "GET", - :username => "user", - :password => "pass", - :tag => "custom tag", - :bridge_complete_fallback_url => "https://test3.com", - :bridge_complete_fallback_method => "GET", - :bridge_target_complete_fallback_url => "https://test4.com", - :bridge_target_complete_fallback_method => "POST", - :fallback_username => "fuser", - :fallback_password => "fpass" - }) - - response = Bandwidth::Voice::Response.new() - response.push(bridge) - - expected = 'c-c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_ring - ring = Bandwidth::Voice::Ring.new({ - :duration => 5, - :answer_call => false - }) - - response = Bandwidth::Voice::Response.new() - response.push(ring) - - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_start_gather - start_gather = Bandwidth::Voice::StartGather.new({ - :username => "user", - :password => "pass", - :tag => "custom tag", - :dtmf_url => "https://test.com", - :dtmf_method => "GET" - }) - - response = Bandwidth::Voice::Response.new() - response.push(start_gather) - - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_stop_gather - stop_gather = Bandwidth::Voice::StopGather.new() - - response = Bandwidth::Voice::Response.new() - response.push(stop_gather) - - expected = '' - actual = response.to_bxml() - assert_equal(expected, actual) - end - - def test_tn_lookup - body = OrderRequest.new - body.tns = [BW_NUMBER] - create_response = @bandwidth_client.phone_number_lookup_client.client.create_lookup_request(BW_ACCOUNT_ID, body) - assert(create_response.data.request_id.length > 0, "request_id value not set") - - request_id = create_response.data.request_id - get_response = @bandwidth_client.phone_number_lookup_client.client.get_lookup_request_status(BW_ACCOUNT_ID, request_id) - assert(get_response.data.status.length > 0, "status value not set") - end - - def test_webrtc_generate_bxml - expected = 'sip:sipx.webrtc.bandwidth.com:5060' - actual = Bandwidth::WebRtc.generate_bxml('asdf', 'c-93d6f3c0-be584596-0b74-4fa2-8015-d8ede84bd1a4') - assert_equal(expected, actual) - end - - def test_webrtc_generate_transfer_bxml_verb - expected = 'sip:sipx.webrtc.bandwidth.com:5060' - actual = Bandwidth::WebRtc.generate_transfer_bxml_verb('asdf', 'c-93d6f3c0-be584596-0b74-4fa2-8015-d8ede84bd1a4') - assert_equal(expected, actual) - end - - def test_start_stream_bxml_verb - expected = '' - response = Bandwidth::Voice::Response.new() - - stream_param1 = Bandwidth::Voice::StreamParam.new({ - :name => "name1", - :value => "value1" - }) - - start_stream = Bandwidth::Voice::StartStream.new({ - :destination => "https://www.test.com/stream", - :name => "test_stream", - :tracks => "inbound", - :streamEventUrl => "https://www.test.com/event", - :streamEventMethod => "POST", - :username => "username", - :password => "password", - :stream_params => stream_param1 - }) - - response.push(start_stream) - actual = response.to_bxml() - - assert_equal(expected, actual) - end - - def test_start_stream_multiple_nested_stream_params - expected = '' - response = Bandwidth::Voice::Response.new() - - stream_param1 = Bandwidth::Voice::StreamParam.new({ - :name => "name1", - :value => "value1" - }) - - stream_param2 = Bandwidth::Voice::StreamParam.new({ - :name => "name2", - :value => "value2" - }) - - start_stream = Bandwidth::Voice::StartStream.new({ - :destination => "https://www.test.com/stream", - :name => "test_stream", - :tracks => "inbound", - :streamEventUrl => "https://www.test.com/event", - :streamEventMethod => "POST", - :username => "username", - :password => "password", - :nested_verbs => [stream_param1, stream_param2] - }) - - response.push(start_stream) - actual = response.to_bxml() - - assert_equal(expected, actual) - end - - def test_stop_stream_bxml_verb - expected = '' - response = Bandwidth::Voice::Response.new() - stop_stream = Bandwidth::Voice::StopStream.new({ - :name => "test_stream" - }) - response.push(stop_stream) - actual = response.to_bxml() - - assert_equal(expected, actual) - end -end From bb9e93c7d5cffc1b93a27068a39feabd6eb5f345 Mon Sep 17 00:00:00 2001 From: Cameron Koegel Date: Fri, 14 Oct 2022 10:45:24 -0400 Subject: [PATCH 02/30] remove old sdk --- lib/bandwidth.rb | 73 - lib/bandwidth/api_helper.rb | 280 --- lib/bandwidth/client.rb | 75 - lib/bandwidth/configuration.rb | 209 -- lib/bandwidth/exceptions/api_exception.rb | 20 - lib/bandwidth/http/api_response.rb | 38 - .../http/auth/messaging_basic_auth.rb | 22 - .../http/auth/multi_factor_auth_basic_auth.rb | 22 - .../auth/phone_number_lookup_basic_auth.rb | 22 - lib/bandwidth/http/auth/voice_basic_auth.rb | 22 - lib/bandwidth/http/auth/web_rtc_basic_auth.rb | 22 - lib/bandwidth/http/faraday_client.rb | 73 - lib/bandwidth/http/http_call_back.rb | 24 - lib/bandwidth/http/http_client.rb | 104 - lib/bandwidth/http/http_method_enum.rb | 13 - lib/bandwidth/http/http_request.rb | 50 - lib/bandwidth/http/http_response.rb | 29 - lib/bandwidth/messaging_lib/messaging.rb | 25 - .../messaging_lib/messaging/client.rb | 60 - .../messaging/controllers/api_controller.rb | 491 ----- .../messaging/controllers/base_controller.rb | 47 - .../exceptions/messaging_exception.rb | 37 - .../models/bandwidth_callback_message.rb | 100 - .../messaging/models/bandwidth_message.rb | 164 -- .../models/bandwidth_message_item.rb | 203 -- .../models/bandwidth_messages_list.rb | 79 - .../messaging/models/deferred_result.rb | 60 - .../messaging_lib/messaging/models/media.rb | 70 - .../messaging/models/message_request.rb | 111 - .../messaging/models/page_info.rb | 82 - .../messaging/models/priority_enum.rb | 19 - .../messaging_lib/messaging/models/tag.rb | 60 - lib/bandwidth/models/base_model.rb | 58 - .../multi_factor_auth.rb | 23 - .../multi_factor_auth/client.rb | 60 - .../controllers/base_controller.rb | 47 - .../controllers/mfa_controller.rb | 214 -- .../error_with_request_exception.rb | 37 - .../exceptions/forbidden_request_exception.rb | 32 - .../unauthorized_request_exception.rb | 32 - .../models/two_factor_code_request_schema.rb | 103 - .../models/two_factor_messaging_response.rb | 50 - .../models/two_factor_verify_code_response.rb | 50 - .../two_factor_verify_request_schema.rb | 94 - .../models/two_factor_voice_response.rb | 50 - .../phone_number_lookup.rb | 20 - .../phone_number_lookup/client.rb | 60 - .../controllers/api_controller.rb | 1553 -------------- .../controllers/base_controller.rb | 47 - .../accounts_tnlookup400_error_exception.rb | 32 - .../models/order_request.rb | 50 - .../models/order_response.rb | 61 - .../models/order_status.rb | 95 - .../phone_number_lookup/models/result.rb | 132 -- lib/bandwidth/utilities/date_time_helper.rb | 156 -- lib/bandwidth/utilities/file_wrapper.rb | 16 - lib/bandwidth/voice_lib/bxml/bxml.rb | 36 - lib/bandwidth/voice_lib/bxml/response.rb | 39 - lib/bandwidth/voice_lib/bxml/verbs/bridge.rb | 28 - .../voice_lib/bxml/verbs/conference.rb | 32 - lib/bandwidth/voice_lib/bxml/verbs/forward.rb | 18 - lib/bandwidth/voice_lib/bxml/verbs/gather.rb | 49 - lib/bandwidth/voice_lib/bxml/verbs/hangup.rb | 14 - lib/bandwidth/voice_lib/bxml/verbs/pause.rb | 15 - .../voice_lib/bxml/verbs/pause_recording.rb | 14 - .../voice_lib/bxml/verbs/phone_number.rb | 24 - .../voice_lib/bxml/verbs/play_audio.rb | 17 - lib/bandwidth/voice_lib/bxml/verbs/record.rb | 33 - .../voice_lib/bxml/verbs/redirect.rb | 24 - .../voice_lib/bxml/verbs/resume_recording.rb | 14 - lib/bandwidth/voice_lib/bxml/verbs/ring.rb | 16 - .../voice_lib/bxml/verbs/send_dtmf.rb | 16 - lib/bandwidth/voice_lib/bxml/verbs/sip_uri.rb | 25 - .../voice_lib/bxml/verbs/speak_sentence.rb | 18 - .../voice_lib/bxml/verbs/start_gather.rb | 20 - .../voice_lib/bxml/verbs/start_recording.rb | 25 - .../voice_lib/bxml/verbs/stop_gather.rb | 14 - .../voice_lib/bxml/verbs/stop_recording.rb | 14 - .../voice_lib/bxml/verbs/stop_stream.rb | 16 - lib/bandwidth/voice_lib/bxml/verbs/tag.rb | 13 - .../voice_lib/bxml/verbs/transfer.rb | 48 - .../voice_lib/bxml/verbs/xml_verb.rb | 26 - lib/bandwidth/voice_lib/voice.rb | 48 - lib/bandwidth/voice_lib/voice/client.rb | 60 - .../voice/controllers/api_controller.rb | 1820 ----------------- .../voice/controllers/base_controller.rb | 47 - .../voice/exceptions/api_error_exception.rb | 42 - .../models/answer_fallback_method_enum.rb | 17 - .../voice/models/answer_method_enum.rb | 17 - .../voice_lib/voice/models/call_callback.rb | 343 ---- .../voice/models/call_recording_metadata.rb | 250 --- .../voice_lib/voice/models/call_state.rb | 301 --- .../voice/models/callback_method_enum.rb | 17 - .../voice/models/conference_callback.rb | 211 -- .../models/conference_event_method_enum.rb | 17 - .../voice/models/conference_member_state.rb | 103 - .../models/conference_recording_metadata.rb | 173 -- .../voice/models/conference_state.rb | 153 -- .../voice/models/create_call_request.rb | 236 --- .../voice/models/create_call_response.rb | 266 --- .../voice_lib/voice/models/direction_enum.rb | 17 - .../voice/models/disconnect_method_enum.rb | 17 - .../voice_lib/voice/models/diversion.rb | 80 - .../voice/models/fallback_method_enum.rb | 17 - .../voice/models/file_format_enum.rb | 17 - .../models/machine_detection_configuration.rb | 231 --- .../voice_lib/voice/models/mode_enum.rb | 20 - .../models/modify_call_recording_request.rb | 48 - .../voice/models/modify_call_request.rb | 156 -- .../voice/models/modify_conference_request.rb | 144 -- .../models/redirect_fallback_method_enum.rb | 17 - .../voice/models/redirect_method_enum.rb | 17 - .../voice_lib/voice/models/state1_enum.rb | 20 - .../voice_lib/voice/models/state_enum.rb | 17 - .../voice_lib/voice/models/status_enum.rb | 17 - .../models/transcribe_recording_request.rb | 108 - .../voice_lib/voice/models/transcript.rb | 60 - .../voice_lib/voice/models/transcription.rb | 80 - .../voice/models/transcription_metadata.rb | 89 - .../voice/models/transcription_response.rb | 59 - .../web_rtc_lib/utils/web_rtc_transfer.rb | 18 - lib/bandwidth/web_rtc_lib/web_rtc.rb | 22 - lib/bandwidth/web_rtc_lib/web_rtc/client.rb | 60 - .../web_rtc/controllers/api_controller.rb | 703 ------- .../web_rtc/controllers/base_controller.rb | 47 - .../web_rtc/exceptions/error_exception.rb | 37 - .../models/accounts_participants_response.rb | 62 - .../web_rtc/models/device_api_version_enum.rb | 17 - .../web_rtc_lib/web_rtc/models/participant.rb | 115 -- .../models/participant_subscription.rb | 48 - .../web_rtc/models/publish_permission_enum.rb | 17 - .../web_rtc_lib/web_rtc/models/session.rb | 60 - .../web_rtc/models/subscriptions.rb | 71 - test/controllers/controller_test_base.rb | 21 - test/http_response_catcher.rb | 19 - test/test_helper.rb | 94 - 136 files changed, 13149 deletions(-) delete mode 100644 lib/bandwidth.rb delete mode 100644 lib/bandwidth/api_helper.rb delete mode 100644 lib/bandwidth/client.rb delete mode 100644 lib/bandwidth/configuration.rb delete mode 100644 lib/bandwidth/exceptions/api_exception.rb delete mode 100644 lib/bandwidth/http/api_response.rb delete mode 100644 lib/bandwidth/http/auth/messaging_basic_auth.rb delete mode 100644 lib/bandwidth/http/auth/multi_factor_auth_basic_auth.rb delete mode 100644 lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb delete mode 100644 lib/bandwidth/http/auth/voice_basic_auth.rb delete mode 100644 lib/bandwidth/http/auth/web_rtc_basic_auth.rb delete mode 100644 lib/bandwidth/http/faraday_client.rb delete mode 100644 lib/bandwidth/http/http_call_back.rb delete mode 100644 lib/bandwidth/http/http_client.rb delete mode 100644 lib/bandwidth/http/http_method_enum.rb delete mode 100644 lib/bandwidth/http/http_request.rb delete mode 100644 lib/bandwidth/http/http_response.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/client.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/models/media.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/models/message_request.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/models/page_info.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/models/priority_enum.rb delete mode 100644 lib/bandwidth/messaging_lib/messaging/models/tag.rb delete mode 100644 lib/bandwidth/models/base_model.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/client.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/base_controller.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/mfa_controller.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/forbidden_request_exception.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/unauthorized_request_exception.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_messaging_response.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_code_response.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb delete mode 100644 lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_voice_response.rb delete mode 100644 lib/bandwidth/phone_number_lookup_lib/phone_number_lookup.rb delete mode 100644 lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/client.rb delete mode 100644 lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb delete mode 100644 lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb delete mode 100644 lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb delete mode 100644 lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb delete mode 100644 lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb delete mode 100644 lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb delete mode 100644 lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb delete mode 100644 lib/bandwidth/utilities/date_time_helper.rb delete mode 100644 lib/bandwidth/utilities/file_wrapper.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/bxml.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/response.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/bridge.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/conference.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/forward.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/gather.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/hangup.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/pause.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/pause_recording.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/play_audio.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/record.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/redirect.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/resume_recording.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/ring.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/sip_uri.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/speak_sentence.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/start_gather.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/start_recording.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/stop_gather.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/stop_recording.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/stop_stream.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/tag.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/xml_verb.rb delete mode 100644 lib/bandwidth/voice_lib/voice.rb delete mode 100644 lib/bandwidth/voice_lib/voice/client.rb delete mode 100644 lib/bandwidth/voice_lib/voice/controllers/api_controller.rb delete mode 100644 lib/bandwidth/voice_lib/voice/controllers/base_controller.rb delete mode 100644 lib/bandwidth/voice_lib/voice/exceptions/api_error_exception.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/answer_fallback_method_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/call_callback.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/call_state.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/conference_callback.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/conference_member_state.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/conference_state.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/create_call_request.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/create_call_response.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/direction_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/diversion.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/fallback_method_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/file_format_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/machine_detection_configuration.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/mode_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/modify_call_recording_request.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/modify_call_request.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/modify_conference_request.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/redirect_fallback_method_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/state1_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/state_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/status_enum.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/transcribe_recording_request.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/transcript.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/transcription.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb delete mode 100644 lib/bandwidth/voice_lib/voice/models/transcription_response.rb delete mode 100644 lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc/client.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb delete mode 100644 lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb delete mode 100644 test/controllers/controller_test_base.rb delete mode 100644 test/http_response_catcher.rb delete mode 100644 test/test_helper.rb diff --git a/lib/bandwidth.rb b/lib/bandwidth.rb deleted file mode 100644 index 5cb724ed..00000000 --- a/lib/bandwidth.rb +++ /dev/null @@ -1,73 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'date' -require 'json' -require 'faraday' -require 'certifi' -require 'logging' - -require_relative 'bandwidth/api_helper' -require_relative 'bandwidth/client' - -# Utilities -require_relative 'bandwidth/utilities/file_wrapper' -require_relative 'bandwidth/utilities/date_time_helper' - -# Http -require_relative 'bandwidth/http/api_response' -require_relative 'bandwidth/http/http_call_back' -require_relative 'bandwidth/http/http_client' -require_relative 'bandwidth/http/faraday_client' -require_relative 'bandwidth/http/http_method_enum' -require_relative 'bandwidth/http/http_request' -require_relative 'bandwidth/http/http_response' - -# Models -require_relative 'bandwidth/models/base_model' - -# Exceptions -require_relative 'bandwidth/exceptions/api_exception' - -require_relative 'bandwidth/configuration' - -# Namespaces -require_relative 'bandwidth/messaging_lib/messaging' -require_relative 'bandwidth/http/auth/messaging_basic_auth' -require_relative 'bandwidth/multi_factor_auth_lib/multi_factor_auth' -require_relative 'bandwidth/http/auth/multi_factor_auth_basic_auth' -require_relative 'bandwidth/phone_number_lookup_lib/phone_number_lookup' -require_relative 'bandwidth/http/auth/phone_number_lookup_basic_auth' -require_relative 'bandwidth/voice_lib/voice' -require_relative 'bandwidth/http/auth/voice_basic_auth' -require_relative 'bandwidth/web_rtc_lib/web_rtc' -require_relative 'bandwidth/http/auth/web_rtc_basic_auth' -require_relative 'bandwidth/http/auth/web_rtc_basic_auth.rb' - -# External Files -require_relative 'bandwidth/voice_lib/bxml/response.rb' -require_relative 'bandwidth/voice_lib/bxml/bxml.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/bridge.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/conference.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/forward.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/gather.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/hangup.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/pause.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/pause_recording.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/phone_number.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/play_audio.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/record.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/redirect.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/resume_recording.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/ring.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/send_dtmf.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/speak_sentence.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/start_gather.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/start_recording.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/stop_gather.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/stop_recording.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/transfer.rb' -require_relative 'bandwidth/voice_lib/bxml/verbs/xml_verb.rb' -require_relative 'bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb' diff --git a/lib/bandwidth/api_helper.rb b/lib/bandwidth/api_helper.rb deleted file mode 100644 index 8020e453..00000000 --- a/lib/bandwidth/api_helper.rb +++ /dev/null @@ -1,280 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # API utility class - class APIHelper - # Serializes an array parameter (creates key value pairs). - # @param [String] The name of the parameter. - # @param [Array] The value of the parameter. - # @param [String] The format of the serialization. - def self.serialize_array(key, array, formatting: 'indexed') - tuples = [] - - case formatting - when 'unindexed' - tuples += array.map { |element| ["#{key}[]", element] } - when 'indexed' - tuples += array.map.with_index do |element, index| - ["#{key}[#{index}]", element] - end - when 'plain' - tuples += array.map { |element| [key, element] } - else - raise ArgumentError, 'Invalid format provided.' - end - tuples - end - - # Replaces template parameters in the given url. - # @param [String] The query string builder to replace the template - # parameters. - # @param [Hash] The parameters to replace in the url. - def self.append_url_with_template_parameters(query_builder, parameters) - # perform parameter validation - unless query_builder.instance_of? String - raise ArgumentError, 'Given value for parameter \"query_builder\" is - invalid.' - end - - # Return if there are no parameters to replace. - return query_builder if parameters.nil? - - parameters.each do |key, val| - if val.nil? - replace_value = '' - elsif val['value'].instance_of? Array - if val['encode'] == true - val['value'].map! { |element| CGI.escape(element.to_s) } - else - val['value'].map!(&:to_s) - end - replace_value = val['value'].join('/') - else - replace_value = if val['encode'] == true - CGI.escape(val['value'].to_s) - else - val['value'].to_s - end - end - - # Find the template parameter and replace it with its value. - query_builder = query_builder.gsub("{#{key}}", replace_value) - end - query_builder - end - - # Appends the given set of parameters to the given query string. - # @param [String] The query string builder to add the query parameters to. - # @param [Hash] The parameters to append. - def self.append_url_with_query_parameters(query_builder, parameters) - # Perform parameter validation. - unless query_builder.instance_of? String - raise ArgumentError, 'Given value for parameter \"query_builder\" - is invalid.' - end - - # Return if there are no parameters to replace. - return query_builder if parameters.nil? - - array_serialization = 'indexed' - - parameters.each do |key, value| - seperator = query_builder.include?('?') ? '&' : '?' - unless value.nil? - if value.instance_of? Array - value.compact! - query_builder += case array_serialization - when 'csv' - "#{seperator}#{key}=#{value.map do |element| - CGI.escape(element.to_s) - end.join(',')}" - when 'psv' - "#{seperator}#{key}=#{value.map do |element| - CGI.escape(element.to_s) - end.join('|')}" - when 'tsv' - "#{seperator}#{key}=#{value.map do |element| - CGI.escape(element.to_s) - end.join("\t")}" - else - "#{seperator}#{APIHelper.serialize_array( - key, value, formatting: array_serialization - ).map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" } - .join('&')}" - end - else - query_builder += "#{seperator}#{key}=#{CGI.escape(value.to_s)}" - end - end - end - query_builder - end - - # Validates and processes the given Url. - # @param [String] The given Url to process. - # @return [String] Pre-processed Url as string. - def self.clean_url(url) - # Perform parameter validation. - raise ArgumentError, 'Invalid Url.' unless url.instance_of? String - - # Ensure that the urls are absolute. - matches = url.match(%r{^(https?://[^/]+)}) - raise ArgumentError, 'Invalid Url format.' if matches.nil? - - # Get the http protocol match. - protocol = matches[1] - - # Check if parameters exist. - index = url.index('?') - - # Remove redundant forward slashes. - query = url[protocol.length...(!index.nil? ? index : url.length)] - query.gsub!(%r{//+}, '/') - - # Get the parameters. - parameters = !index.nil? ? url[url.index('?')...url.length] : '' - - # Return processed url. - protocol + query + parameters - end - - # Parses JSON string. - # @param [String] A JSON string. - def self.json_deserialize(json) - return {} if json.nil? || json.empty? - JSON.parse(json) - rescue StandardError - raise TypeError, 'Server responded with invalid JSON.' - end - - # Removes elements with empty values from a hash. - # @param [Hash] The hash to clean. - def self.clean_hash(hash) - hash.delete_if { |_key, value| value.to_s.strip.empty? } - end - - # Form encodes a hash of parameters. - # @param [Hash] The hash of parameters to encode. - # @return [Hash] A hash with the same parameters form encoded. - def self.form_encode_parameters(form_parameters) - array_serialization = 'indexed' - encoded = {} - form_parameters.each do |key, value| - encoded.merge!(APIHelper.form_encode(value, key, formatting: - array_serialization)) - end - encoded - end - - def self.custom_merge(a, b) - x = {} - a.each do |key, value_a| - b.each do |k, value_b| - next unless key == k - - x[k] = [] - if value_a.instance_of? Array - value_a.each do |v| - x[k].push(v) - end - else - x[k].push(value_a) - end - if value_b.instance_of? Array - value_b.each do |v| - x[k].push(v) - end - else - x[k].push(value_b) - end - a.delete(k) - b.delete(k) - end - end - x.merge!(a) - x.merge!(b) - x - end - - # Form encodes an object. - # @param [Dynamic] An object to form encode. - # @param [String] The name of the object. - # @return [Hash] A form encoded representation of the object in the form - # of a hash. - def self.form_encode(obj, instance_name, formatting: 'indexed') - retval = {} - - serializable_types = [String, Numeric, TrueClass, - FalseClass, Date, DateTime] - - # If this is a structure, resolve it's field names. - obj = obj.to_hash if obj.is_a? BaseModel - - # Create a form encoded hash for this object. - if obj.nil? - nil - elsif obj.instance_of? Array - if formatting == 'indexed' - obj.each_with_index do |value, index| - retval.merge!(APIHelper.form_encode(value, "#{instance_name}[#{index}]")) - end - elsif serializable_types.map { |x| obj[0].is_a? x }.any? - obj.each do |value| - abc = if formatting == 'unindexed' - APIHelper.form_encode(value, "#{instance_name}[]", - formatting: formatting) - else - APIHelper.form_encode(value, instance_name, - formatting: formatting) - end - retval = APIHelper.custom_merge(retval, abc) - end - else - obj.each_with_index do |value, index| - retval.merge!(APIHelper.form_encode(value, "#{instance_name}[#{index}]", - formatting: formatting)) - end - end - elsif obj.instance_of? Hash - obj.each do |key, value| - retval.merge!(APIHelper.form_encode(value, "#{instance_name}[#{key}]", - formatting: formatting)) - end - elsif obj.instance_of? File - retval[instance_name] = UploadIO.new( - obj, 'application/octet-stream', File.basename(obj.path) - ) - else - retval[instance_name] = obj - end - retval - end - - # Retrieves a field from a Hash/Array based on an Array of keys/indexes - # @param [Hash, Array] The hash to extract data from - # @param [Array] The keys/indexes to use - # @return [Object] The extracted value - def self.map_response(obj, keys) - val = obj - begin - keys.each do |key| - val = if val.is_a? Array - if key.to_i.to_s == key - val[key.to_i] - else - val = nil - end - else - val.fetch(key.to_sym) - end - end - rescue NoMethodError, TypeError, IndexError - val = nil - end - val - end - end -end diff --git a/lib/bandwidth/client.rb b/lib/bandwidth/client.rb deleted file mode 100644 index da27ae0f..00000000 --- a/lib/bandwidth/client.rb +++ /dev/null @@ -1,75 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # bandwidth client class. - class Client - attr_reader :config - # Access to messaging_client controller. - # @return [Messaging::Client] Returns the client instance. - def messaging_client - @messaging_client ||= Messaging::Client.new(config: config) - end - # Access to multi_factor_auth_client controller. - # @return [MultiFactorAuth::Client] Returns the client instance. - def multi_factor_auth_client - @multi_factor_auth_client ||= MultiFactorAuth::Client.new(config: config) - end - # Access to phone_number_lookup_client controller. - # @return [PhoneNumberLookup::Client] Returns the client instance. - def phone_number_lookup_client - @phone_number_lookup_client ||= PhoneNumberLookup::Client.new(config: config) - end - # Access to voice_client controller. - # @return [Voice::Client] Returns the client instance. - def voice_client - @voice_client ||= Voice::Client.new(config: config) - end - # Access to web_rtc_client controller. - # @return [WebRtc::Client] Returns the client instance. - def web_rtc_client - @web_rtc_client ||= WebRtc::Client.new(config: config) - end - - def initialize(timeout: 60, max_retries: 0, retry_interval: 1, - backoff_factor: 2, - retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524], - retry_methods: %i[get put get put], - environment: Environment::PRODUCTION, - base_url: 'https://www.example.com', - messaging_basic_auth_user_name: 'TODO: Replace', - messaging_basic_auth_password: 'TODO: Replace', - multi_factor_auth_basic_auth_user_name: 'TODO: Replace', - multi_factor_auth_basic_auth_password: 'TODO: Replace', - phone_number_lookup_basic_auth_user_name: 'TODO: Replace', - phone_number_lookup_basic_auth_password: 'TODO: Replace', - voice_basic_auth_user_name: 'TODO: Replace', - voice_basic_auth_password: 'TODO: Replace', - web_rtc_basic_auth_user_name: 'TODO: Replace', - web_rtc_basic_auth_password: 'TODO: Replace', config: nil) - @config = if config.nil? - Configuration.new(timeout: timeout, max_retries: max_retries, - retry_interval: retry_interval, - backoff_factor: backoff_factor, - retry_statuses: retry_statuses, - retry_methods: retry_methods, - environment: environment, - base_url: base_url, - messaging_basic_auth_user_name: messaging_basic_auth_user_name, - messaging_basic_auth_password: messaging_basic_auth_password, - multi_factor_auth_basic_auth_user_name: multi_factor_auth_basic_auth_user_name, - multi_factor_auth_basic_auth_password: multi_factor_auth_basic_auth_password, - phone_number_lookup_basic_auth_user_name: phone_number_lookup_basic_auth_user_name, - phone_number_lookup_basic_auth_password: phone_number_lookup_basic_auth_password, - voice_basic_auth_user_name: voice_basic_auth_user_name, - voice_basic_auth_password: voice_basic_auth_password, - web_rtc_basic_auth_user_name: web_rtc_basic_auth_user_name, - web_rtc_basic_auth_password: web_rtc_basic_auth_password) - else - config - end - end - end -end diff --git a/lib/bandwidth/configuration.rb b/lib/bandwidth/configuration.rb deleted file mode 100644 index 5c7aef48..00000000 --- a/lib/bandwidth/configuration.rb +++ /dev/null @@ -1,209 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # An enum for SDK environments. - class Environment - ENVIRONMENT = [ - PRODUCTION = 'production'.freeze, - CUSTOM = 'custom'.freeze - ].freeze - end - - # An enum for API servers. - class Server - SERVER = [ - DEFAULT = 'default'.freeze, - MESSAGINGDEFAULT = 'MessagingDefault'.freeze, - MULTIFACTORAUTHDEFAULT = 'MultiFactorAuthDefault'.freeze, - PHONENUMBERLOOKUPDEFAULT = 'PhoneNumberLookupDefault'.freeze, - VOICEDEFAULT = 'VoiceDefault'.freeze, - WEBRTCDEFAULT = 'WebRtcDefault'.freeze - ].freeze - end - - # All configuration including auth info and base URI for the API access - # are configured in this class. - class Configuration - # The attribute readers for properties. - attr_reader :http_client, :timeout, :max_retries, :retry_interval, :backoff_factor, - :retry_statuses, :retry_methods, :environment, :base_url, - :messaging_basic_auth_user_name, :messaging_basic_auth_password, - :multi_factor_auth_basic_auth_user_name, :multi_factor_auth_basic_auth_password, - :phone_number_lookup_basic_auth_user_name, :phone_number_lookup_basic_auth_password, - :voice_basic_auth_user_name, :voice_basic_auth_password, - :web_rtc_basic_auth_user_name, :web_rtc_basic_auth_password - - class << self - attr_reader :environments - end - - def initialize(timeout: 60, max_retries: 0, retry_interval: 1, - backoff_factor: 2, - retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524], - retry_methods: %i[get put get put], - environment: Environment::PRODUCTION, - base_url: 'https://www.example.com', - messaging_basic_auth_user_name: 'TODO: Replace', - messaging_basic_auth_password: 'TODO: Replace', - multi_factor_auth_basic_auth_user_name: 'TODO: Replace', - multi_factor_auth_basic_auth_password: 'TODO: Replace', - phone_number_lookup_basic_auth_user_name: 'TODO: Replace', - phone_number_lookup_basic_auth_password: 'TODO: Replace', - voice_basic_auth_user_name: 'TODO: Replace', - voice_basic_auth_password: 'TODO: Replace', - web_rtc_basic_auth_user_name: 'TODO: Replace', - web_rtc_basic_auth_password: 'TODO: Replace') - # The value to use for connection timeout - @timeout = timeout - - # The number of times to retry an endpoint call if it fails - @max_retries = max_retries - - # Pause in seconds between retries - @retry_interval = retry_interval - - # The amount to multiply each successive retry's interval amount - # by in order to provide backoff - @backoff_factor = backoff_factor - - # A list of HTTP statuses to retry - @retry_statuses = retry_statuses - - # A list of HTTP methods to retry - @retry_methods = retry_methods - - # Current API environment - @environment = String(environment) - - # baseUrl value - @base_url = base_url - - # The username to use with basic authentication - @messaging_basic_auth_user_name = messaging_basic_auth_user_name - - # The password to use with basic authentication - @messaging_basic_auth_password = messaging_basic_auth_password - - # The username to use with basic authentication - @multi_factor_auth_basic_auth_user_name = multi_factor_auth_basic_auth_user_name - - # The password to use with basic authentication - @multi_factor_auth_basic_auth_password = multi_factor_auth_basic_auth_password - - # The username to use with basic authentication - @phone_number_lookup_basic_auth_user_name = phone_number_lookup_basic_auth_user_name - - # The password to use with basic authentication - @phone_number_lookup_basic_auth_password = phone_number_lookup_basic_auth_password - - # The username to use with basic authentication - @voice_basic_auth_user_name = voice_basic_auth_user_name - - # The password to use with basic authentication - @voice_basic_auth_password = voice_basic_auth_password - - # The username to use with basic authentication - @web_rtc_basic_auth_user_name = web_rtc_basic_auth_user_name - - # The password to use with basic authentication - @web_rtc_basic_auth_password = web_rtc_basic_auth_password - - # The Http Client to use for making requests. - @http_client = create_http_client - end - - def clone_with(timeout: nil, max_retries: nil, retry_interval: nil, - backoff_factor: nil, retry_statuses: nil, retry_methods: nil, - environment: nil, base_url: nil, - messaging_basic_auth_user_name: nil, - messaging_basic_auth_password: nil, - multi_factor_auth_basic_auth_user_name: nil, - multi_factor_auth_basic_auth_password: nil, - phone_number_lookup_basic_auth_user_name: nil, - phone_number_lookup_basic_auth_password: nil, - voice_basic_auth_user_name: nil, - voice_basic_auth_password: nil, - web_rtc_basic_auth_user_name: nil, - web_rtc_basic_auth_password: nil) - timeout ||= self.timeout - max_retries ||= self.max_retries - retry_interval ||= self.retry_interval - backoff_factor ||= self.backoff_factor - retry_statuses ||= self.retry_statuses - retry_methods ||= self.retry_methods - environment ||= self.environment - base_url ||= self.base_url - messaging_basic_auth_user_name ||= self.messaging_basic_auth_user_name - messaging_basic_auth_password ||= self.messaging_basic_auth_password - multi_factor_auth_basic_auth_user_name ||= self.multi_factor_auth_basic_auth_user_name - multi_factor_auth_basic_auth_password ||= self.multi_factor_auth_basic_auth_password - phone_number_lookup_basic_auth_user_name ||= self.phone_number_lookup_basic_auth_user_name - phone_number_lookup_basic_auth_password ||= self.phone_number_lookup_basic_auth_password - voice_basic_auth_user_name ||= self.voice_basic_auth_user_name - voice_basic_auth_password ||= self.voice_basic_auth_password - web_rtc_basic_auth_user_name ||= self.web_rtc_basic_auth_user_name - web_rtc_basic_auth_password ||= self.web_rtc_basic_auth_password - - Configuration.new( - timeout: timeout, max_retries: max_retries, - retry_interval: retry_interval, backoff_factor: backoff_factor, - retry_statuses: retry_statuses, retry_methods: retry_methods, - environment: environment, base_url: base_url, - messaging_basic_auth_user_name: messaging_basic_auth_user_name, - messaging_basic_auth_password: messaging_basic_auth_password, - multi_factor_auth_basic_auth_user_name: multi_factor_auth_basic_auth_user_name, - multi_factor_auth_basic_auth_password: multi_factor_auth_basic_auth_password, - phone_number_lookup_basic_auth_user_name: phone_number_lookup_basic_auth_user_name, - phone_number_lookup_basic_auth_password: phone_number_lookup_basic_auth_password, - voice_basic_auth_user_name: voice_basic_auth_user_name, - voice_basic_auth_password: voice_basic_auth_password, - web_rtc_basic_auth_user_name: web_rtc_basic_auth_user_name, - web_rtc_basic_auth_password: web_rtc_basic_auth_password - ) - end - - def create_http_client - FaradayClient.new(timeout: timeout, max_retries: max_retries, - retry_interval: retry_interval, - backoff_factor: backoff_factor, - retry_statuses: retry_statuses, - retry_methods: retry_methods) - end - - # All the environments the SDK can run in. - ENVIRONMENTS = { - Environment::PRODUCTION => { - Server::DEFAULT => 'api.bandwidth.com', - Server::MESSAGINGDEFAULT => 'https://messaging.bandwidth.com/api/v2', - Server::MULTIFACTORAUTHDEFAULT => 'https://mfa.bandwidth.com/api/v1', - Server::PHONENUMBERLOOKUPDEFAULT => 'https://numbers.bandwidth.com/api/v1', - Server::VOICEDEFAULT => 'https://voice.bandwidth.com', - Server::WEBRTCDEFAULT => 'https://api.webrtc.bandwidth.com/v1' - }, - Environment::CUSTOM => { - Server::DEFAULT => '{base_url}', - Server::MESSAGINGDEFAULT => '{base_url}', - Server::MULTIFACTORAUTHDEFAULT => '{base_url}', - Server::PHONENUMBERLOOKUPDEFAULT => '{base_url}', - Server::VOICEDEFAULT => '{base_url}', - Server::WEBRTCDEFAULT => '{base_url}' - } - }.freeze - - # Generates the appropriate base URI for the environment and the server. - # @param [Configuration::Server] The server enum for which the base URI is - # required. - # @return [String] The base URI. - def get_base_uri(server = Server::DEFAULT) - parameters = { - 'base_url' => { 'value' => base_url, 'encode' => false } - } - APIHelper.append_url_with_template_parameters( - ENVIRONMENTS[environment][server], parameters - ) - end - end -end diff --git a/lib/bandwidth/exceptions/api_exception.rb b/lib/bandwidth/exceptions/api_exception.rb deleted file mode 100644 index 47c08f34..00000000 --- a/lib/bandwidth/exceptions/api_exception.rb +++ /dev/null @@ -1,20 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Class for exceptions when there is a network error, status code error, etc. - class APIException < StandardError - attr_reader :response, :response_code - - # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. - def initialize(reason, response) - super(reason) - @response = response - @response_code = response.status_code - end - end -end diff --git a/lib/bandwidth/http/api_response.rb b/lib/bandwidth/http/api_response.rb deleted file mode 100644 index caf58c5e..00000000 --- a/lib/bandwidth/http/api_response.rb +++ /dev/null @@ -1,38 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Http response received. - class ApiResponse - attr_reader(:status_code, :reason_phrase, :headers, :raw_body, :request, - :data, :errors) - - # The constructor - # @param [HttpResponse] The original, raw response from the api. - # @param [Object] The data field specified for the response. - # @param [Array] Any errors returned by the server. - def initialize(http_response, - data: nil, - errors: nil) - @status_code = http_response.status_code - @reason_phrase = http_response.reason_phrase - @headers = http_response.headers - @raw_body = http_response.raw_body - @request = http_response.request - @data = data - @errors = errors - end - - # returns true if status_code is between 200-300 - def success? - status_code >= 200 && status_code < 300 - end - - # returns true if status_code is between 400-600 - def error? - status_code >= 400 && status_code < 600 - end - end -end diff --git a/lib/bandwidth/http/auth/messaging_basic_auth.rb b/lib/bandwidth/http/auth/messaging_basic_auth.rb deleted file mode 100644 index b5da20c1..00000000 --- a/lib/bandwidth/http/auth/messaging_basic_auth.rb +++ /dev/null @@ -1,22 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'base64' - -module Bandwidth - # Utility class for basic authorization. - class MessagingBasicAuth - # Add basic authentication to the request. - # @param [HttpRequest] The HttpRequest object to which authentication will - # be added. - def self.apply(config, http_request) - username = config.messaging_basic_auth_user_name - password = config.messaging_basic_auth_password - value = Base64.strict_encode64("#{username}:#{password}") - header_value = "Basic #{value}" - http_request.headers['Authorization'] = header_value - end - end -end diff --git a/lib/bandwidth/http/auth/multi_factor_auth_basic_auth.rb b/lib/bandwidth/http/auth/multi_factor_auth_basic_auth.rb deleted file mode 100644 index 0498e099..00000000 --- a/lib/bandwidth/http/auth/multi_factor_auth_basic_auth.rb +++ /dev/null @@ -1,22 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'base64' - -module Bandwidth - # Utility class for basic authorization. - class MultiFactorAuthBasicAuth - # Add basic authentication to the request. - # @param [HttpRequest] The HttpRequest object to which authentication will - # be added. - def self.apply(config, http_request) - username = config.multi_factor_auth_basic_auth_user_name - password = config.multi_factor_auth_basic_auth_password - value = Base64.strict_encode64("#{username}:#{password}") - header_value = "Basic #{value}" - http_request.headers['Authorization'] = header_value - end - end -end diff --git a/lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb b/lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb deleted file mode 100644 index a06d14e8..00000000 --- a/lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb +++ /dev/null @@ -1,22 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'base64' - -module Bandwidth - # Utility class for basic authorization. - class PhoneNumberLookupBasicAuth - # Add basic authentication to the request. - # @param [HttpRequest] The HttpRequest object to which authentication will - # be added. - def self.apply(config, http_request) - username = config.phone_number_lookup_basic_auth_user_name - password = config.phone_number_lookup_basic_auth_password - value = Base64.strict_encode64("#{username}:#{password}") - header_value = "Basic #{value}" - http_request.headers['Authorization'] = header_value - end - end -end diff --git a/lib/bandwidth/http/auth/voice_basic_auth.rb b/lib/bandwidth/http/auth/voice_basic_auth.rb deleted file mode 100644 index e1cd3caa..00000000 --- a/lib/bandwidth/http/auth/voice_basic_auth.rb +++ /dev/null @@ -1,22 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'base64' - -module Bandwidth - # Utility class for basic authorization. - class VoiceBasicAuth - # Add basic authentication to the request. - # @param [HttpRequest] The HttpRequest object to which authentication will - # be added. - def self.apply(config, http_request) - username = config.voice_basic_auth_user_name - password = config.voice_basic_auth_password - value = Base64.strict_encode64("#{username}:#{password}") - header_value = "Basic #{value}" - http_request.headers['Authorization'] = header_value - end - end -end diff --git a/lib/bandwidth/http/auth/web_rtc_basic_auth.rb b/lib/bandwidth/http/auth/web_rtc_basic_auth.rb deleted file mode 100644 index b90dbe62..00000000 --- a/lib/bandwidth/http/auth/web_rtc_basic_auth.rb +++ /dev/null @@ -1,22 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'base64' - -module Bandwidth - # Utility class for basic authorization. - class WebRtcBasicAuth - # Add basic authentication to the request. - # @param [HttpRequest] The HttpRequest object to which authentication will - # be added. - def self.apply(config, http_request) - username = config.web_rtc_basic_auth_user_name - password = config.web_rtc_basic_auth_password - value = Base64.strict_encode64("#{username}:#{password}") - header_value = "Basic #{value}" - http_request.headers['Authorization'] = header_value - end - end -end diff --git a/lib/bandwidth/http/faraday_client.rb b/lib/bandwidth/http/faraday_client.rb deleted file mode 100644 index d77a458d..00000000 --- a/lib/bandwidth/http/faraday_client.rb +++ /dev/null @@ -1,73 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'faraday/follow_redirects' -require 'faraday/gzip' -require 'faraday/http_cache' -require 'faraday/multipart' -require 'faraday/retry' - -module Bandwidth - # An implementation of HttpClient. - class FaradayClient < HttpClient - # The constructor. - def initialize(timeout:, max_retries:, retry_interval:, - backoff_factor:, retry_statuses:, retry_methods:, - cache: false, verify: true) - @connection = Faraday.new do |faraday| - faraday.use Faraday::HttpCache, serializer: Marshal if cache - faraday.use Faraday::FollowRedirects::Middleware - faraday.request :gzip - faraday.request :multipart - faraday.request :url_encoded - faraday.ssl[:ca_file] = Certifi.where - faraday.ssl[:verify] = verify - faraday.request :retry, max: max_retries, interval: retry_interval, - backoff_factor: backoff_factor, - retry_statuses: retry_statuses, - methods: retry_methods - faraday.adapter Faraday.default_adapter - faraday.options[:params_encoder] = Faraday::FlatParamsEncoder - faraday.options[:timeout] = timeout if timeout.positive? - end - end - - # Method overridden from HttpClient. - def execute_as_string(http_request) - response = @connection.send( - http_request.http_method.downcase, - http_request.query_url - ) do |request| - request.headers = http_request.headers - unless http_request.http_method == HttpMethodEnum::GET && - http_request.parameters.empty? - request.body = http_request.parameters - end - end - convert_response(response, http_request) - end - - # Method overridden from HttpClient. - def execute_as_binary(http_request) - response = @connection.send( - http_request.http_method.downcase, - http_request.query_url - ) do |request| - request.headers = http_request.headers - unless http_request.http_method == HttpMethodEnum::GET && - http_request.parameters.empty? - request.body = http_request.parameters - end - end - convert_response(response, http_request) - end - - # Method overridden from HttpClient. - def convert_response(response, http_request) - HttpResponse.new(response.status, response.reason_phrase, - response.headers, response.body, http_request) - end - end -end diff --git a/lib/bandwidth/http/http_call_back.rb b/lib/bandwidth/http/http_call_back.rb deleted file mode 100644 index 0777c697..00000000 --- a/lib/bandwidth/http/http_call_back.rb +++ /dev/null @@ -1,24 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # HttpCallBack allows defining callables for pre and post API calls. - class HttpCallBack - # A controller will call this method before making an HTTP Request. - # @param [HttpRequest] The HttpRequest object which the HttpClient - # will execute. - def on_before_request(_http_request) - raise NotImplementedError, 'This method needs - to be implemented in a child class.' - end - - # A controller will call this method after making an HTTP Request. - # @param [HttpResponse] The HttpReponse of the API call. - def on_after_response(_http_response) - raise NotImplementedError, 'This method needs - to be implemented in a child class.' - end - end -end diff --git a/lib/bandwidth/http/http_client.rb b/lib/bandwidth/http/http_client.rb deleted file mode 100644 index 0a6cef35..00000000 --- a/lib/bandwidth/http/http_client.rb +++ /dev/null @@ -1,104 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # An interface for the methods that an HTTP Client must implement. - # - # This class should not be instantiated but should be used as a base class - # for HTTP Client classes. - class HttpClient - # Execute an HttpRequest when the response is expected to be a string. - # @param [HttpRequest] The HttpRequest to be executed. - def execute_as_string(_http_request) - raise NotImplementedError, 'This method needs - to be implemented in a child class.' - end - - # Execute an HttpRequest when the response is expected to be binary. - # @param [HttpRequest] The HttpRequest to be executed. - def execute_as_binary(_http_request) - raise NotImplementedError, 'This method needs - to be implemented in a child class.' - end - - # Converts the HTTP Response from the client to an HttpResponse object. - # @param [Dynamic] The response object received from the client. - def convert_response(_response) - raise NotImplementedError, 'This method needs - to be implemented in a child class.' - end - - # Get a GET HttpRequest object. - # @param [String] The URL to send the request to. - # @param [Hash, Optional] The headers for the HTTP Request. - def get(query_url, - headers: {}) - HttpRequest.new(HttpMethodEnum::GET, - query_url, - headers: headers) - end - - # Get a HEAD HttpRequest object. - # @param [String] The URL to send the request to. - # @param [Hash, Optional] The headers for the HTTP Request. - def head(query_url, - headers: {}) - HttpRequest.new(HttpMethodEnum::HEAD, - query_url, - headers: headers) - end - - # Get a POST HttpRequest object. - # @param [String] The URL to send the request to. - # @param [Hash, Optional] The headers for the HTTP Request. - # @param [Hash, Optional] The parameters for the HTTP Request. - def post(query_url, - headers: {}, - parameters: {}) - HttpRequest.new(HttpMethodEnum::POST, - query_url, - headers: headers, - parameters: parameters) - end - - # Get a PUT HttpRequest object. - # @param [String] The URL to send the request to. - # @param [Hash, Optional] The headers for the HTTP Request. - # @param [Hash, Optional] The parameters for the HTTP Request. - def put(query_url, - headers: {}, - parameters: {}) - HttpRequest.new(HttpMethodEnum::PUT, - query_url, - headers: headers, - parameters: parameters) - end - - # Get a PATCH HttpRequest object. - # @param [String] The URL to send the request to. - # @param [Hash, Optional] The headers for the HTTP Request. - # @param [Hash, Optional] The parameters for the HTTP Request. - def patch(query_url, - headers: {}, - parameters: {}) - HttpRequest.new(HttpMethodEnum::PATCH, - query_url, - headers: headers, - parameters: parameters) - end - - # Get a DELETE HttpRequest object. - # @param [String] The URL to send the request to. - # @param [Hash, Optional] The headers for the HTTP Request. - def delete(query_url, - headers: {}, - parameters: {}) - HttpRequest.new(HttpMethodEnum::DELETE, - query_url, - headers: headers, - parameters: parameters) - end - end -end diff --git a/lib/bandwidth/http/http_method_enum.rb b/lib/bandwidth/http/http_method_enum.rb deleted file mode 100644 index 2cf88c57..00000000 --- a/lib/bandwidth/http/http_method_enum.rb +++ /dev/null @@ -1,13 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # HTTP Methods Enumeration. - class HttpMethodEnum - HTTPMETHODENUM = [GET = 'GET'.freeze, POST = 'POST'.freeze, - PUT = 'PUT'.freeze, PATCH = 'PATCH'.freeze, - DELETE = 'DELETE'.freeze, HEAD = 'HEAD'.freeze].freeze - end -end diff --git a/lib/bandwidth/http/http_request.rb b/lib/bandwidth/http/http_request.rb deleted file mode 100644 index 89e73c67..00000000 --- a/lib/bandwidth/http/http_request.rb +++ /dev/null @@ -1,50 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Represents a single Http Request. - class HttpRequest - attr_accessor :http_method, :query_url, :headers, - :parameters, :username, :password - - # The constructor. - # @param [HttpMethodEnum] The HTTP method. - # @param [String] The URL to send the request to. - # @param [Hash, Optional] The headers for the HTTP Request. - # @param [Hash, Optional] The parameters for the HTTP Request. - def initialize(http_method, - query_url, - headers: {}, - parameters: {}) - @http_method = http_method - @query_url = query_url - @headers = headers - @parameters = parameters - end - - # Add a header to the HttpRequest. - # @param [String] The name of the header. - # @param [String] The value of the header. - def add_header(name, value) - @headers[name] = value - end - - # Add a parameter to the HttpRequest. - # @param [String] The name of the parameter. - # @param [String] The value of the parameter. - def add_parameter(name, value) - @parameters[name] = value - end - - # Add a query parameter to the HttpRequest. - # @param [String] The name of the query parameter. - # @param [String] The value of the query parameter. - def add_query_parameter(name, value) - @query_url = APIHelper.append_url_with_query_parameters(@query_url, - name => value) - @query_url = APIHelper.clean_url(@query_url) - end - end -end diff --git a/lib/bandwidth/http/http_response.rb b/lib/bandwidth/http/http_response.rb deleted file mode 100644 index 5362a3f3..00000000 --- a/lib/bandwidth/http/http_response.rb +++ /dev/null @@ -1,29 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Http response received. - class HttpResponse - attr_reader :status_code, :reason_phrase, :headers, :raw_body, :request - - # The constructor - # @param [Integer] The status code returned by the server. - # @param [String] The reason phrase returned by the server. - # @param [Hash] The headers sent by the server in the response. - # @param [String] The raw body of the response. - # @param [HttpRequest] The request that resulted in this response. - def initialize(status_code, - reason_phrase, - headers, - raw_body, - request) - @status_code = status_code - @reason_phrase = reason_phrase - @headers = headers - @raw_body = raw_body - @request = request - end - end -end diff --git a/lib/bandwidth/messaging_lib/messaging.rb b/lib/bandwidth/messaging_lib/messaging.rb deleted file mode 100644 index bc62ef83..00000000 --- a/lib/bandwidth/messaging_lib/messaging.rb +++ /dev/null @@ -1,25 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - - -require_relative 'messaging/client.rb' - -# Models -require_relative 'messaging/models/bandwidth_messages_list.rb' -require_relative 'messaging/models/bandwidth_message_item.rb' -require_relative 'messaging/models/page_info.rb' -require_relative 'messaging/models/media.rb' -require_relative 'messaging/models/tag.rb' -require_relative 'messaging/models/deferred_result.rb' -require_relative 'messaging/models/bandwidth_callback_message.rb' -require_relative 'messaging/models/bandwidth_message.rb' -require_relative 'messaging/models/message_request.rb' -require_relative 'messaging/models/priority_enum.rb' - -# Exceptions -require_relative 'messaging/exceptions/messaging_exception.rb' -# Controllers -require_relative 'messaging/controllers/base_controller.rb' -require_relative 'messaging/controllers/api_controller.rb' diff --git a/lib/bandwidth/messaging_lib/messaging/client.rb b/lib/bandwidth/messaging_lib/messaging/client.rb deleted file mode 100644 index bb34f7d8..00000000 --- a/lib/bandwidth/messaging_lib/messaging/client.rb +++ /dev/null @@ -1,60 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - module Messaging - # bandwidth client class. - class Client - attr_reader :config - - # Access to client controller. - # @return [APIController] Returns the controller instance. - def client - @client ||= APIController.new config - end - - def initialize(timeout: 60, max_retries: 0, retry_interval: 1, - backoff_factor: 2, - retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524], - retry_methods: %i[get put get put], - environment: Environment::PRODUCTION, - base_url: 'https://www.example.com', - messaging_basic_auth_user_name: 'TODO: Replace', - messaging_basic_auth_password: 'TODO: Replace', - multi_factor_auth_basic_auth_user_name: 'TODO: Replace', - multi_factor_auth_basic_auth_password: 'TODO: Replace', - phone_number_lookup_basic_auth_user_name: 'TODO: Replace', - phone_number_lookup_basic_auth_password: 'TODO: Replace', - voice_basic_auth_user_name: 'TODO: Replace', - voice_basic_auth_password: 'TODO: Replace', - web_rtc_basic_auth_user_name: 'TODO: Replace', - web_rtc_basic_auth_password: 'TODO: Replace', - config: nil) - @config = if config.nil? - Configuration.new(timeout: timeout, - max_retries: max_retries, - retry_interval: retry_interval, - backoff_factor: backoff_factor, - retry_statuses: retry_statuses, - retry_methods: retry_methods, - environment: environment, - base_url: base_url, - messaging_basic_auth_user_name: messaging_basic_auth_user_name, - messaging_basic_auth_password: messaging_basic_auth_password, - multi_factor_auth_basic_auth_user_name: multi_factor_auth_basic_auth_user_name, - multi_factor_auth_basic_auth_password: multi_factor_auth_basic_auth_password, - phone_number_lookup_basic_auth_user_name: phone_number_lookup_basic_auth_user_name, - phone_number_lookup_basic_auth_password: phone_number_lookup_basic_auth_password, - voice_basic_auth_user_name: voice_basic_auth_user_name, - voice_basic_auth_password: voice_basic_auth_password, - web_rtc_basic_auth_user_name: web_rtc_basic_auth_user_name, - web_rtc_basic_auth_password: web_rtc_basic_auth_password) - else - config - end - end - end -end -end diff --git a/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb b/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb deleted file mode 100644 index f6ca0261..00000000 --- a/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +++ /dev/null @@ -1,491 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth -module Messaging - # APIController - class APIController < BaseController - def initialize(config, http_call_back: nil) - super(config, http_call_back: http_call_back) - end - - # Gets a list of your media files. No query parameters are supported. - # @param [String] account_id Required parameter: User's account ID - # @param [String] continuation_token Optional parameter: Continuation token - # used to retrieve subsequent media. - # @return [List of Media] response from the API call - def list_media(account_id, - continuation_token: nil) - # Prepare query url. - _query_builder = config.get_base_uri(Server::MESSAGINGDEFAULT) - _query_builder << '/users/{accountId}/media' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json', - 'Continuation-Token' => continuation_token - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - MessagingBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise MessagingException.new( - '400 Request is malformed or invalid', - _response - ) - when 401 - raise MessagingException.new( - '401 The specified user does not have access to the account', - _response - ) - when 403 - raise MessagingException.new( - '403 The user does not have access to this API', - _response - ) - when 404 - raise MessagingException.new( - '404 Path not found', - _response - ) - when 415 - raise MessagingException.new( - '415 The content-type of the request is incorrect', - _response - ) - when 429 - raise MessagingException.new( - '429 The rate limit has been reached', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, - data: decoded.map { |element| Media.from_hash(element) } - ) - end - - # Downloads a media file you previously uploaded. - # @param [String] account_id Required parameter: User's account ID - # @param [String] media_id Required parameter: Media ID to retrieve - # @return [Binary] response from the API call - def get_media(account_id, - media_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::MESSAGINGDEFAULT) - _query_builder << '/users/{accountId}/media/{mediaId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'mediaId' => { 'value' => media_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url - ) - MessagingBasicAuth.apply(config, _request) - _response = execute_request(_request, binary: true) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise MessagingException.new( - '400 Request is malformed or invalid', - _response - ) - when 401 - raise MessagingException.new( - '401 The specified user does not have access to the account', - _response - ) - when 403 - raise MessagingException.new( - '403 The user does not have access to this API', - _response - ) - when 404 - raise MessagingException.new( - '404 Path not found', - _response - ) - when 415 - raise MessagingException.new( - '415 The content-type of the request is incorrect', - _response - ) - when 429 - raise MessagingException.new( - '429 The rate limit has been reached', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new( - _response, data: _response.raw_body - ) - end - - # Uploads a file the normal HTTP way. You may add headers to the request in - # order to provide some control to your media-file. - # @param [String] account_id Required parameter: User's account ID - # @param [String] media_id Required parameter: The user supplied custom - # media ID - # @param [File | UploadIO] body Required parameter: Example: - # @param [String] content_type Optional parameter: The media type of the - # entity-body - # @param [String] cache_control Optional parameter: General-header field is - # used to specify directives that MUST be obeyed by all caching mechanisms - # along the request/response chain. - # @return [void] response from the API call - def upload_media(account_id, - media_id, - body, - content_type: 'application/octet-stream', - cache_control: nil) - # Prepare query url. - _query_builder = config.get_base_uri(Server::MESSAGINGDEFAULT) - _query_builder << '/users/{accountId}/media/{mediaId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'mediaId' => { 'value' => media_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - if body.is_a? FileWrapper - body_wrapper = body.file - body_content_type = body.content_type - else - body_wrapper = body - body_content_type = content_type - end - - # Prepare headers. - _headers = { - 'content-type' => body_content_type, - 'content-length' => body_wrapper.size.to_s, - 'Cache-Control' => cache_control - } - - # Prepare and execute HttpRequest. - _request = config.http_client.put( - _query_url, - headers: _headers, - parameters: body_wrapper - ) - MessagingBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise MessagingException.new( - '400 Request is malformed or invalid', - _response - ) - when 401 - raise MessagingException.new( - '401 The specified user does not have access to the account', - _response - ) - when 403 - raise MessagingException.new( - '403 The user does not have access to this API', - _response - ) - when 404 - raise MessagingException.new( - '404 Path not found', - _response - ) - when 415 - raise MessagingException.new( - '415 The content-type of the request is incorrect', - _response - ) - when 429 - raise MessagingException.new( - '429 The rate limit has been reached', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Deletes a media file from Bandwidth API server. Make sure you don't have - # any application scripts still using the media before you delete. If you - # accidentally delete a media file, you can immediately upload a new file - # with the same name. - # @param [String] account_id Required parameter: User's account ID - # @param [String] media_id Required parameter: The media ID to delete - # @return [void] response from the API call - def delete_media(account_id, - media_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::MESSAGINGDEFAULT) - _query_builder << '/users/{accountId}/media/{mediaId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'mediaId' => { 'value' => media_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare and execute HttpRequest. - _request = config.http_client.delete( - _query_url - ) - MessagingBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise MessagingException.new( - '400 Request is malformed or invalid', - _response - ) - when 401 - raise MessagingException.new( - '401 The specified user does not have access to the account', - _response - ) - when 403 - raise MessagingException.new( - '403 The user does not have access to this API', - _response - ) - when 404 - raise MessagingException.new( - '404 Path not found', - _response - ) - when 415 - raise MessagingException.new( - '415 The content-type of the request is incorrect', - _response - ) - when 429 - raise MessagingException.new( - '429 The rate limit has been reached', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Gets a list of messages based on query parameters. - # @param [String] account_id Required parameter: User's account ID - # @param [String] message_id Optional parameter: The ID of the message to - # search for. Special characters need to be encoded using URL encoding - # @param [String] source_tn Optional parameter: The phone number that sent - # the message - # @param [String] destination_tn Optional parameter: The phone number that - # received the message - # @param [String] message_status Optional parameter: The status of the - # message. One of RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, - # ACCEPTED, UNDELIVERED - # @param [Integer] error_code Optional parameter: The error code of the - # message - # @param [String] from_date_time Optional parameter: The start of the date - # range to search in ISO 8601 format. Uses the message receive time. The - # date range to search in is currently 14 days. - # @param [String] to_date_time Optional parameter: The end of the date range - # to search in ISO 8601 format. Uses the message receive time. The date - # range to search in is currently 14 days. - # @param [String] page_token Optional parameter: A base64 encoded value used - # for pagination of results - # @param [Integer] limit Optional parameter: The maximum records requested - # in search result. Default 100. The sum of limit and after cannot be more - # than 10000 - # @return [BandwidthMessagesList] response from the API call - def get_messages(account_id, - message_id: nil, - source_tn: nil, - destination_tn: nil, - message_status: nil, - error_code: nil, - from_date_time: nil, - to_date_time: nil, - page_token: nil, - limit: nil) - # Prepare query url. - _query_builder = config.get_base_uri(Server::MESSAGINGDEFAULT) - _query_builder << '/users/{accountId}/messages' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_builder = APIHelper.append_url_with_query_parameters( - _query_builder, - 'messageId' => message_id, - 'sourceTn' => source_tn, - 'destinationTn' => destination_tn, - 'messageStatus' => message_status, - 'errorCode' => error_code, - 'fromDateTime' => from_date_time, - 'toDateTime' => to_date_time, - 'pageToken' => page_token, - 'limit' => limit - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - MessagingBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise MessagingException.new( - '400 Request is malformed or invalid', - _response - ) - when 401 - raise MessagingException.new( - '401 The specified user does not have access to the account', - _response - ) - when 403 - raise MessagingException.new( - '403 The user does not have access to this API', - _response - ) - when 404 - raise MessagingException.new( - '404 Path not found', - _response - ) - when 415 - raise MessagingException.new( - '415 The content-type of the request is incorrect', - _response - ) - when 429 - raise MessagingException.new( - '429 The rate limit has been reached', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: BandwidthMessagesList.from_hash(decoded) - ) - end - - # Endpoint for sending text messages and picture messages using V2 - # messaging. - # @param [String] account_id Required parameter: User's account ID - # @param [MessageRequest] body Required parameter: Example: - # @return [BandwidthMessage] response from the API call - def create_message(account_id, - body) - # Prepare query url. - _query_builder = config.get_base_uri(Server::MESSAGINGDEFAULT) - _query_builder << '/users/{accountId}/messages' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.post( - _query_url, - headers: _headers, - parameters: body.to_json - ) - MessagingBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise MessagingException.new( - '400 Request is malformed or invalid', - _response - ) - when 401 - raise MessagingException.new( - '401 The specified user does not have access to the account', - _response - ) - when 403 - raise MessagingException.new( - '403 The user does not have access to this API', - _response - ) - when 404 - raise MessagingException.new( - '404 Path not found', - _response - ) - when 415 - raise MessagingException.new( - '415 The content-type of the request is incorrect', - _response - ) - when 429 - raise MessagingException.new( - '429 The rate limit has been reached', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: BandwidthMessage.from_hash(decoded) - ) - end - end -end -end diff --git a/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb b/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb deleted file mode 100644 index 17e3cbc6..00000000 --- a/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +++ /dev/null @@ -1,47 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # BaseController. - class BaseController - attr_accessor :config, :http_call_back - - def initialize(config, http_call_back: nil) - @config = config - @http_call_back = http_call_back - - @global_headers = { - 'user-agent' => 'ruby-sdk' - } - end - - def validate_parameters(args) - args.each do |_name, value| - raise ArgumentError, "Required parameter #{_name} cannot be nil." if value.nil? - end - end - - def execute_request(request, binary: false) - @http_call_back&.on_before_request(request) - - APIHelper.clean_hash(request.headers) - request.headers.merge!(@global_headers) - - response = if binary - config.http_client.execute_as_binary(request) - else - config.http_client.execute_as_string(request) - end - @http_call_back&.on_after_response(response) - - response - end - - def validate_response(response) - raise APIException.new 'HTTP Response Not OK', response unless - response.status_code.between?(200, 208) # [200,208] = HTTP OK - end - end -end diff --git a/lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb b/lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb deleted file mode 100644 index 1fe3997e..00000000 --- a/lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb +++ /dev/null @@ -1,37 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # MessagingException class. - class MessagingException < APIException - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :type - - # TODO: Write general description for this method - # @return [String] - attr_accessor :description - - # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. - def initialize(reason, response) - super(reason, response) - hash = APIHelper.json_deserialize(@response.raw_body) - unbox(hash) - end - - # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the - # response body. - def unbox(hash) - @type = hash.key?('type') ? hash['type'] : SKIP - @description = hash.key?('description') ? hash['description'] : SKIP - end - end -end diff --git a/lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb b/lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb deleted file mode 100644 index f2aee105..00000000 --- a/lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb +++ /dev/null @@ -1,100 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # BandwidthCallbackMessage Model. - class BandwidthCallbackMessage < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :time - - # TODO: Write general description for this method - # @return [String] - attr_accessor :type - - # TODO: Write general description for this method - # @return [String] - attr_accessor :to - - # TODO: Write general description for this method - # @return [String] - attr_accessor :error_code - - # TODO: Write general description for this method - # @return [String] - attr_accessor :description - - # TODO: Write general description for this method - # @return [BandwidthMessage] - attr_accessor :message - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['time'] = 'time' - @_hash['type'] = 'type' - @_hash['to'] = 'to' - @_hash['error_code'] = 'errorCode' - @_hash['description'] = 'description' - @_hash['message'] = 'message' - @_hash - end - - # An array for optional fields - def optionals - %w[ - time - type - to - error_code - description - message - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(time = nil, - type = nil, - to = nil, - error_code = nil, - description = nil, - message = nil) - @time = time unless time == SKIP - @type = type unless type == SKIP - @to = to unless to == SKIP - @error_code = error_code unless error_code == SKIP - @description = description unless description == SKIP - @message = message unless message == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - time = hash.key?('time') ? hash['time'] : SKIP - type = hash.key?('type') ? hash['type'] : SKIP - to = hash.key?('to') ? hash['to'] : SKIP - error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP - description = hash.key?('description') ? hash['description'] : SKIP - message = BandwidthMessage.from_hash(hash['message']) if hash['message'] - - # Create object from extracted values. - BandwidthCallbackMessage.new(time, - type, - to, - error_code, - description, - message) - end - end -end diff --git a/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb b/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb deleted file mode 100644 index f65ca599..00000000 --- a/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb +++ /dev/null @@ -1,164 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # BandwidthMessage Model. - class BandwidthMessage < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The id of the message - # @return [String] - attr_accessor :id - - # The Bandwidth phone number associated with the message - # @return [String] - attr_accessor :owner - - # The application ID associated with the message - # @return [String] - attr_accessor :application_id - - # The datetime stamp of the message in ISO 8601 - # @return [String] - attr_accessor :time - - # The number of segments the original message from the user is broken into - # before sending over to carrier networks - # @return [Integer] - attr_accessor :segment_count - - # The direction of the message relative to Bandwidth. Can be in or out - # @return [String] - attr_accessor :direction - - # The phone number recipients of the message - # @return [List of String] - attr_accessor :to - - # The phone number the message was sent from - # @return [String] - attr_accessor :from - - # The list of media URLs sent in the message. Including a `filename` field - # in the `Content-Disposition` header of the media linked with a URL will - # set the displayed file name. This is a best practice to ensure that your - # media has a readable file name. - # @return [List of String] - attr_accessor :media - - # The contents of the message - # @return [String] - attr_accessor :text - - # The custom string set by the user - # @return [String] - attr_accessor :tag - - # The priority specified by the user - # @return [String] - attr_accessor :priority - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['id'] = 'id' - @_hash['owner'] = 'owner' - @_hash['application_id'] = 'applicationId' - @_hash['time'] = 'time' - @_hash['segment_count'] = 'segmentCount' - @_hash['direction'] = 'direction' - @_hash['to'] = 'to' - @_hash['from'] = 'from' - @_hash['media'] = 'media' - @_hash['text'] = 'text' - @_hash['tag'] = 'tag' - @_hash['priority'] = 'priority' - @_hash - end - - # An array for optional fields - def optionals - %w[ - id - owner - application_id - time - segment_count - direction - to - from - media - text - tag - priority - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(id = nil, - owner = nil, - application_id = nil, - time = nil, - segment_count = nil, - direction = nil, - to = nil, - from = nil, - media = nil, - text = nil, - tag = nil, - priority = nil) - @id = id unless id == SKIP - @owner = owner unless owner == SKIP - @application_id = application_id unless application_id == SKIP - @time = time unless time == SKIP - @segment_count = segment_count unless segment_count == SKIP - @direction = direction unless direction == SKIP - @to = to unless to == SKIP - @from = from unless from == SKIP - @media = media unless media == SKIP - @text = text unless text == SKIP - @tag = tag unless tag == SKIP - @priority = priority unless priority == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - id = hash.key?('id') ? hash['id'] : SKIP - owner = hash.key?('owner') ? hash['owner'] : SKIP - application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP - time = hash.key?('time') ? hash['time'] : SKIP - segment_count = hash.key?('segmentCount') ? hash['segmentCount'] : SKIP - direction = hash.key?('direction') ? hash['direction'] : SKIP - to = hash.key?('to') ? hash['to'] : SKIP - from = hash.key?('from') ? hash['from'] : SKIP - media = hash.key?('media') ? hash['media'] : SKIP - text = hash.key?('text') ? hash['text'] : SKIP - tag = hash.key?('tag') ? hash['tag'] : SKIP - priority = hash.key?('priority') ? hash['priority'] : SKIP - - # Create object from extracted values. - BandwidthMessage.new(id, - owner, - application_id, - time, - segment_count, - direction, - to, - from, - media, - text, - tag, - priority) - end - end -end diff --git a/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb b/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb deleted file mode 100644 index 68bd7f4f..00000000 --- a/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb +++ /dev/null @@ -1,203 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # BandwidthMessageItem Model. - class BandwidthMessageItem < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The message id - # @return [String] - attr_accessor :message_id - - # The account id of the message - # @return [String] - attr_accessor :account_id - - # The source phone number of the message - # @return [String] - attr_accessor :source_tn - - # The recipient phone number of the message - # @return [String] - attr_accessor :destination_tn - - # The status of the message - # @return [String] - attr_accessor :message_status - - # The direction of the message relative to Bandwidth. INBOUND or OUTBOUND - # @return [String] - attr_accessor :message_direction - - # The type of message. sms or mms - # @return [String] - attr_accessor :message_type - - # The number of segments the message was sent as - # @return [Integer] - attr_accessor :segment_count - - # The numeric error code of the message - # @return [Integer] - attr_accessor :error_code - - # The ISO 8601 datetime of the message - # @return [String] - attr_accessor :receive_time - - # The name of the carrier. Not currently supported for MMS, coming soon - # @return [String] - attr_accessor :carrier_name - - # The size of the message including message content and headers - # @return [Integer] - attr_accessor :message_size - - # The length of the message content - # @return [Integer] - attr_accessor :message_length - - # The number of attachments the message has - # @return [Integer] - attr_accessor :attachment_count - - # The number of recipients the message has - # @return [Integer] - attr_accessor :recipient_count - - # The campaign class of the message, if it has one - # @return [String] - attr_accessor :campaign_class - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['message_id'] = 'messageId' - @_hash['account_id'] = 'accountId' - @_hash['source_tn'] = 'sourceTn' - @_hash['destination_tn'] = 'destinationTn' - @_hash['message_status'] = 'messageStatus' - @_hash['message_direction'] = 'messageDirection' - @_hash['message_type'] = 'messageType' - @_hash['segment_count'] = 'segmentCount' - @_hash['error_code'] = 'errorCode' - @_hash['receive_time'] = 'receiveTime' - @_hash['carrier_name'] = 'carrierName' - @_hash['message_size'] = 'messageSize' - @_hash['message_length'] = 'messageLength' - @_hash['attachment_count'] = 'attachmentCount' - @_hash['recipient_count'] = 'recipientCount' - @_hash['campaign_class'] = 'campaignClass' - @_hash - end - - # An array for optional fields - def optionals - %w[ - message_id - account_id - source_tn - destination_tn - message_status - message_direction - message_type - segment_count - error_code - receive_time - carrier_name - message_size - message_length - attachment_count - recipient_count - campaign_class - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(message_id = nil, - account_id = nil, - source_tn = nil, - destination_tn = nil, - message_status = nil, - message_direction = nil, - message_type = nil, - segment_count = nil, - error_code = nil, - receive_time = nil, - carrier_name = nil, - message_size = nil, - message_length = nil, - attachment_count = nil, - recipient_count = nil, - campaign_class = nil) - @message_id = message_id unless message_id == SKIP - @account_id = account_id unless account_id == SKIP - @source_tn = source_tn unless source_tn == SKIP - @destination_tn = destination_tn unless destination_tn == SKIP - @message_status = message_status unless message_status == SKIP - @message_direction = message_direction unless message_direction == SKIP - @message_type = message_type unless message_type == SKIP - @segment_count = segment_count unless segment_count == SKIP - @error_code = error_code unless error_code == SKIP - @receive_time = receive_time unless receive_time == SKIP - @carrier_name = carrier_name unless carrier_name == SKIP - @message_size = message_size unless message_size == SKIP - @message_length = message_length unless message_length == SKIP - @attachment_count = attachment_count unless attachment_count == SKIP - @recipient_count = recipient_count unless recipient_count == SKIP - @campaign_class = campaign_class unless campaign_class == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - message_id = hash.key?('messageId') ? hash['messageId'] : SKIP - account_id = hash.key?('accountId') ? hash['accountId'] : SKIP - source_tn = hash.key?('sourceTn') ? hash['sourceTn'] : SKIP - destination_tn = hash.key?('destinationTn') ? hash['destinationTn'] : SKIP - message_status = hash.key?('messageStatus') ? hash['messageStatus'] : SKIP - message_direction = - hash.key?('messageDirection') ? hash['messageDirection'] : SKIP - message_type = hash.key?('messageType') ? hash['messageType'] : SKIP - segment_count = hash.key?('segmentCount') ? hash['segmentCount'] : SKIP - error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP - receive_time = hash.key?('receiveTime') ? hash['receiveTime'] : SKIP - carrier_name = hash.key?('carrierName') ? hash['carrierName'] : SKIP - message_size = hash.key?('messageSize') ? hash['messageSize'] : SKIP - message_length = hash.key?('messageLength') ? hash['messageLength'] : SKIP - attachment_count = - hash.key?('attachmentCount') ? hash['attachmentCount'] : SKIP - recipient_count = - hash.key?('recipientCount') ? hash['recipientCount'] : SKIP - campaign_class = hash.key?('campaignClass') ? hash['campaignClass'] : SKIP - - # Create object from extracted values. - BandwidthMessageItem.new(message_id, - account_id, - source_tn, - destination_tn, - message_status, - message_direction, - message_type, - segment_count, - error_code, - receive_time, - carrier_name, - message_size, - message_length, - attachment_count, - recipient_count, - campaign_class) - end - end -end diff --git a/lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb b/lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb deleted file mode 100644 index a03052db..00000000 --- a/lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb +++ /dev/null @@ -1,79 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # BandwidthMessagesList Model. - class BandwidthMessagesList < BaseModel - SKIP = Object.new - private_constant :SKIP - - # Total number of messages matched by the search - # @return [Integer] - attr_accessor :total_count - - # Total number of messages matched by the search - # @return [PageInfo] - attr_accessor :page_info - - # Total number of messages matched by the search - # @return [List of BandwidthMessageItem] - attr_accessor :messages - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['total_count'] = 'totalCount' - @_hash['page_info'] = 'pageInfo' - @_hash['messages'] = 'messages' - @_hash - end - - # An array for optional fields - def optionals - %w[ - total_count - page_info - messages - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(total_count = nil, - page_info = nil, - messages = nil) - @total_count = total_count unless total_count == SKIP - @page_info = page_info unless page_info == SKIP - @messages = messages unless messages == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - total_count = hash.key?('totalCount') ? hash['totalCount'] : SKIP - page_info = PageInfo.from_hash(hash['pageInfo']) if hash['pageInfo'] - # Parameter is an array, so we need to iterate through it - messages = nil - unless hash['messages'].nil? - messages = [] - hash['messages'].each do |structure| - messages << (BandwidthMessageItem.from_hash(structure) if structure) - end - end - - messages = SKIP unless hash.key?('messages') - - # Create object from extracted values. - BandwidthMessagesList.new(total_count, - page_info, - messages) - end - end -end diff --git a/lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb b/lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb deleted file mode 100644 index ecff110c..00000000 --- a/lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb +++ /dev/null @@ -1,60 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # DeferredResult Model. - class DeferredResult < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [Object] - attr_accessor :result - - # TODO: Write general description for this method - # @return [Boolean] - attr_accessor :set_or_expired - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['result'] = 'result' - @_hash['set_or_expired'] = 'setOrExpired' - @_hash - end - - # An array for optional fields - def optionals - %w[ - result - set_or_expired - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(result = nil, - set_or_expired = nil) - @result = result unless result == SKIP - @set_or_expired = set_or_expired unless set_or_expired == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - result = hash.key?('result') ? hash['result'] : SKIP - set_or_expired = hash.key?('setOrExpired') ? hash['setOrExpired'] : SKIP - - # Create object from extracted values. - DeferredResult.new(result, - set_or_expired) - end - end -end diff --git a/lib/bandwidth/messaging_lib/messaging/models/media.rb b/lib/bandwidth/messaging_lib/messaging/models/media.rb deleted file mode 100644 index 578db560..00000000 --- a/lib/bandwidth/messaging_lib/messaging/models/media.rb +++ /dev/null @@ -1,70 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Media Model. - class Media < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :content - - # TODO: Write general description for this method - # @return [Integer] - attr_accessor :content_length - - # TODO: Write general description for this method - # @return [String] - attr_accessor :media_name - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['content'] = 'content' - @_hash['content_length'] = 'contentLength' - @_hash['media_name'] = 'mediaName' - @_hash - end - - # An array for optional fields - def optionals - %w[ - content - content_length - media_name - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(content = nil, - content_length = nil, - media_name = nil) - @content = content unless content == SKIP - @content_length = content_length unless content_length == SKIP - @media_name = media_name unless media_name == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - content = hash.key?('content') ? hash['content'] : SKIP - content_length = hash.key?('contentLength') ? hash['contentLength'] : SKIP - media_name = hash.key?('mediaName') ? hash['mediaName'] : SKIP - - # Create object from extracted values. - Media.new(content, - content_length, - media_name) - end - end -end diff --git a/lib/bandwidth/messaging_lib/messaging/models/message_request.rb b/lib/bandwidth/messaging_lib/messaging/models/message_request.rb deleted file mode 100644 index 3609babb..00000000 --- a/lib/bandwidth/messaging_lib/messaging/models/message_request.rb +++ /dev/null @@ -1,111 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # MessageRequest Model. - class MessageRequest < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The ID of the Application your from number is associated with in the - # Bandwidth Phone Number Dashboard. - # @return [String] - attr_accessor :application_id - - # The phone number(s) the message should be sent to in E164 format - # @return [List of String] - attr_accessor :to - - # One of your telephone numbers the message should come from in E164 format - # @return [String] - attr_accessor :from - - # The contents of the text message. Must be 2048 characters or less. - # @return [String] - attr_accessor :text - - # A list of URLs to include as media attachments as part of the message. - # @return [List of String] - attr_accessor :media - - # A custom string that will be included in callback events of the message. - # Max 1024 characters - # @return [String] - attr_accessor :tag - - # The message's priority, currently for toll-free or short code SMS only. - # Messages with a priority value of `"high"` are given preference over your - # other traffic. - # @return [PriorityEnum] - attr_accessor :priority - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['application_id'] = 'applicationId' - @_hash['to'] = 'to' - @_hash['from'] = 'from' - @_hash['text'] = 'text' - @_hash['media'] = 'media' - @_hash['tag'] = 'tag' - @_hash['priority'] = 'priority' - @_hash - end - - # An array for optional fields - def optionals - %w[ - text - media - tag - priority - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(application_id = nil, - to = nil, - from = nil, - text = nil, - media = nil, - tag = nil, - priority = nil) - @application_id = application_id unless application_id == SKIP - @to = to unless to == SKIP - @from = from unless from == SKIP - @text = text unless text == SKIP - @media = media unless media == SKIP - @tag = tag unless tag == SKIP - @priority = priority unless priority == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP - to = hash.key?('to') ? hash['to'] : SKIP - from = hash.key?('from') ? hash['from'] : SKIP - text = hash.key?('text') ? hash['text'] : SKIP - media = hash.key?('media') ? hash['media'] : SKIP - tag = hash.key?('tag') ? hash['tag'] : SKIP - priority = hash.key?('priority') ? hash['priority'] : SKIP - - # Create object from extracted values. - MessageRequest.new(application_id, - to, - from, - text, - media, - tag, - priority) - end - end -end diff --git a/lib/bandwidth/messaging_lib/messaging/models/page_info.rb b/lib/bandwidth/messaging_lib/messaging/models/page_info.rb deleted file mode 100644 index 3c9faaaf..00000000 --- a/lib/bandwidth/messaging_lib/messaging/models/page_info.rb +++ /dev/null @@ -1,82 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # PageInfo Model. - class PageInfo < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The link to the previous page for pagination - # @return [String] - attr_accessor :prev_page - - # The link to the next page for pagination - # @return [String] - attr_accessor :next_page - - # The isolated pagination token for the previous page - # @return [String] - attr_accessor :prev_page_token - - # The isolated pagination token for the next page - # @return [String] - attr_accessor :next_page_token - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['prev_page'] = 'prevPage' - @_hash['next_page'] = 'nextPage' - @_hash['prev_page_token'] = 'prevPageToken' - @_hash['next_page_token'] = 'nextPageToken' - @_hash - end - - # An array for optional fields - def optionals - %w[ - prev_page - next_page - prev_page_token - next_page_token - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(prev_page = nil, - next_page = nil, - prev_page_token = nil, - next_page_token = nil) - @prev_page = prev_page unless prev_page == SKIP - @next_page = next_page unless next_page == SKIP - @prev_page_token = prev_page_token unless prev_page_token == SKIP - @next_page_token = next_page_token unless next_page_token == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - prev_page = hash.key?('prevPage') ? hash['prevPage'] : SKIP - next_page = hash.key?('nextPage') ? hash['nextPage'] : SKIP - prev_page_token = - hash.key?('prevPageToken') ? hash['prevPageToken'] : SKIP - next_page_token = - hash.key?('nextPageToken') ? hash['nextPageToken'] : SKIP - - # Create object from extracted values. - PageInfo.new(prev_page, - next_page, - prev_page_token, - next_page_token) - end - end -end diff --git a/lib/bandwidth/messaging_lib/messaging/models/priority_enum.rb b/lib/bandwidth/messaging_lib/messaging/models/priority_enum.rb deleted file mode 100644 index 73b83e87..00000000 --- a/lib/bandwidth/messaging_lib/messaging/models/priority_enum.rb +++ /dev/null @@ -1,19 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # The message's priority, currently for toll-free or short code SMS only. - # Messages with a priority value of `"high"` are given preference over your - # other traffic. - class PriorityEnum - PRIORITY_ENUM = [ - # TODO: Write general description for DEFAULT - DEFAULT = 'default'.freeze, - - # TODO: Write general description for HIGH - HIGH = 'high'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/messaging_lib/messaging/models/tag.rb b/lib/bandwidth/messaging_lib/messaging/models/tag.rb deleted file mode 100644 index 72e885b2..00000000 --- a/lib/bandwidth/messaging_lib/messaging/models/tag.rb +++ /dev/null @@ -1,60 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Tag Model. - class Tag < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :key - - # TODO: Write general description for this method - # @return [String] - attr_accessor :value - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['key'] = 'key' - @_hash['value'] = 'value' - @_hash - end - - # An array for optional fields - def optionals - %w[ - key - value - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(key = nil, - value = nil) - @key = key unless key == SKIP - @value = value unless value == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - key = hash.key?('key') ? hash['key'] : SKIP - value = hash.key?('value') ? hash['value'] : SKIP - - # Create object from extracted values. - Tag.new(key, - value) - end - end -end diff --git a/lib/bandwidth/models/base_model.rb b/lib/bandwidth/models/base_model.rb deleted file mode 100644 index 54038eae..00000000 --- a/lib/bandwidth/models/base_model.rb +++ /dev/null @@ -1,58 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Base model. - class BaseModel - # Returns a Hash representation of the current object. - def to_hash - hash = {} - instance_variables.each do |name| - value = instance_variable_get(name) - name = name[1..-1] - key = self.class.names.key?(name) ? self.class.names[name] : name - - optional_fields = optionals if respond_to? 'optionals' - nullable_fields = nullables if respond_to? 'nullables' - if value.nil? - next unless nullable_fields.include?(name) - - if !optional_fields.include?(name) && !nullable_fields.include?(name) - raise ArgumentError, - "`#{name}` cannot be nil in `#{self.class}`. Please specify a valid value." - end - end - - hash[key] = nil - unless value.nil? - if respond_to?("to_#{name}") - if (value.instance_of? Array) || (value.instance_of? Hash) - params = [hash, key] - hash[key] = send("to_#{name}", *params) - else - hash[key] = send("to_#{name}") - end - elsif value.instance_of? Array - hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v } - elsif value.instance_of? Hash - hash[key] = {} - value.each do |k, v| - hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v - end - else - hash[key] = value.is_a?(BaseModel) ? value.to_hash : value - end - end - end - hash - end - - # Returns a JSON representation of the curent object. - def to_json(options = {}) - hash = to_hash.reject { |k, v| v.nil? } - hash.to_json(options) - end - end -end diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth.rb deleted file mode 100644 index e7fe82c1..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth.rb +++ /dev/null @@ -1,23 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - - -require_relative 'multi_factor_auth/client.rb' - -# Models -require_relative 'multi_factor_auth/models/two_factor_code_request_schema.rb' -require_relative 'multi_factor_auth/models/two_factor_voice_response.rb' -require_relative 'multi_factor_auth/models/two_factor_messaging_response.rb' -require_relative 'multi_factor_auth/models/two_factor_verify_request_schema.rb' -require_relative 'multi_factor_auth/models/two_factor_verify_code_response.rb' - -# Exceptions -require_relative 'multi_factor_auth/exceptions/error_with_request_exception.rb' -require_relative 'multi_factor_auth/exceptions/unauthorized_request' \ - '_exception.rb' -require_relative 'multi_factor_auth/exceptions/forbidden_request_exception.rb' -# Controllers -require_relative 'multi_factor_auth/controllers/base_controller.rb' -require_relative 'multi_factor_auth/controllers/mfa_controller.rb' diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/client.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/client.rb deleted file mode 100644 index 9bf860c5..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/client.rb +++ /dev/null @@ -1,60 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - module MultiFactorAuth - # bandwidth client class. - class Client - attr_reader :config - - # Access to mfa controller. - # @return [MFAController] Returns the controller instance. - def mfa - @mfa ||= MFAController.new config - end - - def initialize(timeout: 60, max_retries: 0, retry_interval: 1, - backoff_factor: 2, - retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524], - retry_methods: %i[get put get put], - environment: Environment::PRODUCTION, - base_url: 'https://www.example.com', - messaging_basic_auth_user_name: 'TODO: Replace', - messaging_basic_auth_password: 'TODO: Replace', - multi_factor_auth_basic_auth_user_name: 'TODO: Replace', - multi_factor_auth_basic_auth_password: 'TODO: Replace', - phone_number_lookup_basic_auth_user_name: 'TODO: Replace', - phone_number_lookup_basic_auth_password: 'TODO: Replace', - voice_basic_auth_user_name: 'TODO: Replace', - voice_basic_auth_password: 'TODO: Replace', - web_rtc_basic_auth_user_name: 'TODO: Replace', - web_rtc_basic_auth_password: 'TODO: Replace', - config: nil) - @config = if config.nil? - Configuration.new(timeout: timeout, - max_retries: max_retries, - retry_interval: retry_interval, - backoff_factor: backoff_factor, - retry_statuses: retry_statuses, - retry_methods: retry_methods, - environment: environment, - base_url: base_url, - messaging_basic_auth_user_name: messaging_basic_auth_user_name, - messaging_basic_auth_password: messaging_basic_auth_password, - multi_factor_auth_basic_auth_user_name: multi_factor_auth_basic_auth_user_name, - multi_factor_auth_basic_auth_password: multi_factor_auth_basic_auth_password, - phone_number_lookup_basic_auth_user_name: phone_number_lookup_basic_auth_user_name, - phone_number_lookup_basic_auth_password: phone_number_lookup_basic_auth_password, - voice_basic_auth_user_name: voice_basic_auth_user_name, - voice_basic_auth_password: voice_basic_auth_password, - web_rtc_basic_auth_user_name: web_rtc_basic_auth_user_name, - web_rtc_basic_auth_password: web_rtc_basic_auth_password) - else - config - end - end - end -end -end diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/base_controller.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/base_controller.rb deleted file mode 100644 index 17e3cbc6..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/base_controller.rb +++ /dev/null @@ -1,47 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # BaseController. - class BaseController - attr_accessor :config, :http_call_back - - def initialize(config, http_call_back: nil) - @config = config - @http_call_back = http_call_back - - @global_headers = { - 'user-agent' => 'ruby-sdk' - } - end - - def validate_parameters(args) - args.each do |_name, value| - raise ArgumentError, "Required parameter #{_name} cannot be nil." if value.nil? - end - end - - def execute_request(request, binary: false) - @http_call_back&.on_before_request(request) - - APIHelper.clean_hash(request.headers) - request.headers.merge!(@global_headers) - - response = if binary - config.http_client.execute_as_binary(request) - else - config.http_client.execute_as_string(request) - end - @http_call_back&.on_after_response(response) - - response - end - - def validate_response(response) - raise APIException.new 'HTTP Response Not OK', response unless - response.status_code.between?(200, 208) # [200,208] = HTTP OK - end - end -end diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/mfa_controller.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/mfa_controller.rb deleted file mode 100644 index 20b77c37..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/mfa_controller.rb +++ /dev/null @@ -1,214 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth -module MultiFactorAuth - # MFAController - class MFAController < BaseController - def initialize(config, http_call_back: nil) - super(config, http_call_back: http_call_back) - end - - # Multi-Factor authentication with Bandwidth Voice services. Allows for a - # user to send an MFA code via a phone call. - # @param [String] account_id Required parameter: Bandwidth Account ID with - # Voice service enabled - # @param [TwoFactorCodeRequestSchema] body Required parameter: Example: - # @return [TwoFactorVoiceResponse] response from the API call - def create_voice_two_factor(account_id, - body) - # Prepare query url. - _query_builder = config.get_base_uri(Server::MULTIFACTORAUTHDEFAULT) - _query_builder << '/accounts/{accountId}/code/voice' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.post( - _query_url, - headers: _headers, - parameters: body.to_json - ) - MultiFactorAuthBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ErrorWithRequestException.new( - 'If there is any issue with values passed in by the user', - _response - ) - when 401 - raise UnauthorizedRequestException.new( - 'Authentication is either incorrect or not present', - _response - ) - when 403 - raise ForbiddenRequestException.new( - 'The user is not authorized to access this resource', - _response - ) - when 500 - raise ErrorWithRequestException.new( - 'An internal server error occurred', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: TwoFactorVoiceResponse.from_hash(decoded) - ) - end - - # Multi-Factor authentication with Bandwidth Messaging services. Allows a - # user to send an MFA code via a text message (SMS). - # @param [String] account_id Required parameter: Bandwidth Account ID with - # Messaging service enabled - # @param [TwoFactorCodeRequestSchema] body Required parameter: Example: - # @return [TwoFactorMessagingResponse] response from the API call - def create_messaging_two_factor(account_id, - body) - # Prepare query url. - _query_builder = config.get_base_uri(Server::MULTIFACTORAUTHDEFAULT) - _query_builder << '/accounts/{accountId}/code/messaging' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.post( - _query_url, - headers: _headers, - parameters: body.to_json - ) - MultiFactorAuthBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ErrorWithRequestException.new( - 'If there is any issue with values passed in by the user', - _response - ) - when 401 - raise UnauthorizedRequestException.new( - 'Authentication is either incorrect or not present', - _response - ) - when 403 - raise ForbiddenRequestException.new( - 'The user is not authorized to access this resource', - _response - ) - when 500 - raise ErrorWithRequestException.new( - 'An internal server error occurred', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, - data: TwoFactorMessagingResponse.from_hash(decoded) - ) - end - - # Allows a user to verify an MFA code. - # @param [String] account_id Required parameter: Bandwidth Account ID with - # Two-Factor enabled - # @param [TwoFactorVerifyRequestSchema] body Required parameter: Example: - # @return [TwoFactorVerifyCodeResponse] response from the API call - def create_verify_two_factor(account_id, - body) - # Prepare query url. - _query_builder = config.get_base_uri(Server::MULTIFACTORAUTHDEFAULT) - _query_builder << '/accounts/{accountId}/code/verify' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.post( - _query_url, - headers: _headers, - parameters: body.to_json - ) - MultiFactorAuthBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ErrorWithRequestException.new( - 'If there is any issue with values passed in by the user', - _response - ) - when 401 - raise UnauthorizedRequestException.new( - 'Authentication is either incorrect or not present', - _response - ) - when 403 - raise ForbiddenRequestException.new( - 'The user is not authorized to access this resource', - _response - ) - when 429 - raise ErrorWithRequestException.new( - 'The user has made too many bad requests and is temporarily locked' \ - ' out', - _response - ) - when 500 - raise ErrorWithRequestException.new( - 'An internal server error occurred', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, - data: TwoFactorVerifyCodeResponse.from_hash(decoded) - ) - end - end -end -end diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb deleted file mode 100644 index 4be5ec46..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb +++ /dev/null @@ -1,37 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # ErrorWithRequest class. - class ErrorWithRequestException < APIException - SKIP = Object.new - private_constant :SKIP - - # An error message pertaining to what the issue could be - # @return [String] - attr_accessor :error - - # The associated requestId from AWS - # @return [String] - attr_accessor :request_id - - # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. - def initialize(reason, response) - super(reason, response) - hash = APIHelper.json_deserialize(@response.raw_body) - unbox(hash) - end - - # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the - # response body. - def unbox(hash) - @error = hash.key?('error') ? hash['error'] : SKIP - @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP - end - end -end diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/forbidden_request_exception.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/forbidden_request_exception.rb deleted file mode 100644 index ecad4e7d..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/forbidden_request_exception.rb +++ /dev/null @@ -1,32 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # ForbiddenRequest class. - class ForbiddenRequestException < APIException - SKIP = Object.new - private_constant :SKIP - - # The message containing the reason behind the request being forbidden - # @return [String] - attr_accessor :message - - # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. - def initialize(reason, response) - super(reason, response) - hash = APIHelper.json_deserialize(@response.raw_body) - unbox(hash) - end - - # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the - # response body. - def unbox(hash) - @message = hash.key?('Message') ? hash['Message'] : SKIP - end - end -end diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/unauthorized_request_exception.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/unauthorized_request_exception.rb deleted file mode 100644 index 61773294..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/unauthorized_request_exception.rb +++ /dev/null @@ -1,32 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # UnauthorizedRequest class. - class UnauthorizedRequestException < APIException - SKIP = Object.new - private_constant :SKIP - - # The message containing the reason behind the request being unauthorized - # @return [String] - attr_accessor :message - - # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. - def initialize(reason, response) - super(reason, response) - hash = APIHelper.json_deserialize(@response.raw_body) - unbox(hash) - end - - # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the - # response body. - def unbox(hash) - @message = hash.key?('message') ? hash['message'] : SKIP - end - end -end diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb deleted file mode 100644 index 55ece41e..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb +++ /dev/null @@ -1,103 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # TwoFactorCodeRequestSchema Model. - class TwoFactorCodeRequestSchema < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The phone number to send the 2fa code to. - # @return [String] - attr_accessor :to - - # The application phone number, the sender of the 2fa code. - # @return [String] - attr_accessor :from - - # The application unique ID, obtained from Bandwidth. - # @return [String] - attr_accessor :application_id - - # An optional field to denote what scope or action the 2fa code is - # addressing. If not supplied, defaults to "2FA". - # @return [String] - attr_accessor :scope - - # The message format of the 2fa code. There are three values that the - # system will replace "{CODE}", "{NAME}", "{SCOPE}". The "{SCOPE}" and - # "{NAME} value template are optional, while "{CODE}" must be supplied. As - # the name would suggest, code will be replace with the actual 2fa code. - # Name is replaced with the application name, configured during provisioning - # of 2fa. The scope value is the same value sent during the call and - # partitioned by the server. - # @return [String] - attr_accessor :message - - # The number of digits for your 2fa code. The valid number ranges from 2 to - # 8, inclusively. - # @return [Float] - attr_accessor :digits - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['to'] = 'to' - @_hash['from'] = 'from' - @_hash['application_id'] = 'applicationId' - @_hash['scope'] = 'scope' - @_hash['message'] = 'message' - @_hash['digits'] = 'digits' - @_hash - end - - # An array for optional fields - def optionals - %w[ - scope - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(to = nil, - from = nil, - application_id = nil, - message = nil, - digits = nil, - scope = nil) - @to = to unless to == SKIP - @from = from unless from == SKIP - @application_id = application_id unless application_id == SKIP - @scope = scope unless scope == SKIP - @message = message unless message == SKIP - @digits = digits unless digits == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - to = hash.key?('to') ? hash['to'] : SKIP - from = hash.key?('from') ? hash['from'] : SKIP - application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP - message = hash.key?('message') ? hash['message'] : SKIP - digits = hash.key?('digits') ? hash['digits'] : SKIP - scope = hash.key?('scope') ? hash['scope'] : SKIP - - # Create object from extracted values. - TwoFactorCodeRequestSchema.new(to, - from, - application_id, - message, - digits, - scope) - end - end -end diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_messaging_response.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_messaging_response.rb deleted file mode 100644 index a1d2fcd9..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_messaging_response.rb +++ /dev/null @@ -1,50 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # TwoFactorMessagingResponse Model. - class TwoFactorMessagingResponse < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :message_id - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['message_id'] = 'messageId' - @_hash - end - - # An array for optional fields - def optionals - %w[ - message_id - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(message_id = nil) - @message_id = message_id unless message_id == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - message_id = hash.key?('messageId') ? hash['messageId'] : SKIP - - # Create object from extracted values. - TwoFactorMessagingResponse.new(message_id) - end - end -end diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_code_response.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_code_response.rb deleted file mode 100644 index b82fe257..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_code_response.rb +++ /dev/null @@ -1,50 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # TwoFactorVerifyCodeResponse Model. - class TwoFactorVerifyCodeResponse < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [Boolean] - attr_accessor :valid - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['valid'] = 'valid' - @_hash - end - - # An array for optional fields - def optionals - %w[ - valid - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(valid = nil) - @valid = valid unless valid == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - valid = hash.key?('valid') ? hash['valid'] : SKIP - - # Create object from extracted values. - TwoFactorVerifyCodeResponse.new(valid) - end - end -end diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb deleted file mode 100644 index ce78025f..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb +++ /dev/null @@ -1,94 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # TwoFactorVerifyRequestSchema Model. - class TwoFactorVerifyRequestSchema < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The phone number to send the 2fa code to. - # @return [String] - attr_accessor :to - - # The application unique ID, obtained from Bandwidth. - # @return [String] - attr_accessor :application_id - - # An optional field to denote what scope or action the 2fa code is - # addressing. If not supplied, defaults to "2FA". - # @return [String] - attr_accessor :scope - - # The time period, in minutes, to validate the 2fa code. By setting this to - # 3 minutes, it will mean any code generated within the last 3 minutes are - # still valid. The valid range for expiration time is between 0 and 15 - # minutes, exclusively and inclusively, respectively. - # @return [Float] - attr_accessor :expiration_time_in_minutes - - # The generated 2fa code to check if valid - # @return [String] - attr_accessor :code - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['to'] = 'to' - @_hash['application_id'] = 'applicationId' - @_hash['scope'] = 'scope' - @_hash['expiration_time_in_minutes'] = 'expirationTimeInMinutes' - @_hash['code'] = 'code' - @_hash - end - - # An array for optional fields - def optionals - %w[ - scope - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(to = nil, - application_id = nil, - expiration_time_in_minutes = nil, - code = nil, - scope = nil) - @to = to unless to == SKIP - @application_id = application_id unless application_id == SKIP - @scope = scope unless scope == SKIP - unless expiration_time_in_minutes == SKIP - @expiration_time_in_minutes = - expiration_time_in_minutes - end - @code = code unless code == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - to = hash.key?('to') ? hash['to'] : SKIP - application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP - expiration_time_in_minutes = - hash.key?('expirationTimeInMinutes') ? hash['expirationTimeInMinutes'] : SKIP - code = hash.key?('code') ? hash['code'] : SKIP - scope = hash.key?('scope') ? hash['scope'] : SKIP - - # Create object from extracted values. - TwoFactorVerifyRequestSchema.new(to, - application_id, - expiration_time_in_minutes, - code, - scope) - end - end -end diff --git a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_voice_response.rb b/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_voice_response.rb deleted file mode 100644 index bf138348..00000000 --- a/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_voice_response.rb +++ /dev/null @@ -1,50 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # TwoFactorVoiceResponse Model. - class TwoFactorVoiceResponse < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :call_id - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['call_id'] = 'callId' - @_hash - end - - # An array for optional fields - def optionals - %w[ - call_id - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(call_id = nil) - @call_id = call_id unless call_id == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - call_id = hash.key?('callId') ? hash['callId'] : SKIP - - # Create object from extracted values. - TwoFactorVoiceResponse.new(call_id) - end - end -end diff --git a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup.rb b/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup.rb deleted file mode 100644 index 535c959f..00000000 --- a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup.rb +++ /dev/null @@ -1,20 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - - -require_relative 'phone_number_lookup/client.rb' - -# Models -require_relative 'phone_number_lookup/models/order_request.rb' -require_relative 'phone_number_lookup/models/order_response.rb' -require_relative 'phone_number_lookup/models/order_status.rb' -require_relative 'phone_number_lookup/models/result.rb' - -# Exceptions -require_relative 'phone_number_lookup/exceptions/accounts_tnlookup400_error' \ - '_exception.rb' -# Controllers -require_relative 'phone_number_lookup/controllers/base_controller.rb' -require_relative 'phone_number_lookup/controllers/api_controller.rb' diff --git a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/client.rb b/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/client.rb deleted file mode 100644 index 81614f5b..00000000 --- a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/client.rb +++ /dev/null @@ -1,60 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - module PhoneNumberLookup - # bandwidth client class. - class Client - attr_reader :config - - # Access to client controller. - # @return [APIController] Returns the controller instance. - def client - @client ||= APIController.new config - end - - def initialize(timeout: 60, max_retries: 0, retry_interval: 1, - backoff_factor: 2, - retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524], - retry_methods: %i[get put get put], - environment: Environment::PRODUCTION, - base_url: 'https://www.example.com', - messaging_basic_auth_user_name: 'TODO: Replace', - messaging_basic_auth_password: 'TODO: Replace', - multi_factor_auth_basic_auth_user_name: 'TODO: Replace', - multi_factor_auth_basic_auth_password: 'TODO: Replace', - phone_number_lookup_basic_auth_user_name: 'TODO: Replace', - phone_number_lookup_basic_auth_password: 'TODO: Replace', - voice_basic_auth_user_name: 'TODO: Replace', - voice_basic_auth_password: 'TODO: Replace', - web_rtc_basic_auth_user_name: 'TODO: Replace', - web_rtc_basic_auth_password: 'TODO: Replace', - config: nil) - @config = if config.nil? - Configuration.new(timeout: timeout, - max_retries: max_retries, - retry_interval: retry_interval, - backoff_factor: backoff_factor, - retry_statuses: retry_statuses, - retry_methods: retry_methods, - environment: environment, - base_url: base_url, - messaging_basic_auth_user_name: messaging_basic_auth_user_name, - messaging_basic_auth_password: messaging_basic_auth_password, - multi_factor_auth_basic_auth_user_name: multi_factor_auth_basic_auth_user_name, - multi_factor_auth_basic_auth_password: multi_factor_auth_basic_auth_password, - phone_number_lookup_basic_auth_user_name: phone_number_lookup_basic_auth_user_name, - phone_number_lookup_basic_auth_password: phone_number_lookup_basic_auth_password, - voice_basic_auth_user_name: voice_basic_auth_user_name, - voice_basic_auth_password: voice_basic_auth_password, - web_rtc_basic_auth_user_name: web_rtc_basic_auth_user_name, - web_rtc_basic_auth_password: web_rtc_basic_auth_password) - else - config - end - end - end -end -end diff --git a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb b/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb deleted file mode 100644 index 82fec799..00000000 --- a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb +++ /dev/null @@ -1,1553 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth -module PhoneNumberLookup - # APIController - class APIController < BaseController - def initialize(config, http_call_back: nil) - super(config, http_call_back: http_call_back) - end - - # Create a TN Lookup Order. - # @param [String] account_id Required parameter: The ID of the Bandwidth - # account that the user belongs to. - # @param [OrderRequest] body Required parameter: Example: - # @return [OrderResponse] response from the API call - def create_lookup_request(account_id, - body) - # Prepare query url. - _query_builder = config.get_base_uri(Server::PHONENUMBERLOOKUPDEFAULT) - _query_builder << '/accounts/{accountId}/tnlookup' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.post( - _query_url, - headers: _headers, - parameters: body.to_json - ) - PhoneNumberLookupBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise AccountsTnlookup400ErrorException.new( - 'Bad Request. Ensure that your request payload is properly' \ - ' formatted and that the telephone numbers used are valid.', - _response - ) - when 401 - raise APIException.new( - 'Unauthorized. Ensure that you are using the proper credentials' \ - ' for the environment you are accessing, your user has' \ - ' the proper role assigned to it, and that your' \ - ' Bandwidth account is enabled for TN Lookup access.', - _response - ) - when 415 - raise APIException.new( - 'Invalid content-type. Ensure that your content-type header is set' \ - ' to application/json.', - _response - ) - when 429 - raise APIException.new( - 'Too Many Requests. Reduce the amount of requests that you are' \ - ' sending in order to avoid receiving this status code.', - _response - ) - when 500 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 501 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 502 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 503 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 504 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 505 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 506 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 507 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 508 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 509 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 510 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 511 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 512 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 513 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 514 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 515 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 516 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 517 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 518 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 519 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 520 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 521 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 522 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 523 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 524 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 525 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 526 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 527 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 528 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 529 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 530 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 531 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 532 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 533 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 534 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 535 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 536 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 537 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 538 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 539 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 540 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 541 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 542 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 543 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 544 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 545 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 546 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 547 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 548 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 549 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 550 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 551 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 552 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 553 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 554 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 555 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 556 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 557 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 558 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 559 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 560 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 561 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 562 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 563 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 564 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 565 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 566 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 567 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 568 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 569 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 570 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 571 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 572 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 573 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 574 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 575 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 576 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 577 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 578 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 579 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 580 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 581 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 582 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 583 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 584 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 585 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 586 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 587 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 588 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 589 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 590 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 591 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 592 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 593 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 594 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 595 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 596 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 597 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 598 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 599 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: OrderResponse.from_hash(decoded) - ) - end - - # Query an existing TN Lookup Order. - # @param [String] account_id Required parameter: The ID of the Bandwidth - # account that the user belongs to. - # @param [String] request_id Required parameter: Example: - # @return [OrderStatus] response from the API call - def get_lookup_request_status(account_id, - request_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::PHONENUMBERLOOKUPDEFAULT) - _query_builder << '/accounts/{accountId}/tnlookup/{requestId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'requestId' => { 'value' => request_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - PhoneNumberLookupBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise APIException.new( - 'Bad Request. Ensure that you have set the requestId as a URL path' \ - ' parameter.', - _response - ) - when 401 - raise APIException.new( - 'Unauthorized. Ensure that you are using the proper credentials' \ - ' for the environment you are accessing, your user has' \ - ' the proper role assigned to it, and that your' \ - ' Bandwidth account is enabled for TN Lookup access.', - _response - ) - when 404 - raise APIException.new( - 'RequestId not found. Ensure that the requestId used in the URL' \ - ' path is valid and maps to a previous request that was' \ - ' submitted.', - _response - ) - when 429 - raise APIException.new( - 'Too Many Requests. Reduce the amount of requests that you are' \ - ' sending in order to avoid receiving this status code.', - _response - ) - when 500 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 501 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 502 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 503 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 504 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 505 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 506 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 507 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 508 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 509 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 510 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 511 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 512 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 513 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 514 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 515 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 516 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 517 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 518 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 519 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 520 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 521 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 522 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 523 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 524 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 525 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 526 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 527 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 528 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 529 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 530 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 531 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 532 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 533 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 534 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 535 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 536 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 537 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 538 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 539 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 540 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 541 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 542 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 543 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 544 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 545 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 546 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 547 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 548 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 549 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 550 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 551 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 552 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 553 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 554 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 555 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 556 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 557 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 558 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 559 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 560 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 561 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 562 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 563 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 564 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 565 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 566 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 567 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 568 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 569 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 570 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 571 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 572 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 573 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 574 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 575 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 576 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 577 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 578 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 579 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 580 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 581 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 582 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 583 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 584 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 585 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 586 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 587 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 588 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 589 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 590 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 591 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 592 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 593 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 594 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 595 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 596 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 597 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 598 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - when 599 - raise APIException.new( - 'Unexpected error. Please contact Bandwidth Support if your' \ - ' requests are receiving this status code for an' \ - ' extended period of time.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: OrderStatus.from_hash(decoded) - ) - end - end -end -end diff --git a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb b/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb deleted file mode 100644 index 17e3cbc6..00000000 --- a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb +++ /dev/null @@ -1,47 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # BaseController. - class BaseController - attr_accessor :config, :http_call_back - - def initialize(config, http_call_back: nil) - @config = config - @http_call_back = http_call_back - - @global_headers = { - 'user-agent' => 'ruby-sdk' - } - end - - def validate_parameters(args) - args.each do |_name, value| - raise ArgumentError, "Required parameter #{_name} cannot be nil." if value.nil? - end - end - - def execute_request(request, binary: false) - @http_call_back&.on_before_request(request) - - APIHelper.clean_hash(request.headers) - request.headers.merge!(@global_headers) - - response = if binary - config.http_client.execute_as_binary(request) - else - config.http_client.execute_as_string(request) - end - @http_call_back&.on_after_response(response) - - response - end - - def validate_response(response) - raise APIException.new 'HTTP Response Not OK', response unless - response.status_code.between?(200, 208) # [200,208] = HTTP OK - end - end -end diff --git a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb b/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb deleted file mode 100644 index a36001ae..00000000 --- a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb +++ /dev/null @@ -1,32 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Accounts Tnlookup 400 Error class. - class AccountsTnlookup400ErrorException < APIException - SKIP = Object.new - private_constant :SKIP - - # A description of what validation error occurred. - # @return [String] - attr_accessor :message - - # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. - def initialize(reason, response) - super(reason, response) - hash = APIHelper.json_deserialize(@response.raw_body) - unbox(hash) - end - - # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the - # response body. - def unbox(hash) - @message = hash.key?('message') ? hash['message'] : SKIP - end - end -end diff --git a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb b/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb deleted file mode 100644 index 8a6a4333..00000000 --- a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb +++ /dev/null @@ -1,50 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Create TN Lookup Request - class OrderRequest < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [List of String] - attr_accessor :tns - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['tns'] = 'tns' - @_hash - end - - # An array for optional fields - def optionals - %w[ - tns - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(tns = nil) - @tns = tns unless tns == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - tns = hash.key?('tns') ? hash['tns'] : SKIP - - # Create object from extracted values. - OrderRequest.new(tns) - end - end -end diff --git a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb b/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb deleted file mode 100644 index 4157ad99..00000000 --- a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb +++ /dev/null @@ -1,61 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # The request has been accepted for processing but not yet finished and in a - # terminal state (COMPLETE, PARTIAL_COMPLETE, or FAILED) - class OrderResponse < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :request_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :status - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['request_id'] = 'requestId' - @_hash['status'] = 'status' - @_hash - end - - # An array for optional fields - def optionals - %w[ - request_id - status - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(request_id = nil, - status = nil) - @request_id = request_id unless request_id == SKIP - @status = status unless status == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - request_id = hash.key?('requestId') ? hash['requestId'] : SKIP - status = hash.key?('status') ? hash['status'] : SKIP - - # Create object from extracted values. - OrderResponse.new(request_id, - status) - end - end -end diff --git a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb b/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb deleted file mode 100644 index c6281931..00000000 --- a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb +++ /dev/null @@ -1,95 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # If requestId exists, the result for that request is returned. See the - # Examples for details on the various responses that you can receive. - # Generally, if you see a Response Code of 0 in a result for a TN, information - # will be available for it. Any other Response Code will indicate no - # information was available for the TN. - class OrderStatus < BaseModel - SKIP = Object.new - private_constant :SKIP - - # The requestId. - # @return [String] - attr_accessor :request_id - - # The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or - # FAILED). - # @return [String] - attr_accessor :status - - # The telephone numbers whose lookup failed - # @return [List of String] - attr_accessor :failed_telephone_numbers - - # The carrier information results for the specified telephone number. - # @return [List of Result] - attr_accessor :result - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['request_id'] = 'requestId' - @_hash['status'] = 'status' - @_hash['failed_telephone_numbers'] = 'failedTelephoneNumbers' - @_hash['result'] = 'result' - @_hash - end - - # An array for optional fields - def optionals - %w[ - request_id - status - failed_telephone_numbers - result - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(request_id = nil, - status = nil, - failed_telephone_numbers = nil, - result = nil) - @request_id = request_id unless request_id == SKIP - @status = status unless status == SKIP - @failed_telephone_numbers = failed_telephone_numbers unless failed_telephone_numbers == SKIP - @result = result unless result == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - request_id = hash.key?('requestId') ? hash['requestId'] : SKIP - status = hash.key?('status') ? hash['status'] : SKIP - failed_telephone_numbers = - hash.key?('failedTelephoneNumbers') ? hash['failedTelephoneNumbers'] : SKIP - # Parameter is an array, so we need to iterate through it - result = nil - unless hash['result'].nil? - result = [] - hash['result'].each do |structure| - result << (Result.from_hash(structure) if structure) - end - end - - result = SKIP unless hash.key?('result') - - # Create object from extracted values. - OrderStatus.new(request_id, - status, - failed_telephone_numbers, - result) - end - end -end diff --git a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb b/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb deleted file mode 100644 index 470765ca..00000000 --- a/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb +++ /dev/null @@ -1,132 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Result Model. - class Result < BaseModel - SKIP = Object.new - private_constant :SKIP - - # Our vendor's response code. - # @return [Integer] - attr_accessor :response_code - - # Message associated with the response code. - # @return [String] - attr_accessor :message - - # The telephone number in E.164 format. - # @return [String] - attr_accessor :e_164_format - - # The formatted version of the telephone number. - # @return [String] - attr_accessor :formatted - - # The country of the telephone number. - # @return [String] - attr_accessor :country - - # The line type of the telephone number. - # @return [String] - attr_accessor :line_type - - # The service provider of the telephone number. - # @return [String] - attr_accessor :line_provider - - # The first half of the Home Network Identity (HNI). - # @return [String] - attr_accessor :mobile_country_code - - # The second half of the HNI. - # @return [String] - attr_accessor :mobile_network_code - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['response_code'] = 'Response Code' - @_hash['message'] = 'Message' - @_hash['e_164_format'] = 'E.164 Format' - @_hash['formatted'] = 'Formatted' - @_hash['country'] = 'Country' - @_hash['line_type'] = 'Line Type' - @_hash['line_provider'] = 'Line Provider' - @_hash['mobile_country_code'] = 'Mobile Country Code' - @_hash['mobile_network_code'] = 'Mobile Network Code' - @_hash - end - - # An array for optional fields - def optionals - %w[ - response_code - message - e_164_format - formatted - country - line_type - line_provider - mobile_country_code - mobile_network_code - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(response_code = nil, - message = nil, - e_164_format = nil, - formatted = nil, - country = nil, - line_type = nil, - line_provider = nil, - mobile_country_code = nil, - mobile_network_code = nil) - @response_code = response_code unless response_code == SKIP - @message = message unless message == SKIP - @e_164_format = e_164_format unless e_164_format == SKIP - @formatted = formatted unless formatted == SKIP - @country = country unless country == SKIP - @line_type = line_type unless line_type == SKIP - @line_provider = line_provider unless line_provider == SKIP - @mobile_country_code = mobile_country_code unless mobile_country_code == SKIP - @mobile_network_code = mobile_network_code unless mobile_network_code == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - response_code = hash.key?('Response Code') ? hash['Response Code'] : SKIP - message = hash.key?('Message') ? hash['Message'] : SKIP - e_164_format = hash.key?('E.164 Format') ? hash['E.164 Format'] : SKIP - formatted = hash.key?('Formatted') ? hash['Formatted'] : SKIP - country = hash.key?('Country') ? hash['Country'] : SKIP - line_type = hash.key?('Line Type') ? hash['Line Type'] : SKIP - line_provider = hash.key?('Line Provider') ? hash['Line Provider'] : SKIP - mobile_country_code = - hash.key?('Mobile Country Code') ? hash['Mobile Country Code'] : SKIP - mobile_network_code = - hash.key?('Mobile Network Code') ? hash['Mobile Network Code'] : SKIP - - # Create object from extracted values. - Result.new(response_code, - message, - e_164_format, - formatted, - country, - line_type, - line_provider, - mobile_country_code, - mobile_network_code) - end - end -end diff --git a/lib/bandwidth/utilities/date_time_helper.rb b/lib/bandwidth/utilities/date_time_helper.rb deleted file mode 100644 index db5dc84b..00000000 --- a/lib/bandwidth/utilities/date_time_helper.rb +++ /dev/null @@ -1,156 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'date' -module Bandwidth - # A utility that supports dateTime conversion to different formats - class DateTimeHelper - # Safely converts a DateTime object into a rfc1123 format string - # @param [DateTime] The DateTime object - # @return [String] The rfc1123 formatted datetime string - def self.to_rfc1123(date_time) - date_time&.httpdate - end - - # Safely converts a map of DateTime objects into a map of rfc1123 format string - # @param [hash] a map of DateTime objects - # @return [hash] a map of rfc1123 formatted datetime string - def self.to_rfc1123_map(date_time, hash, key) - return if date_time.nil? - - hash[key] = {} - date_time.each do |k, v| - hash[key][k] = - if v.is_a?(BaseModel) - v.to_hash - else - v.is_a?(DateTime) ? DateTimeHelper.to_rfc1123(v) : v - end - end - hash[key] - end - - # Safely converts an array of DateTime objects into an array of rfc1123 format string - # @param [Array] an array of DateTime objects - # @return [Array] an array of rfc1123 formatted datetime string - def self.to_rfc1123_array(date_time, hash, key) - return if date_time.nil? - - hash[key] = date_time.map do |v| - if v.is_a?(BaseModel) - v.to_hash - else - v.is_a?(DateTime) ? DateTimeHelper.to_rfc1123(v) : v - end - end - end - - # Safely converts a DateTime object into a unix format string - # @param [DateTime] The DateTime object - # @return [String] The unix formatted datetime string - def self.to_unix(date_time) - date_time.to_time.utc.to_i unless date_time.nil? - end - - # Safely converts a map of DateTime objects into a map of unix format string - # @param [hash] a map of DateTime objects - # @return [hash] a map of unix formatted datetime string - def self.to_unix_map(date_time, hash, key) - return if date_time.nil? - - hash[key] = {} - date_time.each do |k, v| - hash[key][k] = - if v.is_a?(BaseModel) - v.to_hash - else - v.is_a?(DateTime) ? DateTimeHelper.to_unix(v) : v - end - end - hash[key] - end - - # Safely converts an array of DateTime objects into a map of unix format string - # @param [hash] an array of DateTime objects - # @return [hash] an array of unix formatted datetime string - def self.to_unix_array(date_time, hash, key) - return if date_time.nil? - - hash[key] = date_time.map do |v| - if v.is_a?(BaseModel) - v.to_hash - else - v.is_a?(DateTime) ? DateTimeHelper.to_unix(v) : v - end - end - end - - # Safely converts a DateTime object into a rfc3339 format string - # @param [DateTime] The DateTime object - # @return [String] The rfc3339 formatted datetime string - def self.to_rfc3339(date_time) - date_time&.rfc3339 - end - - # Safely converts a map of DateTime objects into a map of rfc1123 format string - # @param [hash] a map of DateTime objects - # @return [hash] a map of rfc1123 formatted datetime string - def self.to_rfc3339_map(date_time, hash, key) - return if date_time.nil? - - hash[key] = {} - date_time.each do |k, v| - hash[key][k] = - if v.is_a?(BaseModel) - v.to_hash - else - v.is_a?(DateTime) ? DateTimeHelper.to_rfc3339(v) : v - end - end - hash[key] - end - - # Safely converts an array of DateTime objects into an array of rfc1123 format string - # @param [Array] an array of DateTime objects - # @return [Array] an array of rfc1123 formatted datetime string - def self.to_rfc3339_array(date_time, hash, key) - return if date_time.nil? - - hash[key] = date_time.map do |v| - if v.is_a?(BaseModel) - v.to_hash - else - v.is_a?(DateTime) ? DateTimeHelper.to_rfc3339(v) : v - end - end - end - - # Safely converts a rfc1123 format string into a DateTime object - # @param [String] The rfc1123 formatted datetime string - # @return [DateTime] A DateTime object - def self.from_rfc1123(date_time) - DateTime.httpdate(date_time) - end - - # Safely converts a unix format string into a DateTime object - # @param [String] The unix formatted datetime string - # @return [DateTime] A DateTime object - def self.from_unix(date_time) - Time.at(date_time.to_i).utc.to_datetime - end - - # Safely converts a rfc3339 format string into a DateTime object - # @param [String] The rfc3339 formatted datetime string - # @return [DateTime] A DateTime object - def self.from_rfc3339(date_time) - # missing timezone information - if date_time.end_with?('Z') || date_time.index('+') - DateTime.rfc3339(date_time) - else - DateTime.rfc3339("#{date_time}Z") - end - end - end -end diff --git a/lib/bandwidth/utilities/file_wrapper.rb b/lib/bandwidth/utilities/file_wrapper.rb deleted file mode 100644 index 5c9dc6b9..00000000 --- a/lib/bandwidth/utilities/file_wrapper.rb +++ /dev/null @@ -1,16 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # A utility to allow users to set the content-type for files - class FileWrapper - attr_reader :content_type, :file - - def initialize(file, content_type: 'application/octet-stream') - @file = file - @content_type = content_type - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/bxml.rb b/lib/bandwidth/voice_lib/bxml/bxml.rb deleted file mode 100644 index ffcec42c..00000000 --- a/lib/bandwidth/voice_lib/bxml/bxml.rb +++ /dev/null @@ -1,36 +0,0 @@ -require 'builder' -Dir[File.dirname(__FILE__) + '/verbs/*'].each {|file| - require_relative file -} - -module Bandwidth - module Voice - class Bxml - # Initializer - # @param verbs [Array] optional list of verbs to include in the bxml tag - def initialize(verbs = nil) - @verbs = verbs || [] - end - - # Return BXML representaion of this response - def to_bxml() - xml = Builder::XmlMarkup.new() - xml.instruct!(:xml, :version=>'1.0', :encoding=>'UTF-8') - xml.Bxml do - @verbs.each {|verb| verb.to_bxml(xml)} - end - xml.target!().gsub(SPEAK_SENTENCE_REGEX){|s|s.gsub(SSML_REGEX, '<\1>')} - end - - # Add one or more verbs to this response - def push(*verbs) - @verbs.push(*verbs) - end - - # Add a verb to this response - def <<(verb) - @verbs << verb - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/response.rb b/lib/bandwidth/voice_lib/bxml/response.rb deleted file mode 100644 index fda1cfe7..00000000 --- a/lib/bandwidth/voice_lib/bxml/response.rb +++ /dev/null @@ -1,39 +0,0 @@ -require 'builder' -Dir[File.dirname(__FILE__) + '/verbs/*'].each {|file| - require_relative file -} - -SSML_REGEX = /<([a-zA-Z\/\/].*?)>/ -SPEAK_SENTENCE_REGEX = /.*?<\/SpeakSentence>/ - -module Bandwidth - module Voice - class Response - # Initializer - # @param verbs [Array] optional list of verbs to include into response - def initialize(verbs = nil) - @verbs = verbs || [] - end - - # Return BXML representaion of this response - def to_bxml() - xml = Builder::XmlMarkup.new() - xml.instruct!(:xml, :version=>'1.0', :encoding=>'UTF-8') - xml.Response do - @verbs.each {|verb| verb.to_bxml(xml)} - end - xml.target!().gsub(SPEAK_SENTENCE_REGEX){|s|s.gsub(SSML_REGEX, '<\1>')} - end - - # Add one or more verbs to this response - def push(*verbs) - @verbs.push(*verbs) - end - - # Add a verb to this response - def <<(verb) - @verbs << verb - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/bridge.rb b/lib/bandwidth/voice_lib/bxml/verbs/bridge.rb deleted file mode 100644 index 8235ebfc..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/bridge.rb +++ /dev/null @@ -1,28 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Bridge verb allows you to connect 2 calls - class Bridge - include XmlVerb - - def to_bxml(xml) - xml.Bridge(call_id, compact_hash({ - 'bridgeCompleteUrl' => bridge_complete_url, - 'bridgeCompleteMethod' => bridge_complete_method, - 'bridgeTargetCompleteUrl' => bridge_target_complete_url, - 'bridgeTargetCompleteMethod' => bridge_target_complete_method, - 'username' => username, - 'password' => password, - 'tag' => tag, - 'bridgeCompleteFallbackUrl' => bridge_complete_fallback_url, - 'bridgeCompleteFallbackMethod' => bridge_complete_fallback_method, - 'bridgeTargetCompleteFallbackUrl' => bridge_target_complete_fallback_url, - 'bridgeTargetCompleteFallbackMethod' => bridge_target_complete_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/conference.rb b/lib/bandwidth/voice_lib/bxml/verbs/conference.rb deleted file mode 100644 index c4147a00..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/conference.rb +++ /dev/null @@ -1,32 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Conference verb is used to add callees to conferences - class Conference - include XmlVerb - - def to_bxml(xml) - if not call_ids_to_coach.nil? - coach_ids = call_ids_to_coach.instance_of?(String) ? call_ids_to_coach : call_ids_to_coach.join(",") - else - coach_ids = nil - end - xml.Conference(conference_name, compact_hash({ - 'mute' => mute, - 'hold' => hold, - 'callIdsToCoach' => coach_ids, - 'conferenceEventUrl' => conference_event_url, - 'conferenceEventMethod' => conference_event_method, - 'username' => username, - 'password' => password, - 'tag' => tag, - 'conferenceEventFallbackUrl' => conference_event_fallback_url, - 'conferenceEventFallbackMethod' => conference_event_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/forward.rb b/lib/bandwidth/voice_lib/bxml/verbs/forward.rb deleted file mode 100644 index d429ae4a..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/forward.rb +++ /dev/null @@ -1,18 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - class Forward - include XmlVerb - def to_bxml(xml) - xml.Forward(compact_hash({ - 'to' => to, - 'from' => from, - 'callTimeout' => call_timeout, - 'diversionTreatment' => diversion_treatment, - 'diversionReason' => diversion_reason - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/gather.rb b/lib/bandwidth/voice_lib/bxml/verbs/gather.rb deleted file mode 100644 index d898f8cd..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/gather.rb +++ /dev/null @@ -1,49 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Gather verb is used to collect digits for some period of time - class Gather - include XmlVerb - - def to_bxml(xml) - xml.Gather(compact_hash({ - 'gatherUrl' => gather_url, - 'gatherMethod' => gather_method, - 'terminatingDigits' => terminating_digits, - 'tag' => tag, - 'maxDigits' => max_digits, - 'interDigitTimeout' => inter_digit_timeout, - 'username' => username, - 'password' => password, - 'firstDigitTimeout' => first_digit_timeout, - 'repeatCount' => repeat_count, - 'gatherFallbackUrl' => gather_fallback_url, - 'gatherFallbackMethod' => gather_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) do - def embedded_xml(xml, property, type) - if property - s = if property.is_a?(type) - then property - else type.new(property) - end - s.to_bxml(xml) - end - end - def nest_verbs_list(xml, property) - if property - property.each do |verb| - verb.to_bxml(xml) - end - end - end - embedded_xml(xml, speak_sentence, SpeakSentence) - embedded_xml(xml, play_audio, PlayAudio) - nest_verbs_list(xml, nested_verbs) - end - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/hangup.rb b/lib/bandwidth/voice_lib/bxml/verbs/hangup.rb deleted file mode 100644 index d316ebfc..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/hangup.rb +++ /dev/null @@ -1,14 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Hangup verb is used to hangup current call - class Hangup - include XmlVerb - - def to_bxml(xml) - xml.Hangup() - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/pause.rb b/lib/bandwidth/voice_lib/bxml/verbs/pause.rb deleted file mode 100644 index 7c6dc966..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/pause.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - class Pause - include XmlVerb - - def to_bxml(xml) - xml.Pause(compact_hash({ - 'duration' => duration - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/pause_recording.rb b/lib/bandwidth/voice_lib/bxml/verbs/pause_recording.rb deleted file mode 100644 index 86cd439c..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/pause_recording.rb +++ /dev/null @@ -1,14 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The PauseRecording verb is used to pause recording in a call - class PauseRecording - include XmlVerb - - def to_bxml(xml) - xml.PauseRecording() - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb b/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb deleted file mode 100644 index 725dbdc0..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb +++ /dev/null @@ -1,24 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - class PhoneNumber - include XmlVerb - def to_bxml(xml) - xml.PhoneNumber(number, compact_hash({ - 'transferAnswerUrl' => transfer_answer_url, - 'transferAnswerMethod' => transfer_answer_method, - 'transferDisconnectUrl' => transfer_disconnect_url, - 'transferDisconnectMethod' => transfer_disconnect_method, - 'username' => username, - 'password' => password, - 'tag' => tag, - 'transferAnswerFallbackUrl' => transfer_answer_fallback_url, - 'transferAnswerFallbackMethod' => transfer_answer_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/play_audio.rb b/lib/bandwidth/voice_lib/bxml/verbs/play_audio.rb deleted file mode 100644 index 59e7bfcb..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/play_audio.rb +++ /dev/null @@ -1,17 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The PlayAudio verb is used to play an audio file in the call - class PlayAudio - include XmlVerb - - def to_bxml(xml) - xml.PlayAudio(url, compact_hash({ - 'username' => username, - 'password' => password - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/record.rb b/lib/bandwidth/voice_lib/bxml/verbs/record.rb deleted file mode 100644 index ad2f6676..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/record.rb +++ /dev/null @@ -1,33 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Record verb is used to trigger call recording - class Record - include XmlVerb - - def to_bxml(xml) - xml.Record(compact_hash({ - 'tag' => tag, - 'username' => username, - 'password' => password, - 'recordCompleteUrl' => record_complete_url, - 'recordCompleteMethod' => record_complete_method, - 'recordingAvailableUrl' => recording_available_url, - 'recordingAvailableMethod' => recording_available_method, - 'terminatingDigits' => terminating_digits, - 'maxDuration' => max_duration, - 'fileFormat' => file_format, - 'transcribe' => transcribe, - 'transcriptionAvailableUrl' => transcription_available_url, - 'transcriptionAvailableMethod' => transcription_available_method, - 'silenceTimeout' => silence_timeout, - 'recordCompleteFallbackUrl' => record_complete_fallback_url, - 'recordCompleteFallbackMethod' => record_complete_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/redirect.rb b/lib/bandwidth/voice_lib/bxml/verbs/redirect.rb deleted file mode 100644 index 80112e0b..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/redirect.rb +++ /dev/null @@ -1,24 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Redirect verb is used to redirect the current XML execution to another URL - class Redirect - include XmlVerb - - def to_bxml(xml) - xml.Redirect(compact_hash({ - 'redirectUrl' => redirect_url, - 'redirectMethod' => redirect_method, - 'tag' => tag, - 'username' => username, - 'password' => password, - 'redirectFallbackUrl' => redirect_fallback_url, - 'redirectFallbackMethod' => redirect_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/resume_recording.rb b/lib/bandwidth/voice_lib/bxml/verbs/resume_recording.rb deleted file mode 100644 index 09ec5ebf..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/resume_recording.rb +++ /dev/null @@ -1,14 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The ResumeRecording verb is used to resume recording in a call - class ResumeRecording - include XmlVerb - - def to_bxml(xml) - xml.ResumeRecording() - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/ring.rb b/lib/bandwidth/voice_lib/bxml/verbs/ring.rb deleted file mode 100644 index d1a41c14..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/ring.rb +++ /dev/null @@ -1,16 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - class Ring - include XmlVerb - - def to_bxml(xml) - xml.Ring(compact_hash({ - 'duration' => duration, - 'answerCall' => answer_call - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb b/lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb deleted file mode 100644 index f2c9a140..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb +++ /dev/null @@ -1,16 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - class SendDtmf - include XmlVerb - - def to_bxml(xml) - xml.SendDtmf(dtmf, compact_hash({ - 'toneDuration' => tone_duration, - 'toneInterval' => tone_interval - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/sip_uri.rb b/lib/bandwidth/voice_lib/bxml/verbs/sip_uri.rb deleted file mode 100644 index 2465a8b0..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/sip_uri.rb +++ /dev/null @@ -1,25 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - class SipUri - include XmlVerb - def to_bxml(xml) - xml.SipUri(uri, compact_hash({ - 'transferAnswerUrl' => transfer_answer_url, - 'transferAnswerMethod' => transfer_answer_method, - 'transferDisconnectUrl' => transfer_disconnect_url, - 'transferDisconnectMethod' => transfer_disconnect_method, - 'username' => username, - 'password' => password, - 'tag' => tag, - 'uui' => uui, - 'transferAnswerFallbackUrl' => transfer_answer_fallback_url, - 'transferAnswerFallbackMethod' => transfer_answer_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/speak_sentence.rb b/lib/bandwidth/voice_lib/bxml/verbs/speak_sentence.rb deleted file mode 100644 index b43c9795..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/speak_sentence.rb +++ /dev/null @@ -1,18 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The SpeakSentence verb is used to convert any text into speak for the caller - class SpeakSentence - include XmlVerb - - def to_bxml(xml) - xml.SpeakSentence(sentence, compact_hash({ - 'voice' => voice, - 'locale' => locale, - 'gender' => gender - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/start_gather.rb b/lib/bandwidth/voice_lib/bxml/verbs/start_gather.rb deleted file mode 100644 index 39454343..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/start_gather.rb +++ /dev/null @@ -1,20 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StartGather verb is used to start a gather - class StartGather - include XmlVerb - - def to_bxml(xml) - xml.StartGather(compact_hash({ - 'username' => username, - 'password' => password, - 'tag' => tag, - 'dtmfUrl' => dtmf_url, - 'dtmfMethod' => dtmf_method, - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/start_recording.rb b/lib/bandwidth/voice_lib/bxml/verbs/start_recording.rb deleted file mode 100644 index 292ea88a..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/start_recording.rb +++ /dev/null @@ -1,25 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StartRecording verb is used to trigger call recording - class StartRecording - include XmlVerb - - def to_bxml(xml) - xml.StartRecording(compact_hash({ - 'tag' => tag, - 'username' => username, - 'password' => password, - 'recordingAvailableUrl' => recording_available_url, - 'recordingAvailableMethod' => recording_available_method, - 'fileFormat' => file_format, - 'multiChannel' => multi_channel, - 'transcribe' => transcribe, - 'transcriptionAvailableUrl' => transcription_available_url, - 'transcriptionAvailableMethod' => transcription_available_method - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/stop_gather.rb b/lib/bandwidth/voice_lib/bxml/verbs/stop_gather.rb deleted file mode 100644 index 0e4c5dae..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/stop_gather.rb +++ /dev/null @@ -1,14 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StopGather verb is used to complete a gather - class StopGather - include XmlVerb - - def to_bxml(xml) - xml.StopGather() - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/stop_recording.rb b/lib/bandwidth/voice_lib/bxml/verbs/stop_recording.rb deleted file mode 100644 index eececb46..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/stop_recording.rb +++ /dev/null @@ -1,14 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StopRecording verb is used to stop recording in a call - class StopRecording - include XmlVerb - - def to_bxml(xml) - xml.StopRecording() - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/stop_stream.rb b/lib/bandwidth/voice_lib/bxml/verbs/stop_stream.rb deleted file mode 100644 index 32920835..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/stop_stream.rb +++ /dev/null @@ -1,16 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StopStream verb is used to stop a stream that was started with a previous `` verb - class StopStream - include XmlVerb - - def to_bxml(xml) - xml.StopStream(compact_hash({ - 'name' => name - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/tag.rb b/lib/bandwidth/voice_lib/bxml/verbs/tag.rb deleted file mode 100644 index 20e2f7d2..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/tag.rb +++ /dev/null @@ -1,13 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - class Tag - include XmlVerb - - def to_bxml(xml) - xml.Tag(tag) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/transfer.rb b/lib/bandwidth/voice_lib/bxml/verbs/transfer.rb deleted file mode 100644 index 680da916..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/transfer.rb +++ /dev/null @@ -1,48 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Transfer verb is used to transfer the call to another number - class Transfer - include XmlVerb - - def to_bxml(xml) - xml.Transfer(compact_hash({ - 'transferCallerId' => transfer_caller_id, - 'callTimeout' => call_timeout, - 'tag' => tag, - 'transferCompleteUrl' => transfer_complete_url, - 'transferCompleteMethod' => transfer_complete_method, - 'username' => username, - 'password' => password, - 'diversionTreatment' => diversion_treatment, - 'diversionReason' => diversion_reason, - 'transferCompleteFallbackUrl' => transfer_complete_fallback_url, - 'transferCompleteFallbackMethod' => transfer_complete_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) do - def embedded_xml(xml, property, type) - if property - s = if property.is_a?(type) - then property - else type.new(property) - end - s.to_bxml(xml) - end - end - if not phone_numbers.nil? - phone_numbers.each do |number| - embedded_xml(xml, number, PhoneNumber) - end - end - if not sip_uris.nil? - sip_uris.each do |sip_uri| - embedded_xml(xml, sip_uri, SipUri) - end - end - end - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/xml_verb.rb b/lib/bandwidth/voice_lib/bxml/verbs/xml_verb.rb deleted file mode 100644 index 8233a934..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/xml_verb.rb +++ /dev/null @@ -1,26 +0,0 @@ -module Bandwidth - module Voice - module XmlVerb - def initialize(data = nil) - @data = (data || {}).clone() - end - - def method_missing(name, *args, &block) - if name[name.size - 1] == '=' - @data[name[0..-2].to_sym] = args[0] - else - @data[name] - end - end - - def compact_hash(hash) - hash.inject({}) do |new_hash, (k,v)| - if !v.nil? - new_hash[k] = v.class == Hash ? compact_hash(v) : v - end - new_hash - end - end - end - end -end diff --git a/lib/bandwidth/voice_lib/voice.rb b/lib/bandwidth/voice_lib/voice.rb deleted file mode 100644 index 9e0e7e62..00000000 --- a/lib/bandwidth/voice_lib/voice.rb +++ /dev/null @@ -1,48 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - - -require_relative 'voice/client.rb' - -# Models -require_relative 'voice/models/create_call_request.rb' -require_relative 'voice/models/create_call_response.rb' -require_relative 'voice/models/call_state.rb' -require_relative 'voice/models/modify_call_request.rb' -require_relative 'voice/models/modify_call_recording_request.rb' -require_relative 'voice/models/call_recording_metadata.rb' -require_relative 'voice/models/modify_conference_request.rb' -require_relative 'voice/models/conference_state.rb' -require_relative 'voice/models/conference_member_state.rb' -require_relative 'voice/models/conference_recording_metadata.rb' -require_relative 'voice/models/machine_detection_configuration.rb' -require_relative 'voice/models/transcribe_recording_request.rb' -require_relative 'voice/models/transcription_response.rb' -require_relative 'voice/models/transcription_metadata.rb' -require_relative 'voice/models/transcript.rb' -require_relative 'voice/models/call_callback.rb' -require_relative 'voice/models/transcription.rb' -require_relative 'voice/models/diversion.rb' -require_relative 'voice/models/conference_callback.rb' -require_relative 'voice/models/answer_fallback_method_enum.rb' -require_relative 'voice/models/answer_method_enum.rb' -require_relative 'voice/models/callback_method_enum.rb' -require_relative 'voice/models/conference_event_method_enum.rb' -require_relative 'voice/models/direction_enum.rb' -require_relative 'voice/models/disconnect_method_enum.rb' -require_relative 'voice/models/fallback_method_enum.rb' -require_relative 'voice/models/file_format_enum.rb' -require_relative 'voice/models/mode_enum.rb' -require_relative 'voice/models/redirect_fallback_method_enum.rb' -require_relative 'voice/models/redirect_method_enum.rb' -require_relative 'voice/models/state_enum.rb' -require_relative 'voice/models/state1_enum.rb' -require_relative 'voice/models/status_enum.rb' - -# Exceptions -require_relative 'voice/exceptions/api_error_exception.rb' -# Controllers -require_relative 'voice/controllers/base_controller.rb' -require_relative 'voice/controllers/api_controller.rb' diff --git a/lib/bandwidth/voice_lib/voice/client.rb b/lib/bandwidth/voice_lib/voice/client.rb deleted file mode 100644 index a4324203..00000000 --- a/lib/bandwidth/voice_lib/voice/client.rb +++ /dev/null @@ -1,60 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - module Voice - # bandwidth client class. - class Client - attr_reader :config - - # Access to client controller. - # @return [APIController] Returns the controller instance. - def client - @client ||= APIController.new config - end - - def initialize(timeout: 60, max_retries: 0, retry_interval: 1, - backoff_factor: 2, - retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524], - retry_methods: %i[get put get put], - environment: Environment::PRODUCTION, - base_url: 'https://www.example.com', - messaging_basic_auth_user_name: 'TODO: Replace', - messaging_basic_auth_password: 'TODO: Replace', - multi_factor_auth_basic_auth_user_name: 'TODO: Replace', - multi_factor_auth_basic_auth_password: 'TODO: Replace', - phone_number_lookup_basic_auth_user_name: 'TODO: Replace', - phone_number_lookup_basic_auth_password: 'TODO: Replace', - voice_basic_auth_user_name: 'TODO: Replace', - voice_basic_auth_password: 'TODO: Replace', - web_rtc_basic_auth_user_name: 'TODO: Replace', - web_rtc_basic_auth_password: 'TODO: Replace', - config: nil) - @config = if config.nil? - Configuration.new(timeout: timeout, - max_retries: max_retries, - retry_interval: retry_interval, - backoff_factor: backoff_factor, - retry_statuses: retry_statuses, - retry_methods: retry_methods, - environment: environment, - base_url: base_url, - messaging_basic_auth_user_name: messaging_basic_auth_user_name, - messaging_basic_auth_password: messaging_basic_auth_password, - multi_factor_auth_basic_auth_user_name: multi_factor_auth_basic_auth_user_name, - multi_factor_auth_basic_auth_password: multi_factor_auth_basic_auth_password, - phone_number_lookup_basic_auth_user_name: phone_number_lookup_basic_auth_user_name, - phone_number_lookup_basic_auth_password: phone_number_lookup_basic_auth_password, - voice_basic_auth_user_name: voice_basic_auth_user_name, - voice_basic_auth_password: voice_basic_auth_password, - web_rtc_basic_auth_user_name: web_rtc_basic_auth_user_name, - web_rtc_basic_auth_password: web_rtc_basic_auth_password) - else - config - end - end - end -end -end diff --git a/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb b/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb deleted file mode 100644 index fbdbbe56..00000000 --- a/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +++ /dev/null @@ -1,1820 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth -module Voice - # APIController - class APIController < BaseController - def initialize(config, http_call_back: nil) - super(config, http_call_back: http_call_back) - end - - # Creates an outbound phone call. - # @param [String] account_id Required parameter: Example: - # @param [CreateCallRequest] body Required parameter: Example: - # @return [CreateCallResponse] response from the API call - def create_call(account_id, - body) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.post( - _query_url, - headers: _headers, - parameters: body.to_json - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: CreateCallResponse.from_hash(decoded) - ) - end - - # Returns near-realtime metadata about the specified call. - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @return [CallState] response from the API call - def get_call(account_id, - call_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: CallState.from_hash(decoded) - ) - end - - # Interrupts and replaces an active call's BXML document. - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @param [ModifyCallRequest] body Required parameter: Example: - # @return [void] response from the API call - def modify_call(account_id, - call_id, - body) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.post( - _query_url, - headers: _headers, - parameters: body.to_json - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Makes a PUT request to /api/v2/accounts/{accountId}/calls/{callId}/bxml - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @param [String] body Required parameter: Example: - # @return [void] response from the API call - def modify_call_bxml(account_id, - call_id, - body - ) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/bxml' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'content-type' => 'application/xml; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.put( - _query_url, - headers: _headers, - parameters: body.to_json - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/xml`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Pauses or resumes a recording. - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @param [ModifyCallRecordingRequest] body Required parameter: Example: - # @return [void] response from the API call - def modify_call_recording_state(account_id, - call_id, - body) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recording' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.put( - _query_url, - headers: _headers, - parameters: body.to_json - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Returns a (potentially empty) list of metadata for the recordings that - # took place during the specified call. - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @return [List of CallRecordingMetadata] response from the API call - def get_call_recordings(account_id, - call_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, - data: decoded.map { |element| CallRecordingMetadata.from_hash(element) } - ) - end - - # Returns metadata for the specified recording. - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @param [String] recording_id Required parameter: Example: - # @return [CallRecordingMetadata] response from the API call - def get_call_recording(account_id, - call_id, - recording_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false }, - 'recordingId' => { 'value' => recording_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: CallRecordingMetadata.from_hash(decoded) - ) - end - - # Deletes the specified recording. - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @param [String] recording_id Required parameter: Example: - # @return [void] response from the API call - def delete_recording(account_id, - call_id, - recording_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false }, - 'recordingId' => { 'value' => recording_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare and execute HttpRequest. - _request = config.http_client.delete( - _query_url - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Downloads the specified recording. - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @param [String] recording_id Required parameter: Example: - # @return [Mixed] response from the API call - def get_download_call_recording(account_id, - call_id, - recording_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false }, - 'recordingId' => { 'value' => recording_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new( - _response, data: _response.raw_body - ) - end - - # Deletes the specified recording's media. - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @param [String] recording_id Required parameter: Example: - # @return [void] response from the API call - def delete_recording_media(account_id, - call_id, - recording_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false }, - 'recordingId' => { 'value' => recording_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare and execute HttpRequest. - _request = config.http_client.delete( - _query_url - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Downloads the specified transcription. - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @param [String] recording_id Required parameter: Example: - # @return [TranscriptionResponse] response from the API call - def get_call_transcription(account_id, - call_id, - recording_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false }, - 'recordingId' => { 'value' => recording_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: TranscriptionResponse.from_hash(decoded) - ) - end - - # Requests that the specified recording be transcribed. - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @param [String] recording_id Required parameter: Example: - # @param [TranscribeRecordingRequest] body Required parameter: Example: - # @return [void] response from the API call - def create_transcribe_call_recording(account_id, - call_id, - recording_id, - body) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false }, - 'recordingId' => { 'value' => recording_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.post( - _query_url, - headers: _headers, - parameters: body.to_json - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 410 - raise ApiErrorException.new( - 'The media for this recording has been deleted, so we can\'t' \ - ' transcribe it', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Deletes the specified recording's transcription. - # @param [String] account_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @param [String] recording_id Required parameter: Example: - # @return [void] response from the API call - def delete_call_transcription(account_id, - call_id, - recording_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false }, - 'recordingId' => { 'value' => recording_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare and execute HttpRequest. - _request = config.http_client.delete( - _query_url - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Returns information about the conferences in the account. - # @param [String] account_id Required parameter: Example: - # @param [String] name Optional parameter: Example: - # @param [String] min_created_time Optional parameter: Example: - # @param [String] max_created_time Optional parameter: Example: - # @param [Integer] page_size Optional parameter: Example:1000 - # @param [String] page_token Optional parameter: Example: - # @return [List of ConferenceState] response from the API call - def get_conferences(account_id, - name: nil, - min_created_time: nil, - max_created_time: nil, - page_size: 1000, - page_token: nil) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/conferences' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_builder = APIHelper.append_url_with_query_parameters( - _query_builder, - 'name' => name, - 'minCreatedTime' => min_created_time, - 'maxCreatedTime' => max_created_time, - 'pageSize' => page_size, - 'pageToken' => page_token - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, - data: decoded.map { |element| ConferenceState.from_hash(element) } - ) - end - - # Returns information about the specified conference. - # @param [String] account_id Required parameter: Example: - # @param [String] conference_id Required parameter: Example: - # @return [ConferenceState] response from the API call - def get_conference(account_id, - conference_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'conferenceId' => { 'value' => conference_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: ConferenceState.from_hash(decoded) - ) - end - - # Modify the conference state. - # @param [String] account_id Required parameter: Example: - # @param [String] conference_id Required parameter: Example: - # @param [ModifyConferenceRequest] body Required parameter: Example: - # @return [void] response from the API call - def modify_conference(account_id, - conference_id, - body) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'conferenceId' => { 'value' => conference_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.post( - _query_url, - headers: _headers, - parameters: body.to_json - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Updates settings for a particular conference member. - # @param [String] account_id Required parameter: Example: - # @param [String] conference_id Required parameter: Example: - # @param [String] call_id Required parameter: Example: - # @param [ConferenceMemberState] body Required parameter: Example: - # @return [void] response from the API call - def modify_conference_member(account_id, - conference_id, - call_id, - body) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}/members/{callId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'conferenceId' => { 'value' => conference_id, 'encode' => false }, - 'callId' => { 'value' => call_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.put( - _query_url, - headers: _headers, - parameters: body.to_json - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Returns information about the specified conference member. - # @param [String] account_id Required parameter: Example: - # @param [String] conference_id Required parameter: Example: - # @param [String] member_id Required parameter: Example: - # @return [ConferenceMemberState] response from the API call - def get_conference_member(account_id, - conference_id, - member_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'conferenceId' => { 'value' => conference_id, 'encode' => false }, - 'memberId' => { 'value' => member_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: ConferenceMemberState.from_hash(decoded) - ) - end - - # Returns a (potentially empty) list of metadata for the recordings that - # took place during the specified conference - # @param [String] account_id Required parameter: Example: - # @param [String] conference_id Required parameter: Example: - # @return [List of ConferenceRecordingMetadata] response from the API call - def get_conference_recordings(account_id, - conference_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'conferenceId' => { 'value' => conference_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, - data: decoded.map { |element| ConferenceRecordingMetadata.from_hash(element) } - ) - end - - # Returns metadata for the specified recording. - # @param [String] account_id Required parameter: Example: - # @param [String] conference_id Required parameter: Example: - # @param [String] recording_id Required parameter: Example: - # @return [CallRecordingMetadata] response from the API call - def get_conference_recording(account_id, - conference_id, - recording_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'conferenceId' => { 'value' => conference_id, 'encode' => false }, - 'recordingId' => { 'value' => recording_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: CallRecordingMetadata.from_hash(decoded) - ) - end - - # Downloads the specified recording. - # @param [String] account_id Required parameter: Example: - # @param [String] conference_id Required parameter: Example: - # @param [String] recording_id Required parameter: Example: - # @return [Mixed] response from the API call - def get_download_conference_recording(account_id, - conference_id, - recording_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'conferenceId' => { 'value' => conference_id, 'encode' => false }, - 'recordingId' => { 'value' => recording_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) unless - _response.raw_body.nil? || - _response.raw_body.to_s.strip.empty? - ApiResponse.new( - _response, data: decoded - ) - end - - # Returns a list of metadata for the recordings associated with the - # specified account. The list can be filtered by the optional from, to, - # minStartTime, and maxStartTime arguments. The list is capped at 1000 - # entries and may be empty if no recordings match the specified criteria. - # @param [String] account_id Required parameter: Example: - # @param [String] from Optional parameter: Example: - # @param [String] to Optional parameter: Example: - # @param [String] min_start_time Optional parameter: Example: - # @param [String] max_start_time Optional parameter: Example: - # @return [List of CallRecordingMetadata] response from the API call - def get_query_call_recordings(account_id, - from: nil, - to: nil, - min_start_time: nil, - max_start_time: nil) - # Prepare query url. - _query_builder = config.get_base_uri(Server::VOICEDEFAULT) - _query_builder << '/api/v2/accounts/{accountId}/recordings' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_builder = APIHelper.append_url_with_query_parameters( - _query_builder, - 'from' => from, - 'to' => to, - 'minStartTime' => min_start_time, - 'maxStartTime' => max_start_time - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - VoiceBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise ApiErrorException.new( - 'Something\'s not quite right... Your request is invalid. Please' \ - ' fix it before trying again.', - _response - ) - when 401 - raise APIException.new( - 'Your credentials are invalid. Please use your Bandwidth dashboard' \ - ' credentials to authenticate to the API.', - _response - ) - when 403 - raise ApiErrorException.new( - 'User unauthorized to perform this action.', - _response - ) - when 404 - raise ApiErrorException.new( - 'The resource specified cannot be found or does not belong to you.', - _response - ) - when 415 - raise ApiErrorException.new( - 'We don\'t support that media type. If a request body is required,' \ - ' please send it to us as `application/json`.', - _response - ) - when 429 - raise ApiErrorException.new( - 'You\'re sending requests to this endpoint too frequently. Please' \ - ' slow your request rate down and try again.', - _response - ) - when 500 - raise ApiErrorException.new( - 'Something unexpected happened. Please try again.', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, - data: decoded.map { |element| CallRecordingMetadata.from_hash(element) } - ) - end - end -end -end diff --git a/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb b/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb deleted file mode 100644 index 17e3cbc6..00000000 --- a/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +++ /dev/null @@ -1,47 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # BaseController. - class BaseController - attr_accessor :config, :http_call_back - - def initialize(config, http_call_back: nil) - @config = config - @http_call_back = http_call_back - - @global_headers = { - 'user-agent' => 'ruby-sdk' - } - end - - def validate_parameters(args) - args.each do |_name, value| - raise ArgumentError, "Required parameter #{_name} cannot be nil." if value.nil? - end - end - - def execute_request(request, binary: false) - @http_call_back&.on_before_request(request) - - APIHelper.clean_hash(request.headers) - request.headers.merge!(@global_headers) - - response = if binary - config.http_client.execute_as_binary(request) - else - config.http_client.execute_as_string(request) - end - @http_call_back&.on_after_response(response) - - response - end - - def validate_response(response) - raise APIException.new 'HTTP Response Not OK', response unless - response.status_code.between?(200, 208) # [200,208] = HTTP OK - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/exceptions/api_error_exception.rb b/lib/bandwidth/voice_lib/voice/exceptions/api_error_exception.rb deleted file mode 100644 index 73ad7ace..00000000 --- a/lib/bandwidth/voice_lib/voice/exceptions/api_error_exception.rb +++ /dev/null @@ -1,42 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # ApiError class. - class ApiErrorException < APIException - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :type - - # TODO: Write general description for this method - # @return [String] - attr_accessor :description - - # TODO: Write general description for this method - # @return [String] - attr_accessor :id - - # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. - def initialize(reason, response) - super(reason, response) - hash = APIHelper.json_deserialize(@response.raw_body) - unbox(hash) - end - - # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the - # response body. - def unbox(hash) - @type = hash.key?('type') ? hash['type'] : SKIP - @description = hash.key?('description') ? hash['description'] : SKIP - @id = hash.key?('id') ? hash['id'] : SKIP - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/answer_fallback_method_enum.rb b/lib/bandwidth/voice_lib/voice/models/answer_fallback_method_enum.rb deleted file mode 100644 index d94a8141..00000000 --- a/lib/bandwidth/voice_lib/voice/models/answer_fallback_method_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # AnswerFallbackMethod. - class AnswerFallbackMethodEnum - ANSWER_FALLBACK_METHOD_ENUM = [ - # TODO: Write general description for POST - POST = 'POST'.freeze, - - # TODO: Write general description for GET - GET = 'GET'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb b/lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb deleted file mode 100644 index 37d74045..00000000 --- a/lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # AnswerMethod. - class AnswerMethodEnum - ANSWER_METHOD_ENUM = [ - # TODO: Write general description for POST - POST = 'POST'.freeze, - - # TODO: Write general description for GET - GET = 'GET'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/call_callback.rb b/lib/bandwidth/voice_lib/voice/models/call_callback.rb deleted file mode 100644 index 70e4c83d..00000000 --- a/lib/bandwidth/voice_lib/voice/models/call_callback.rb +++ /dev/null @@ -1,343 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # This object represents all possible fields that may be included in callbacks - # related to call events, including events that come from BXML verbs - class CallCallback < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :event_type - - # TODO: Write general description for this method - # @return [String] - attr_accessor :event_time - - # TODO: Write general description for this method - # @return [String] - attr_accessor :account_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :application_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :from - - # TODO: Write general description for this method - # @return [String] - attr_accessor :to - - # TODO: Write general description for this method - # @return [String] - attr_accessor :direction - - # TODO: Write general description for this method - # @return [String] - attr_accessor :call_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :call_url - - # TODO: Write general description for this method - # @return [String] - attr_accessor :start_time - - # TODO: Write general description for this method - # @return [String] - attr_accessor :answer_time - - # TODO: Write general description for this method - # @return [String] - attr_accessor :transfer_caller_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :transfer_to - - # TODO: Write general description for this method - # @return [String] - attr_accessor :cause - - # TODO: Write general description for this method - # @return [String] - attr_accessor :error_message - - # TODO: Write general description for this method - # @return [String] - attr_accessor :error_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :end_time - - # TODO: Write general description for this method - # @return [String] - attr_accessor :digit - - # TODO: Write general description for this method - # @return [String] - attr_accessor :parent_call_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :recording_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :duration - - # TODO: Write general description for this method - # @return [String] - attr_accessor :file_format - - # TODO: Write general description for this method - # @return [String] - attr_accessor :media_url - - # TODO: Write general description for this method - # @return [String] - attr_accessor :tag - - # TODO: Write general description for this method - # @return [Integer] - attr_accessor :channels - - # TODO: Write general description for this method - # @return [String] - attr_accessor :status - - # TODO: Write general description for this method - # @return [String] - attr_accessor :digits - - # TODO: Write general description for this method - # @return [String] - attr_accessor :terminating_digit - - # TODO: Write general description for this method - # @return [Transcription] - attr_accessor :transcription - - # TODO: Write general description for this method - # @return [Diversion] - attr_accessor :diversion - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['event_type'] = 'eventType' - @_hash['event_time'] = 'eventTime' - @_hash['account_id'] = 'accountId' - @_hash['application_id'] = 'applicationId' - @_hash['from'] = 'from' - @_hash['to'] = 'to' - @_hash['direction'] = 'direction' - @_hash['call_id'] = 'callId' - @_hash['call_url'] = 'callUrl' - @_hash['start_time'] = 'startTime' - @_hash['answer_time'] = 'answerTime' - @_hash['transfer_caller_id'] = 'transferCallerId' - @_hash['transfer_to'] = 'transferTo' - @_hash['cause'] = 'cause' - @_hash['error_message'] = 'errorMessage' - @_hash['error_id'] = 'errorId' - @_hash['end_time'] = 'endTime' - @_hash['digit'] = 'digit' - @_hash['parent_call_id'] = 'parentCallId' - @_hash['recording_id'] = 'recordingId' - @_hash['duration'] = 'duration' - @_hash['file_format'] = 'fileFormat' - @_hash['media_url'] = 'mediaUrl' - @_hash['tag'] = 'tag' - @_hash['channels'] = 'channels' - @_hash['status'] = 'status' - @_hash['digits'] = 'digits' - @_hash['terminating_digit'] = 'terminatingDigit' - @_hash['transcription'] = 'transcription' - @_hash['diversion'] = 'diversion' - @_hash - end - - # An array for optional fields - def optionals - %w[ - event_type - event_time - account_id - application_id - from - to - direction - call_id - call_url - start_time - answer_time - transfer_caller_id - transfer_to - cause - error_message - error_id - end_time - digit - parent_call_id - recording_id - duration - file_format - media_url - tag - channels - status - digits - terminating_digit - transcription - diversion - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(event_type = nil, - event_time = nil, - account_id = nil, - application_id = nil, - from = nil, - to = nil, - direction = nil, - call_id = nil, - call_url = nil, - start_time = nil, - answer_time = nil, - transfer_caller_id = nil, - transfer_to = nil, - cause = nil, - error_message = nil, - error_id = nil, - end_time = nil, - digit = nil, - parent_call_id = nil, - recording_id = nil, - duration = nil, - file_format = nil, - media_url = nil, - tag = nil, - channels = nil, - status = nil, - digits = nil, - terminating_digit = nil, - transcription = nil, - diversion = nil) - @event_type = event_type unless event_type == SKIP - @event_time = event_time unless event_time == SKIP - @account_id = account_id unless account_id == SKIP - @application_id = application_id unless application_id == SKIP - @from = from unless from == SKIP - @to = to unless to == SKIP - @direction = direction unless direction == SKIP - @call_id = call_id unless call_id == SKIP - @call_url = call_url unless call_url == SKIP - @start_time = start_time unless start_time == SKIP - @answer_time = answer_time unless answer_time == SKIP - @transfer_caller_id = transfer_caller_id unless transfer_caller_id == SKIP - @transfer_to = transfer_to unless transfer_to == SKIP - @cause = cause unless cause == SKIP - @error_message = error_message unless error_message == SKIP - @error_id = error_id unless error_id == SKIP - @end_time = end_time unless end_time == SKIP - @digit = digit unless digit == SKIP - @parent_call_id = parent_call_id unless parent_call_id == SKIP - @recording_id = recording_id unless recording_id == SKIP - @duration = duration unless duration == SKIP - @file_format = file_format unless file_format == SKIP - @media_url = media_url unless media_url == SKIP - @tag = tag unless tag == SKIP - @channels = channels unless channels == SKIP - @status = status unless status == SKIP - @digits = digits unless digits == SKIP - @terminating_digit = terminating_digit unless terminating_digit == SKIP - @transcription = transcription unless transcription == SKIP - @diversion = diversion unless diversion == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - event_type = hash.key?('eventType') ? hash['eventType'] : SKIP - event_time = hash.key?('eventTime') ? hash['eventTime'] : SKIP - account_id = hash.key?('accountId') ? hash['accountId'] : SKIP - application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP - from = hash.key?('from') ? hash['from'] : SKIP - to = hash.key?('to') ? hash['to'] : SKIP - direction = hash.key?('direction') ? hash['direction'] : SKIP - call_id = hash.key?('callId') ? hash['callId'] : SKIP - call_url = hash.key?('callUrl') ? hash['callUrl'] : SKIP - start_time = hash.key?('startTime') ? hash['startTime'] : SKIP - answer_time = hash.key?('answerTime') ? hash['answerTime'] : SKIP - transfer_caller_id = - hash.key?('transferCallerId') ? hash['transferCallerId'] : SKIP - transfer_to = hash.key?('transferTo') ? hash['transferTo'] : SKIP - cause = hash.key?('cause') ? hash['cause'] : SKIP - error_message = hash.key?('errorMessage') ? hash['errorMessage'] : SKIP - error_id = hash.key?('errorId') ? hash['errorId'] : SKIP - end_time = hash.key?('endTime') ? hash['endTime'] : SKIP - digit = hash.key?('digit') ? hash['digit'] : SKIP - parent_call_id = hash.key?('parentCallId') ? hash['parentCallId'] : SKIP - recording_id = hash.key?('recordingId') ? hash['recordingId'] : SKIP - duration = hash.key?('duration') ? hash['duration'] : SKIP - file_format = hash.key?('fileFormat') ? hash['fileFormat'] : SKIP - media_url = hash.key?('mediaUrl') ? hash['mediaUrl'] : SKIP - tag = hash.key?('tag') ? hash['tag'] : SKIP - channels = hash.key?('channels') ? hash['channels'] : SKIP - status = hash.key?('status') ? hash['status'] : SKIP - digits = hash.key?('digits') ? hash['digits'] : SKIP - terminating_digit = - hash.key?('terminatingDigit') ? hash['terminatingDigit'] : SKIP - transcription = Transcription.from_hash(hash['transcription']) if hash['transcription'] - diversion = Diversion.from_hash(hash['diversion']) if hash['diversion'] - - # Create object from extracted values. - CallCallback.new(event_type, - event_time, - account_id, - application_id, - from, - to, - direction, - call_id, - call_url, - start_time, - answer_time, - transfer_caller_id, - transfer_to, - cause, - error_message, - error_id, - end_time, - digit, - parent_call_id, - recording_id, - duration, - file_format, - media_url, - tag, - channels, - status, - digits, - terminating_digit, - transcription, - diversion) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb b/lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb deleted file mode 100644 index cafdce2a..00000000 --- a/lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb +++ /dev/null @@ -1,250 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'date' -module Bandwidth - # CallRecordingMetadata Model. - class CallRecordingMetadata < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :application_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :account_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :call_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :parent_call_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :recording_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :to - - # TODO: Write general description for this method - # @return [String] - attr_accessor :from - - # TODO: Write general description for this method - # @return [String] - attr_accessor :transfer_caller_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :transfer_to - - # Format is ISO-8601 - # @return [String] - attr_accessor :duration - - # Format is ISO-8601 - # @return [DirectionEnum] - attr_accessor :direction - - # Format is ISO-8601 - # @return [Integer] - attr_accessor :channels - - # Format is ISO-8601 - # @return [DateTime] - attr_accessor :start_time - - # Format is ISO-8601 - # @return [DateTime] - attr_accessor :end_time - - # Format is ISO-8601 - # @return [FileFormatEnum] - attr_accessor :file_format - - # The current status of the recording. Current values are 'processing', - # 'partial', 'complete', 'deleted' and 'error'. Additional states may be - # added in the future, so your application must be tolerant of unknown - # values. - # @return [String] - attr_accessor :status - - # The current status of the recording. Current values are 'processing', - # 'partial', 'complete', 'deleted' and 'error'. Additional states may be - # added in the future, so your application must be tolerant of unknown - # values. - # @return [String] - attr_accessor :media_url - - # The current status of the recording. Current values are 'processing', - # 'partial', 'complete', 'deleted' and 'error'. Additional states may be - # added in the future, so your application must be tolerant of unknown - # values. - # @return [TranscriptionMetadata] - attr_accessor :transcription - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['application_id'] = 'applicationId' - @_hash['account_id'] = 'accountId' - @_hash['call_id'] = 'callId' - @_hash['parent_call_id'] = 'parentCallId' - @_hash['recording_id'] = 'recordingId' - @_hash['to'] = 'to' - @_hash['from'] = 'from' - @_hash['transfer_caller_id'] = 'transferCallerId' - @_hash['transfer_to'] = 'transferTo' - @_hash['duration'] = 'duration' - @_hash['direction'] = 'direction' - @_hash['channels'] = 'channels' - @_hash['start_time'] = 'startTime' - @_hash['end_time'] = 'endTime' - @_hash['file_format'] = 'fileFormat' - @_hash['status'] = 'status' - @_hash['media_url'] = 'mediaUrl' - @_hash['transcription'] = 'transcription' - @_hash - end - - # An array for optional fields - def optionals - %w[ - application_id - account_id - call_id - parent_call_id - recording_id - to - from - transfer_caller_id - transfer_to - duration - direction - channels - start_time - end_time - file_format - status - media_url - transcription - ] - end - - # An array for nullable fields - def nullables - %w[ - parent_call_id - ] - end - - def initialize(application_id = nil, - account_id = nil, - call_id = nil, - parent_call_id = nil, - recording_id = nil, - to = nil, - from = nil, - transfer_caller_id = nil, - transfer_to = nil, - duration = nil, - direction = nil, - channels = nil, - start_time = nil, - end_time = nil, - file_format = nil, - status = nil, - media_url = nil, - transcription = nil) - @application_id = application_id unless application_id == SKIP - @account_id = account_id unless account_id == SKIP - @call_id = call_id unless call_id == SKIP - @parent_call_id = parent_call_id unless parent_call_id == SKIP - @recording_id = recording_id unless recording_id == SKIP - @to = to unless to == SKIP - @from = from unless from == SKIP - @transfer_caller_id = transfer_caller_id unless transfer_caller_id == SKIP - @transfer_to = transfer_to unless transfer_to == SKIP - @duration = duration unless duration == SKIP - @direction = direction unless direction == SKIP - @channels = channels unless channels == SKIP - @start_time = start_time unless start_time == SKIP - @end_time = end_time unless end_time == SKIP - @file_format = file_format unless file_format == SKIP - @status = status unless status == SKIP - @media_url = media_url unless media_url == SKIP - @transcription = transcription unless transcription == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP - account_id = hash.key?('accountId') ? hash['accountId'] : SKIP - call_id = hash.key?('callId') ? hash['callId'] : SKIP - parent_call_id = hash.key?('parentCallId') ? hash['parentCallId'] : SKIP - recording_id = hash.key?('recordingId') ? hash['recordingId'] : SKIP - to = hash.key?('to') ? hash['to'] : SKIP - from = hash.key?('from') ? hash['from'] : SKIP - transfer_caller_id = - hash.key?('transferCallerId') ? hash['transferCallerId'] : SKIP - transfer_to = hash.key?('transferTo') ? hash['transferTo'] : SKIP - duration = hash.key?('duration') ? hash['duration'] : SKIP - direction = hash.key?('direction') ? hash['direction'] : SKIP - channels = hash.key?('channels') ? hash['channels'] : SKIP - start_time = if hash.key?('startTime') - (DateTimeHelper.from_rfc3339(hash['startTime']) if hash['startTime']) - else - SKIP - end - end_time = if hash.key?('endTime') - (DateTimeHelper.from_rfc3339(hash['endTime']) if hash['endTime']) - else - SKIP - end - file_format = hash.key?('fileFormat') ? hash['fileFormat'] : SKIP - status = hash.key?('status') ? hash['status'] : SKIP - media_url = hash.key?('mediaUrl') ? hash['mediaUrl'] : SKIP - transcription = TranscriptionMetadata.from_hash(hash['transcription']) if - hash['transcription'] - - # Create object from extracted values. - CallRecordingMetadata.new(application_id, - account_id, - call_id, - parent_call_id, - recording_id, - to, - from, - transfer_caller_id, - transfer_to, - duration, - direction, - channels, - start_time, - end_time, - file_format, - status, - media_url, - transcription) - end - - def to_start_time - DateTimeHelper.to_rfc3339(start_time) - end - - def to_end_time - DateTimeHelper.to_rfc3339(end_time) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/call_state.rb b/lib/bandwidth/voice_lib/voice/models/call_state.rb deleted file mode 100644 index 2af81135..00000000 --- a/lib/bandwidth/voice_lib/voice/models/call_state.rb +++ /dev/null @@ -1,301 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'date' -module Bandwidth - # CallState Model. - class CallState < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :call_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :parent_call_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :application_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :account_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :to - - # TODO: Write general description for this method - # @return [String] - attr_accessor :from - - # TODO: Write general description for this method - # @return [String] - attr_accessor :direction - - # The current state of the call. Current possible values are 'initiated', - # 'answered' and 'disconnected'. Additional states may be added in the - # future, so your application must be tolerant of unknown values. - # @return [String] - attr_accessor :state - - # The current state of the call. Current possible values are 'initiated', - # 'answered' and 'disconnected'. Additional states may be added in the - # future, so your application must be tolerant of unknown values. - # @return [String] - attr_accessor :identity - - # The current state of the call. Current possible values are 'initiated', - # 'answered' and 'disconnected'. Additional states may be added in the - # future, so your application must be tolerant of unknown values. - # @return [Hash] - attr_accessor :stir_shaken - - # The current state of the call. Current possible values are 'initiated', - # 'answered' and 'disconnected'. Additional states may be added in the - # future, so your application must be tolerant of unknown values. - # @return [DateTime] - attr_accessor :start_time - - # @return [DateTime] - attr_accessor :enqueued_time - - # The current state of the call. Current possible values are 'initiated', - # 'answered' and 'disconnected'. Additional states may be added in the - # future, so your application must be tolerant of unknown values. - # @return [DateTime] - attr_accessor :answer_time - - # The current state of the call. Current possible values are 'initiated', - # 'answered' and 'disconnected'. Additional states may be added in the - # future, so your application must be tolerant of unknown values. - # @return [DateTime] - attr_accessor :end_time - - # The reason the call was disconnected, or null if the call is still active. - # Current values are 'cancel', 'timeout', 'busy', 'rejected', 'hangup', - # 'invalid-bxml', 'callback-error', 'application-error', 'error', - # 'account-limit', 'node-capacity-exceeded' and 'unknown'. Additional causes - # may be added in the future, so your application must be tolerant of - # unknown values. - # @return [String] - attr_accessor :disconnect_cause - - # The reason the call was disconnected, or null if the call is still active. - # Current values are 'cancel', 'timeout', 'busy', 'rejected', 'hangup', - # 'invalid-bxml', 'callback-error', 'application-error', 'error', - # 'account-limit', 'node-capacity-exceeded' and 'unknown'. Additional causes - # may be added in the future, so your application must be tolerant of - # unknown values. - # @return [String] - attr_accessor :error_message - - # The reason the call was disconnected, or null if the call is still active. - # Current values are 'cancel', 'timeout', 'busy', 'rejected', 'hangup', - # 'invalid-bxml', 'callback-error', 'application-error', 'error', - # 'account-limit', 'node-capacity-exceeded' and 'unknown'. Additional causes - # may be added in the future, so your application must be tolerant of - # unknown values. - # @return [String] - attr_accessor :error_id - - # The reason the call was disconnected, or null if the call is still active. - # Current values are 'cancel', 'timeout', 'busy', 'rejected', 'hangup', - # 'invalid-bxml', 'callback-error', 'application-error', 'error', - # 'account-limit', 'node-capacity-exceeded' and 'unknown'. Additional causes - # may be added in the future, so your application must be tolerant of - # unknown values. - # @return [DateTime] - attr_accessor :last_update - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['call_id'] = 'callId' - @_hash['parent_call_id'] = 'parentCallId' - @_hash['application_id'] = 'applicationId' - @_hash['account_id'] = 'accountId' - @_hash['to'] = 'to' - @_hash['from'] = 'from' - @_hash['direction'] = 'direction' - @_hash['state'] = 'state' - @_hash['identity'] = 'identity' - @_hash['stir_shaken'] = 'stirShaken' - @_hash['start_time'] = 'startTime' - @_hash['enqueued_time'] = 'enqueuedTime' - @_hash['answer_time'] = 'answerTime' - @_hash['end_time'] = 'endTime' - @_hash['disconnect_cause'] = 'disconnectCause' - @_hash['error_message'] = 'errorMessage' - @_hash['error_id'] = 'errorId' - @_hash['last_update'] = 'lastUpdate' - @_hash - end - - # An array for optional fields - def optionals - %w[ - call_id - parent_call_id - application_id - account_id - to - from - direction - state - identity - stir_shaken - start_time - enqueued_time - answer_time - end_time - disconnect_cause - error_message - error_id - last_update - ] - end - - # An array for nullable fields - def nullables - %w[ - parent_call_id - identity - answer_time - end_time - disconnect_cause - error_message - error_id - ] - end - - def initialize(call_id = nil, - parent_call_id = nil, - application_id = nil, - account_id = nil, - to = nil, - from = nil, - direction = nil, - state = nil, - identity = nil, - stir_shaken = nil, - start_time = nil, - enqueued_time = nil, - answer_time = nil, - end_time = nil, - disconnect_cause = nil, - error_message = nil, - error_id = nil, - last_update = nil) - @call_id = call_id unless call_id == SKIP - @parent_call_id = parent_call_id unless parent_call_id == SKIP - @application_id = application_id unless application_id == SKIP - @account_id = account_id unless account_id == SKIP - @to = to unless to == SKIP - @from = from unless from == SKIP - @direction = direction unless direction == SKIP - @state = state unless state == SKIP - @identity = identity unless identity == SKIP - @stir_shaken = stir_shaken unless stir_shaken == SKIP - @start_time = start_time unless start_time == SKIP - @enqueued_time = enqueued_time unless enqueued_time == SKIP - @answer_time = answer_time unless answer_time == SKIP - @end_time = end_time unless end_time == SKIP - @disconnect_cause = disconnect_cause unless disconnect_cause == SKIP - @error_message = error_message unless error_message == SKIP - @error_id = error_id unless error_id == SKIP - @last_update = last_update unless last_update == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - call_id = hash.key?('callId') ? hash['callId'] : SKIP - parent_call_id = hash.key?('parentCallId') ? hash['parentCallId'] : SKIP - application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP - account_id = hash.key?('accountId') ? hash['accountId'] : SKIP - to = hash.key?('to') ? hash['to'] : SKIP - from = hash.key?('from') ? hash['from'] : SKIP - direction = hash.key?('direction') ? hash['direction'] : SKIP - state = hash.key?('state') ? hash['state'] : SKIP - identity = hash.key?('identity') ? hash['identity'] : SKIP - stir_shaken = hash.key?('stirShaken') ? hash['stirShaken'] : SKIP - start_time = if hash.key?('startTime') - (DateTimeHelper.from_rfc3339(hash['startTime']) if hash['startTime']) - else - SKIP - end - enqueued_time = if hash.key?('enqueuedTime') - (DateTimeHelper.from_rfc3339(hash['enqueuedTime']) if hash['enqueuedTime']) - else - SKIP - end - answer_time = if hash.key?('answerTime') - (DateTimeHelper.from_rfc3339(hash['answerTime']) if hash['answerTime']) - else - SKIP - end - end_time = if hash.key?('endTime') - (DateTimeHelper.from_rfc3339(hash['endTime']) if hash['endTime']) - else - SKIP - end - disconnect_cause = - hash.key?('disconnectCause') ? hash['disconnectCause'] : SKIP - error_message = hash.key?('errorMessage') ? hash['errorMessage'] : SKIP - error_id = hash.key?('errorId') ? hash['errorId'] : SKIP - last_update = if hash.key?('lastUpdate') - (DateTimeHelper.from_rfc3339(hash['lastUpdate']) if hash['lastUpdate']) - else - SKIP - end - - # Create object from extracted values. - CallState.new(call_id, - parent_call_id, - application_id, - account_id, - to, - from, - direction, - state, - identity, - stir_shaken, - start_time, - enqueued_time, - answer_time, - end_time, - disconnect_cause, - error_message, - error_id, - last_update) - end - - def to_start_time - DateTimeHelper.to_rfc3339(start_time) - end - - def to_enqueued_time - DateTimeHelper.to_rfc3339(enqueued_time) - end - - def to_answer_time - DateTimeHelper.to_rfc3339(answer_time) - end - - def to_end_time - DateTimeHelper.to_rfc3339(end_time) - end - - def to_last_update - DateTimeHelper.to_rfc3339(last_update) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb b/lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb deleted file mode 100644 index f20ffa77..00000000 --- a/lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # CallbackMethod. - class CallbackMethodEnum - CALLBACK_METHOD_ENUM = [ - # TODO: Write general description for POST - POST = 'POST'.freeze, - - # TODO: Write general description for GET - GET = 'GET'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/conference_callback.rb b/lib/bandwidth/voice_lib/voice/models/conference_callback.rb deleted file mode 100644 index c9e5a08a..00000000 --- a/lib/bandwidth/voice_lib/voice/models/conference_callback.rb +++ /dev/null @@ -1,211 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # This object represents all possible fields that may be included in callbacks - # related to conference events - class ConferenceCallback < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :conference_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :name - - # TODO: Write general description for this method - # @return [String] - attr_accessor :event_type - - # TODO: Write general description for this method - # @return [String] - attr_accessor :event_time - - # TODO: Write general description for this method - # @return [String] - attr_accessor :tag - - # TODO: Write general description for this method - # @return [String] - attr_accessor :call_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :to - - # TODO: Write general description for this method - # @return [String] - attr_accessor :from - - # TODO: Write general description for this method - # @return [String] - attr_accessor :account_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :recording_id - - # TODO: Write general description for this method - # @return [Integer] - attr_accessor :channels - - # TODO: Write general description for this method - # @return [String] - attr_accessor :start_time - - # TODO: Write general description for this method - # @return [String] - attr_accessor :end_time - - # TODO: Write general description for this method - # @return [String] - attr_accessor :duration - - # TODO: Write general description for this method - # @return [String] - attr_accessor :file_format - - # TODO: Write general description for this method - # @return [String] - attr_accessor :media_url - - # TODO: Write general description for this method - # @return [String] - attr_accessor :status - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['conference_id'] = 'conferenceId' - @_hash['name'] = 'name' - @_hash['event_type'] = 'eventType' - @_hash['event_time'] = 'eventTime' - @_hash['tag'] = 'tag' - @_hash['call_id'] = 'callId' - @_hash['to'] = 'to' - @_hash['from'] = 'from' - @_hash['account_id'] = 'accountId' - @_hash['recording_id'] = 'recordingId' - @_hash['channels'] = 'channels' - @_hash['start_time'] = 'startTime' - @_hash['end_time'] = 'endTime' - @_hash['duration'] = 'duration' - @_hash['file_format'] = 'fileFormat' - @_hash['media_url'] = 'mediaUrl' - @_hash['status'] = 'status' - @_hash - end - - # An array for optional fields - def optionals - %w[ - conference_id - name - event_type - event_time - tag - call_id - to - from - account_id - recording_id - channels - start_time - end_time - duration - file_format - media_url - status - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(conference_id = nil, - name = nil, - event_type = nil, - event_time = nil, - tag = nil, - call_id = nil, - to = nil, - from = nil, - account_id = nil, - recording_id = nil, - channels = nil, - start_time = nil, - end_time = nil, - duration = nil, - file_format = nil, - media_url = nil, - status = nil) - @conference_id = conference_id unless conference_id == SKIP - @name = name unless name == SKIP - @event_type = event_type unless event_type == SKIP - @event_time = event_time unless event_time == SKIP - @tag = tag unless tag == SKIP - @call_id = call_id unless call_id == SKIP - @to = to unless to == SKIP - @from = from unless from == SKIP - @account_id = account_id unless account_id == SKIP - @recording_id = recording_id unless recording_id == SKIP - @channels = channels unless channels == SKIP - @start_time = start_time unless start_time == SKIP - @end_time = end_time unless end_time == SKIP - @duration = duration unless duration == SKIP - @file_format = file_format unless file_format == SKIP - @media_url = media_url unless media_url == SKIP - @status = status unless status == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - conference_id = hash.key?('conferenceId') ? hash['conferenceId'] : SKIP - name = hash.key?('name') ? hash['name'] : SKIP - event_type = hash.key?('eventType') ? hash['eventType'] : SKIP - event_time = hash.key?('eventTime') ? hash['eventTime'] : SKIP - tag = hash.key?('tag') ? hash['tag'] : SKIP - call_id = hash.key?('callId') ? hash['callId'] : SKIP - to = hash.key?('to') ? hash['to'] : SKIP - from = hash.key?('from') ? hash['from'] : SKIP - account_id = hash.key?('accountId') ? hash['accountId'] : SKIP - recording_id = hash.key?('recordingId') ? hash['recordingId'] : SKIP - channels = hash.key?('channels') ? hash['channels'] : SKIP - start_time = hash.key?('startTime') ? hash['startTime'] : SKIP - end_time = hash.key?('endTime') ? hash['endTime'] : SKIP - duration = hash.key?('duration') ? hash['duration'] : SKIP - file_format = hash.key?('fileFormat') ? hash['fileFormat'] : SKIP - media_url = hash.key?('mediaUrl') ? hash['mediaUrl'] : SKIP - status = hash.key?('status') ? hash['status'] : SKIP - - # Create object from extracted values. - ConferenceCallback.new(conference_id, - name, - event_type, - event_time, - tag, - call_id, - to, - from, - account_id, - recording_id, - channels, - start_time, - end_time, - duration, - file_format, - media_url, - status) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb b/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb deleted file mode 100644 index 5d1cdc6e..00000000 --- a/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # ConferenceEventMethod. - class ConferenceEventMethodEnum - CONFERENCE_EVENT_METHOD_ENUM = [ - # TODO: Write general description for POST - POST = 'POST'.freeze, - - # TODO: Write general description for GET - GET = 'GET'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/conference_member_state.rb b/lib/bandwidth/voice_lib/voice/models/conference_member_state.rb deleted file mode 100644 index c0822226..00000000 --- a/lib/bandwidth/voice_lib/voice/models/conference_member_state.rb +++ /dev/null @@ -1,103 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # ConferenceMemberState Model. - class ConferenceMemberState < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :call_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :conference_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :member_url - - # TODO: Write general description for this method - # @return [Boolean] - attr_accessor :mute - - # TODO: Write general description for this method - # @return [Boolean] - attr_accessor :hold - - # TODO: Write general description for this method - # @return [List of String] - attr_accessor :call_ids_to_coach - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['call_id'] = 'callId' - @_hash['conference_id'] = 'conferenceId' - @_hash['member_url'] = 'memberUrl' - @_hash['mute'] = 'mute' - @_hash['hold'] = 'hold' - @_hash['call_ids_to_coach'] = 'callIdsToCoach' - @_hash - end - - # An array for optional fields - def optionals - %w[ - call_id - conference_id - member_url - mute - hold - call_ids_to_coach - ] - end - - # An array for nullable fields - def nullables - %w[ - call_ids_to_coach - ] - end - - def initialize(call_id = nil, - conference_id = nil, - member_url = nil, - mute = nil, - hold = nil, - call_ids_to_coach = nil) - @call_id = call_id unless call_id == SKIP - @conference_id = conference_id unless conference_id == SKIP - @member_url = member_url unless member_url == SKIP - @mute = mute unless mute == SKIP - @hold = hold unless hold == SKIP - @call_ids_to_coach = call_ids_to_coach unless call_ids_to_coach == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - call_id = hash.key?('callId') ? hash['callId'] : SKIP - conference_id = hash.key?('conferenceId') ? hash['conferenceId'] : SKIP - member_url = hash.key?('memberUrl') ? hash['memberUrl'] : SKIP - mute = hash.key?('mute') ? hash['mute'] : SKIP - hold = hash.key?('hold') ? hash['hold'] : SKIP - call_ids_to_coach = - hash.key?('callIdsToCoach') ? hash['callIdsToCoach'] : SKIP - - # Create object from extracted values. - ConferenceMemberState.new(call_id, - conference_id, - member_url, - mute, - hold, - call_ids_to_coach) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb b/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb deleted file mode 100644 index 457cdc31..00000000 --- a/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb +++ /dev/null @@ -1,173 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'date' -module Bandwidth - # ConferenceRecordingMetadata Model. - class ConferenceRecordingMetadata < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :account_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :conference_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :name - - # TODO: Write general description for this method - # @return [String] - attr_accessor :recording_id - - # Format is ISO-8601 - # @return [String] - attr_accessor :duration - - # Format is ISO-8601 - # @return [Integer] - attr_accessor :channels - - # Format is ISO-8601 - # @return [DateTime] - attr_accessor :start_time - - # Format is ISO-8601 - # @return [DateTime] - attr_accessor :end_time - - # Format is ISO-8601 - # @return [FileFormatEnum] - attr_accessor :file_format - - # The current status of the recording. Current possible values are - # 'processing', 'partial', 'complete', 'deleted', and 'error'. Additional - # states may be added in the future, so your application must be tolerant of - # unknown values. - # @return [String] - attr_accessor :status - - # The current status of the recording. Current possible values are - # 'processing', 'partial', 'complete', 'deleted', and 'error'. Additional - # states may be added in the future, so your application must be tolerant of - # unknown values. - # @return [String] - attr_accessor :media_url - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['account_id'] = 'accountId' - @_hash['conference_id'] = 'conferenceId' - @_hash['name'] = 'name' - @_hash['recording_id'] = 'recordingId' - @_hash['duration'] = 'duration' - @_hash['channels'] = 'channels' - @_hash['start_time'] = 'startTime' - @_hash['end_time'] = 'endTime' - @_hash['file_format'] = 'fileFormat' - @_hash['status'] = 'status' - @_hash['media_url'] = 'mediaUrl' - @_hash - end - - # An array for optional fields - def optionals - %w[ - account_id - conference_id - name - recording_id - duration - channels - start_time - end_time - file_format - status - media_url - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(account_id = nil, - conference_id = nil, - name = nil, - recording_id = nil, - duration = nil, - channels = nil, - start_time = nil, - end_time = nil, - file_format = nil, - status = nil, - media_url = nil) - @account_id = account_id unless account_id == SKIP - @conference_id = conference_id unless conference_id == SKIP - @name = name unless name == SKIP - @recording_id = recording_id unless recording_id == SKIP - @duration = duration unless duration == SKIP - @channels = channels unless channels == SKIP - @start_time = start_time unless start_time == SKIP - @end_time = end_time unless end_time == SKIP - @file_format = file_format unless file_format == SKIP - @status = status unless status == SKIP - @media_url = media_url unless media_url == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - account_id = hash.key?('accountId') ? hash['accountId'] : SKIP - conference_id = hash.key?('conferenceId') ? hash['conferenceId'] : SKIP - name = hash.key?('name') ? hash['name'] : SKIP - recording_id = hash.key?('recordingId') ? hash['recordingId'] : SKIP - duration = hash.key?('duration') ? hash['duration'] : SKIP - channels = hash.key?('channels') ? hash['channels'] : SKIP - start_time = if hash.key?('startTime') - (DateTimeHelper.from_rfc3339(hash['startTime']) if hash['startTime']) - else - SKIP - end - end_time = if hash.key?('endTime') - (DateTimeHelper.from_rfc3339(hash['endTime']) if hash['endTime']) - else - SKIP - end - file_format = hash.key?('fileFormat') ? hash['fileFormat'] : SKIP - status = hash.key?('status') ? hash['status'] : SKIP - media_url = hash.key?('mediaUrl') ? hash['mediaUrl'] : SKIP - - # Create object from extracted values. - ConferenceRecordingMetadata.new(account_id, - conference_id, - name, - recording_id, - duration, - channels, - start_time, - end_time, - file_format, - status, - media_url) - end - - def to_start_time - DateTimeHelper.to_rfc3339(start_time) - end - - def to_end_time - DateTimeHelper.to_rfc3339(end_time) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/conference_state.rb b/lib/bandwidth/voice_lib/voice/models/conference_state.rb deleted file mode 100644 index 3a54c000..00000000 --- a/lib/bandwidth/voice_lib/voice/models/conference_state.rb +++ /dev/null @@ -1,153 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'date' -module Bandwidth - # ConferenceState Model. - class ConferenceState < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :name - - # TODO: Write general description for this method - # @return [DateTime] - attr_accessor :created_time - - # TODO: Write general description for this method - # @return [DateTime] - attr_accessor :completed_time - - # TODO: Write general description for this method - # @return [String] - attr_accessor :conference_event_url - - # TODO: Write general description for this method - # @return [ConferenceEventMethodEnum] - attr_accessor :conference_event_method - - # TODO: Write general description for this method - # @return [String] - attr_accessor :tag - - # TODO: Write general description for this method - # @return [List of ConferenceMemberState] - attr_accessor :active_members - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['id'] = 'id' - @_hash['name'] = 'name' - @_hash['created_time'] = 'createdTime' - @_hash['completed_time'] = 'completedTime' - @_hash['conference_event_url'] = 'conferenceEventUrl' - @_hash['conference_event_method'] = 'conferenceEventMethod' - @_hash['tag'] = 'tag' - @_hash['active_members'] = 'activeMembers' - @_hash - end - - # An array for optional fields - def optionals - %w[ - id - name - created_time - completed_time - conference_event_url - conference_event_method - tag - active_members - ] - end - - # An array for nullable fields - def nullables - %w[ - completed_time - conference_event_url - conference_event_method - tag - ] - end - - def initialize(id = nil, - name = nil, - created_time = nil, - completed_time = nil, - conference_event_url = nil, - conference_event_method = nil, - tag = nil, - active_members = nil) - @id = id unless id == SKIP - @name = name unless name == SKIP - @created_time = created_time unless created_time == SKIP - @completed_time = completed_time unless completed_time == SKIP - @conference_event_url = conference_event_url unless conference_event_url == SKIP - @conference_event_method = conference_event_method unless conference_event_method == SKIP - @tag = tag unless tag == SKIP - @active_members = active_members unless active_members == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - id = hash.key?('id') ? hash['id'] : SKIP - name = hash.key?('name') ? hash['name'] : SKIP - created_time = if hash.key?('createdTime') - (DateTimeHelper.from_rfc3339(hash['createdTime']) if hash['createdTime']) - else - SKIP - end - completed_time = if hash.key?('completedTime') - (DateTimeHelper.from_rfc3339(hash['completedTime']) if hash['completedTime']) - else - SKIP - end - conference_event_url = - hash.key?('conferenceEventUrl') ? hash['conferenceEventUrl'] : SKIP - conference_event_method = - hash.key?('conferenceEventMethod') ? hash['conferenceEventMethod'] : SKIP - tag = hash.key?('tag') ? hash['tag'] : SKIP - # Parameter is an array, so we need to iterate through it - active_members = nil - unless hash['activeMembers'].nil? - active_members = [] - hash['activeMembers'].each do |structure| - active_members << (ConferenceMemberState.from_hash(structure) if structure) - end - end - - active_members = SKIP unless hash.key?('activeMembers') - - # Create object from extracted values. - ConferenceState.new(id, - name, - created_time, - completed_time, - conference_event_url, - conference_event_method, - tag, - active_members) - end - - def to_created_time - DateTimeHelper.to_rfc3339(created_time) - end - - def to_completed_time - DateTimeHelper.to_rfc3339(completed_time) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/create_call_request.rb b/lib/bandwidth/voice_lib/voice/models/create_call_request.rb deleted file mode 100644 index 781e2aeb..00000000 --- a/lib/bandwidth/voice_lib/voice/models/create_call_request.rb +++ /dev/null @@ -1,236 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # CreateCallRequest Model. - class CreateCallRequest < BaseModel - SKIP = Object.new - private_constant :SKIP - - # Format is E164 - # @return [String] - attr_accessor :from - - # Format is E164 or SIP URI - # @return [String] - attr_accessor :to - - # 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 https://tools.ietf.org/html/rfc7433. Only 'jwt' and - # 'base64' encodings are allowed. The entire value cannot exceed 350 - # characters, including parameters and separators. - # @return [String] - attr_accessor :uui - - # @return [Float] - attr_accessor :call_timeout - - # @return [Float] - attr_accessor :callback_timeout - - # @return [String] - attr_accessor :answer_url - - # @return [String] - attr_accessor :answer_fallback_url - - # @return [String] - attr_accessor :username - - # @return [String] - attr_accessor :password - - # @return [String] - attr_accessor :fallback_username - - # @return [String] - attr_accessor :fallback_password - - # @return [AnswerMethodEnum] - attr_accessor :answer_method - - # @return [AnswerFallbackMethodEnum] - attr_accessor :answer_fallback_method - - # @return [String] - attr_accessor :disconnect_url - - # @return [DisconnectMethodEnum] - attr_accessor :disconnect_method - - # @return [String] - attr_accessor :tag - - # @return [String] - attr_accessor :application_id - - # @return [MachineDetectionRequest] - attr_accessor :machine_detection - - # @return [Integer] - attr_accessor :priority - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['from'] = 'from' - @_hash['to'] = 'to' - @_hash['uui'] = 'uui' - @_hash['call_timeout'] = 'callTimeout' - @_hash['callback_timeout'] = 'callbackTimeout' - @_hash['answer_url'] = 'answerUrl' - @_hash['answer_fallback_url'] = 'answerFallbackUrl' - @_hash['username'] = 'username' - @_hash['password'] = 'password' - @_hash['fallback_username'] = 'fallbackUsername' - @_hash['fallback_password'] = 'fallbackPassword' - @_hash['answer_method'] = 'answerMethod' - @_hash['answer_fallback_method'] = 'answerFallbackMethod' - @_hash['disconnect_url'] = 'disconnectUrl' - @_hash['disconnect_method'] = 'disconnectMethod' - @_hash['tag'] = 'tag' - @_hash['application_id'] = 'applicationId' - @_hash['machine_detection'] = 'machineDetection' - @_hash['priority'] = 'priority' - @_hash - end - - # An array for optional fields - def optionals - %w[ - uui - call_timeout - callback_timeout - answer_fallback_url - username - password - fallback_username - fallback_password - answer_method - answer_fallback_method - disconnect_url - disconnect_method - tag - machine_detection - priority - ] - end - - # An array for nullable fields - def nullables - %w[ - uui - call_timeout - callback_timeout - answer_fallback_url - username - password - fallback_username - fallback_password - answer_method - answer_fallback_method - disconnect_url - disconnect_method - tag - priority - ] - end - - def initialize(from = nil, - to = nil, - answer_url = nil, - application_id = nil, - uui = nil, - call_timeout = nil, - callback_timeout = nil, - answer_fallback_url = nil, - username = nil, - password = nil, - fallback_username = nil, - fallback_password = nil, - answer_method = nil, - answer_fallback_method = nil, - disconnect_url = nil, - disconnect_method = nil, - tag = nil, - machine_detection = nil, - priority = nil) - @from = from unless from == SKIP - @to = to unless to == SKIP - @uui = uui unless uui == SKIP - @call_timeout = call_timeout unless call_timeout == SKIP - @callback_timeout = callback_timeout unless callback_timeout == SKIP - @answer_url = answer_url unless answer_url == SKIP - @answer_fallback_url = answer_fallback_url unless answer_fallback_url == SKIP - @username = username unless username == SKIP - @password = password unless password == SKIP - @fallback_username = fallback_username unless fallback_username == SKIP - @fallback_password = fallback_password unless fallback_password == SKIP - @answer_method = answer_method unless answer_method == SKIP - @answer_fallback_method = answer_fallback_method unless answer_fallback_method == SKIP - @disconnect_url = disconnect_url unless disconnect_url == SKIP - @disconnect_method = disconnect_method unless disconnect_method == SKIP - @tag = tag unless tag == SKIP - @application_id = application_id unless application_id == SKIP - @machine_detection = machine_detection unless machine_detection == SKIP - @priority = priority unless priority == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - from = hash.key?('from') ? hash['from'] : SKIP - to = hash.key?('to') ? hash['to'] : SKIP - answer_url = hash.key?('answerUrl') ? hash['answerUrl'] : SKIP - application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP - uui = hash.key?('uui') ? hash['uui'] : SKIP - call_timeout = hash.key?('callTimeout') ? hash['callTimeout'] : SKIP - callback_timeout = - hash.key?('callbackTimeout') ? hash['callbackTimeout'] : SKIP - answer_fallback_url = - hash.key?('answerFallbackUrl') ? hash['answerFallbackUrl'] : SKIP - username = hash.key?('username') ? hash['username'] : SKIP - password = hash.key?('password') ? hash['password'] : SKIP - fallback_username = - hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP - fallback_password = - hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP - answer_method = hash.key?('answerMethod') ? hash['answerMethod'] : SKIP - answer_fallback_method = - hash.key?('answerFallbackMethod') ? hash['answerFallbackMethod'] : SKIP - disconnect_url = hash.key?('disconnectUrl') ? hash['disconnectUrl'] : SKIP - disconnect_method = - hash.key?('disconnectMethod') ? hash['disconnectMethod'] : SKIP - tag = hash.key?('tag') ? hash['tag'] : SKIP - machine_detection = MachineDetectionConfiguration.from_hash(hash['machineDetection']) if - hash['machineDetection'] - priority = hash.key?('priority') ? hash['priority'] : SKIP - - # Create object from extracted values. - CreateCallRequest.new(from, - to, - answer_url, - application_id, - uui, - call_timeout, - callback_timeout, - answer_fallback_url, - username, - password, - fallback_username, - fallback_password, - answer_method, - answer_fallback_method, - disconnect_url, - disconnect_method, - tag, - machine_detection, - priority) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/create_call_response.rb b/lib/bandwidth/voice_lib/voice/models/create_call_response.rb deleted file mode 100644 index 7c455484..00000000 --- a/lib/bandwidth/voice_lib/voice/models/create_call_response.rb +++ /dev/null @@ -1,266 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'date' -module Bandwidth - # CreateCallResponse Model. - class CreateCallResponse < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :account_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :call_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :application_id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :to - - # TODO: Write general description for this method - # @return [String] - attr_accessor :from - - # TODO: Write general description for this method - # @return [DateTime] - attr_accessor :enqueued_time - - # TODO: Write general description for this method - # @return [String] - attr_accessor :call_url - - # TODO: Write general description for this method - # @return [Float] - attr_accessor :call_timeout - - # TODO: Write general description for this method - # @return [Float] - attr_accessor :callback_timeout - - # TODO: Write general description for this method - # @return [String] - attr_accessor :answer_url - - # TODO: Write general description for this method - # @return [AnswerMethodEnum] - attr_accessor :answer_method - - # TODO: Write general description for this method - # @return [String] - attr_accessor :answer_fallback_url - - # TODO: Write general description for this method - # @return [AnswerFallbackMethodEnum] - attr_accessor :answer_fallback_method - - # TODO: Write general description for this method - # @return [String] - attr_accessor :disconnect_url - - # TODO: Write general description for this method - # @return [DisconnectMethodEnum] - attr_accessor :disconnect_method - - # TODO: Write general description for this method - # @return [String] - attr_accessor :username - - # TODO: Write general description for this method - # @return [String] - attr_accessor :password - - # TODO: Write general description for this method - # @return [String] - attr_accessor :fallback_username - - # TODO: Write general description for this method - # @return [String] - attr_accessor :fallback_password - - # TODO: Write general description for this method - # @return [String] - attr_accessor :tag - - # @return [Integer] - attr_accessor :priority - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['account_id'] = 'accountId' - @_hash['call_id'] = 'callId' - @_hash['application_id'] = 'applicationId' - @_hash['to'] = 'to' - @_hash['from'] = 'from' - @_hash['enqueued_time'] = 'enqueuedTime ' - @_hash['call_url'] = 'callUrl' - @_hash['call_timeout'] = 'callTimeout' - @_hash['callback_timeout'] = 'callbackTimeout' - @_hash['answer_url'] = 'answerUrl' - @_hash['answer_method'] = 'answerMethod' - @_hash['answer_fallback_url'] = 'answerFallbackUrl' - @_hash['answer_fallback_method'] = 'answerFallbackMethod' - @_hash['disconnect_url'] = 'disconnectUrl' - @_hash['disconnect_method'] = 'disconnectMethod' - @_hash['username'] = 'username' - @_hash['password'] = 'password' - @_hash['fallback_username'] = 'fallbackUsername' - @_hash['fallback_password'] = 'fallbackPassword' - @_hash['tag'] = 'tag' - @_hash['priority'] = 'priority' - @_hash - end - - # An array for optional fields - def optionals - %w[ - enqueued_time - call_timeout - callback_timeout - answer_fallback_url - answer_fallback_method - disconnect_url - username - password - fallback_username - fallback_password - tag - priority - ] - end - - # An array for nullable fields - def nullables - %w[ - answer_fallback_url - answer_fallback_method - disconnect_url - disconnect_method - username - password - fallback_username - fallback_password - tag - priority - ] - end - - def initialize(account_id = nil, - call_id = nil, - application_id = nil, - to = nil, - from = nil, - call_url = nil, - answer_url = nil, - answer_method = nil, - disconnect_method = nil, - enqueued_time = nil, - call_timeout = nil, - callback_timeout = nil, - answer_fallback_url = nil, - answer_fallback_method = nil, - disconnect_url = nil, - username = nil, - password = nil, - fallback_username = nil, - fallback_password = nil, - tag = nil, - priority = nil) - @account_id = account_id unless account_id == SKIP - @call_id = call_id unless call_id == SKIP - @application_id = application_id unless application_id == SKIP - @to = to unless to == SKIP - @from = from unless from == SKIP - @enqueued_time = enqueued_time unless enqueued_time == SKIP - @call_url = call_url unless call_url == SKIP - @call_timeout = call_timeout unless call_timeout == SKIP - @callback_timeout = callback_timeout unless callback_timeout == SKIP - @answer_url = answer_url unless answer_url == SKIP - @answer_method = answer_method unless answer_method == SKIP - @answer_fallback_url = answer_fallback_url unless answer_fallback_url == SKIP - @answer_fallback_method = answer_fallback_method unless answer_fallback_method == SKIP - @disconnect_url = disconnect_url unless disconnect_url == SKIP - @disconnect_method = disconnect_method unless disconnect_method == SKIP - @username = username unless username == SKIP - @password = password unless password == SKIP - @fallback_username = fallback_username unless fallback_username == SKIP - @fallback_password = fallback_password unless fallback_password == SKIP - @tag = tag unless tag == SKIP - @priority = priority unless priority == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - account_id = hash.key?('accountId') ? hash['accountId'] : SKIP - call_id = hash.key?('callId') ? hash['callId'] : SKIP - application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP - to = hash.key?('to') ? hash['to'] : SKIP - from = hash.key?('from') ? hash['from'] : SKIP - call_url = hash.key?('callUrl') ? hash['callUrl'] : SKIP - answer_url = hash.key?('answerUrl') ? hash['answerUrl'] : SKIP - answer_method = hash.key?('answerMethod') ? hash['answerMethod'] : SKIP - disconnect_method = - hash.key?('disconnectMethod') ? hash['disconnectMethod'] : SKIP - enqueued_time = if hash.key?('enqueuedTime') - (DateTimeHelper.from_rfc3339(hash['enqueuedTime']) if hash['enqueuedTime']) - else - SKIP - end - call_timeout = hash.key?('callTimeout') ? hash['callTimeout'] : SKIP - callback_timeout = - hash.key?('callbackTimeout') ? hash['callbackTimeout'] : SKIP - answer_fallback_url = - hash.key?('answerFallbackUrl') ? hash['answerFallbackUrl'] : SKIP - answer_fallback_method = - hash.key?('answerFallbackMethod') ? hash['answerFallbackMethod'] : SKIP - disconnect_url = hash.key?('disconnectUrl') ? hash['disconnectUrl'] : SKIP - username = hash.key?('username') ? hash['username'] : SKIP - password = hash.key?('password') ? hash['password'] : SKIP - fallback_username = - hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP - fallback_password = - hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP - tag = hash.key?('tag') ? hash['tag'] : SKIP - priority = hash.key?('priority') ? hash['priority'] : SKIP - - # Create object from extracted values. - CreateCallResponse.new(account_id, - call_id, - application_id, - to, - from, - call_url, - answer_url, - answer_method, - disconnect_method, - enqueued_time, - call_timeout, - callback_timeout, - answer_fallback_url, - answer_fallback_method, - disconnect_url, - username, - password, - fallback_username, - fallback_password, - tag, - priority) - end - - def to_enqueued_time - DateTimeHelper.to_rfc3339(enqueued_time) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/direction_enum.rb b/lib/bandwidth/voice_lib/voice/models/direction_enum.rb deleted file mode 100644 index 3af4a481..00000000 --- a/lib/bandwidth/voice_lib/voice/models/direction_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Direction. - class DirectionEnum - DIRECTION_ENUM = [ - # TODO: Write general description for INBOUND - INBOUND = 'inbound'.freeze, - - # TODO: Write general description for OUTBOUND - OUTBOUND = 'outbound'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb b/lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb deleted file mode 100644 index 7e896077..00000000 --- a/lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # DisconnectMethod. - class DisconnectMethodEnum - DISCONNECT_METHOD_ENUM = [ - # TODO: Write general description for POST - POST = 'POST'.freeze, - - # TODO: Write general description for GET - GET = 'GET'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/diversion.rb b/lib/bandwidth/voice_lib/voice/models/diversion.rb deleted file mode 100644 index c0b67009..00000000 --- a/lib/bandwidth/voice_lib/voice/models/diversion.rb +++ /dev/null @@ -1,80 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Diversion Model. - class Diversion < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :reason - - # TODO: Write general description for this method - # @return [String] - attr_accessor :privacy - - # TODO: Write general description for this method - # @return [String] - attr_accessor :unknown - - # TODO: Write general description for this method - # @return [String] - attr_accessor :orig_to - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['reason'] = 'reason' - @_hash['privacy'] = 'privacy' - @_hash['unknown'] = 'unknown' - @_hash['orig_to'] = 'origTo' - @_hash - end - - # An array for optional fields - def optionals - %w[ - reason - privacy - unknown - orig_to - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(reason = nil, - privacy = nil, - unknown = nil, - orig_to = nil) - @reason = reason unless reason == SKIP - @privacy = privacy unless privacy == SKIP - @unknown = unknown unless unknown == SKIP - @orig_to = orig_to unless orig_to == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - reason = hash.key?('reason') ? hash['reason'] : SKIP - privacy = hash.key?('privacy') ? hash['privacy'] : SKIP - unknown = hash.key?('unknown') ? hash['unknown'] : SKIP - orig_to = hash.key?('origTo') ? hash['origTo'] : SKIP - - # Create object from extracted values. - Diversion.new(reason, - privacy, - unknown, - orig_to) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/fallback_method_enum.rb b/lib/bandwidth/voice_lib/voice/models/fallback_method_enum.rb deleted file mode 100644 index fbd22ffe..00000000 --- a/lib/bandwidth/voice_lib/voice/models/fallback_method_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # FallbackMethod. - class FallbackMethodEnum - FALLBACK_METHOD_ENUM = [ - # TODO: Write general description for POST - POST = 'POST'.freeze, - - # TODO: Write general description for GET - GET = 'GET'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/file_format_enum.rb b/lib/bandwidth/voice_lib/voice/models/file_format_enum.rb deleted file mode 100644 index 745edaf2..00000000 --- a/lib/bandwidth/voice_lib/voice/models/file_format_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # FileFormat. - class FileFormatEnum - FILE_FORMAT_ENUM = [ - # TODO: Write general description for MP3 - MP3 = 'mp3'.freeze, - - # TODO: Write general description for WAV - WAV = 'wav'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/machine_detection_configuration.rb b/lib/bandwidth/voice_lib/voice/models/machine_detection_configuration.rb deleted file mode 100644 index db90c40e..00000000 --- a/lib/bandwidth/voice_lib/voice/models/machine_detection_configuration.rb +++ /dev/null @@ -1,231 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # MachineDetectionConfiguration Model. - class MachineDetectionConfiguration < BaseModel - SKIP = Object.new - private_constant :SKIP - - # 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. Default is 'async'. - # @return [ModeEnum] - attr_accessor :mode - - # Total amount of time (in seconds) before giving up. - # @return [Float] - attr_accessor :detection_timeout - - # If no speech is detected in this period, a callback with a 'silence' - # result is sent. Default is 10 seconds. - # @return [Float] - attr_accessor :silence_timeout - - # 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'. Default is 10 seconds. - # @return [Float] - attr_accessor :speech_threshold - - # Amount of silence (in seconds) before assuming the callee has finished - # speaking. - # @return [Float] - attr_accessor :speech_end_threshold - - # 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 until the 'detectionTimeout' is exceeded. If false, the - # 'answering-machine' result is sent immediately. Default is 'false'. - # @return [Boolean] - attr_accessor :delay_result - - # The URL to send the 'machineDetectionComplete' callback when the detection - # is completed. Only for 'async' mode. - # @return [String] - attr_accessor :callback_url - - # The URL to send the 'machineDetectionComplete' callback when the detection - # is completed. Only for 'async' mode. - # @return [CallbackMethodEnum] - attr_accessor :callback_method - - # The URL to send the 'machineDetectionComplete' callback when the detection - # is completed. Only for 'async' mode. - # @return [String] - attr_accessor :fallback_url - - # The URL to send the 'machineDetectionComplete' callback when the detection - # is completed. Only for 'async' mode. - # @return [FallbackMethodEnum] - attr_accessor :fallback_method - - # The URL to send the 'machineDetectionComplete' callback when the detection - # is completed. Only for 'async' mode. - # @return [String] - attr_accessor :username - - # The URL to send the 'machineDetectionComplete' callback when the detection - # is completed. Only for 'async' mode. - # @return [String] - attr_accessor :password - - # The URL to send the 'machineDetectionComplete' callback when the detection - # is completed. Only for 'async' mode. - # @return [String] - attr_accessor :fallback_username - - # The URL to send the 'machineDetectionComplete' callback when the detection - # is completed. Only for 'async' mode. - # @return [String] - attr_accessor :fallback_password - - # When an answering machine is detected, the amount of silence (in seconds) - # before assuming the message has finished playing. - # return [Float] - attr_accessor :machine_speech_end_threshold - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['mode'] = 'mode' - @_hash['detection_timeout'] = 'detectionTimeout' - @_hash['silence_timeout'] = 'silenceTimeout' - @_hash['speech_threshold'] = 'speechThreshold' - @_hash['speech_end_threshold'] = 'speechEndThreshold' - @_hash['delay_result'] = 'delayResult' - @_hash['callback_url'] = 'callbackUrl' - @_hash['callback_method'] = 'callbackMethod' - @_hash['fallback_url'] = 'fallbackUrl' - @_hash['fallback_method'] = 'fallbackMethod' - @_hash['username'] = 'username' - @_hash['password'] = 'password' - @_hash['fallback_username'] = 'fallbackUsername' - @_hash['fallback_password'] = 'fallbackPassword' - @_hash['machine_speech_end_threshold'] = 'machineSpeechEndThreshold' - @_hash - end - - # An array for optional fields - def optionals - %w[ - mode - detection_timeout - silence_timeout - speech_threshold - speech_end_threshold - delay_result - callback_url - callback_method - fallback_url - fallback_method - username - password - fallback_username - fallback_password - machine_speech_end_threshold - ] - end - - # An array for nullable fields - def nullables - %w[ - callback_url - callback_method - fallback_url - fallback_method - username - password - fallback_username - fallback_password - machine_speech_end_threshold - ] - end - - def initialize(mode = nil, - detection_timeout = nil, - silence_timeout = nil, - speech_threshold = nil, - speech_end_threshold = nil, - delay_result = nil, - callback_url = nil, - callback_method = nil, - fallback_url = nil, - fallback_method = nil, - username = nil, - password = nil, - fallback_username = nil, - fallback_password = nil, - machine_speech_end_threshold = nil) - @mode = mode unless mode == SKIP - @detection_timeout = detection_timeout unless detection_timeout == SKIP - @silence_timeout = silence_timeout unless silence_timeout == SKIP - @speech_threshold = speech_threshold unless speech_threshold == SKIP - @speech_end_threshold = speech_end_threshold unless speech_end_threshold == SKIP - @delay_result = delay_result unless delay_result == SKIP - @callback_url = callback_url unless callback_url == SKIP - @callback_method = callback_method unless callback_method == SKIP - @fallback_url = fallback_url unless fallback_url == SKIP - @fallback_method = fallback_method unless fallback_method == SKIP - @username = username unless username == SKIP - @password = password unless password == SKIP - @fallback_username = fallback_username unless fallback_username == SKIP - @fallback_password = fallback_password unless fallback_password == SKIP - @machine_speech_end_threshold = machine_speech_end_threshold unless machine_speech_end_threshold == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - mode = hash.key?('mode') ? hash['mode'] : SKIP - detection_timeout = - hash.key?('detectionTimeout') ? hash['detectionTimeout'] : SKIP - silence_timeout = - hash.key?('silenceTimeout') ? hash['silenceTimeout'] : SKIP - speech_threshold = - hash.key?('speechThreshold') ? hash['speechThreshold'] : SKIP - speech_end_threshold = - hash.key?('speechEndThreshold') ? hash['speechEndThreshold'] : SKIP - delay_result = hash.key?('delayResult') ? hash['delayResult'] : SKIP - callback_url = hash.key?('callbackUrl') ? hash['callbackUrl'] : SKIP - callback_method = - hash.key?('callbackMethod') ? hash['callbackMethod'] : SKIP - fallback_url = hash.key?('fallbackUrl') ? hash['fallbackUrl'] : SKIP - fallback_method = - hash.key?('fallbackMethod') ? hash['fallbackMethod'] : SKIP - username = hash.key?('username') ? hash['username'] : SKIP - password = hash.key?('password') ? hash['password'] : SKIP - fallback_username = - hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP - fallback_password = - hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP - machine_speech_end_threshold = - hash.key?('machineSpeechEndThreshold') ? hash['machineSpeechEndThreshold'] : SKIP - - # Create object from extracted values. - MachineDetectionConfiguration.new(mode, - detection_timeout, - silence_timeout, - speech_threshold, - speech_end_threshold, - delay_result, - callback_url, - callback_method, - fallback_url, - fallback_method, - username, - password, - fallback_username, - fallback_password, - machine_speech_end_threshold) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/mode_enum.rb b/lib/bandwidth/voice_lib/voice/models/mode_enum.rb deleted file mode 100644 index 680bd2a9..00000000 --- a/lib/bandwidth/voice_lib/voice/models/mode_enum.rb +++ /dev/null @@ -1,20 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # 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. Default is 'async'. - class ModeEnum - MODE_ENUM = [ - # TODO: Write general description for SYNC - SYNC = 'sync'.freeze, - - # TODO: Write general description for ASYNC - ASYNC = 'async'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/modify_call_recording_request.rb b/lib/bandwidth/voice_lib/voice/models/modify_call_recording_request.rb deleted file mode 100644 index d3751b06..00000000 --- a/lib/bandwidth/voice_lib/voice/models/modify_call_recording_request.rb +++ /dev/null @@ -1,48 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # ModifyCallRecordingRequest Model. - class ModifyCallRecordingRequest < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [State1Enum] - attr_accessor :state - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['state'] = 'state' - @_hash - end - - # An array for optional fields - def optionals - [] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(state = nil) - @state = state unless state == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - state = hash.key?('state') ? hash['state'] : SKIP - - # Create object from extracted values. - ModifyCallRecordingRequest.new(state) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/modify_call_request.rb b/lib/bandwidth/voice_lib/voice/models/modify_call_request.rb deleted file mode 100644 index 7b5438b1..00000000 --- a/lib/bandwidth/voice_lib/voice/models/modify_call_request.rb +++ /dev/null @@ -1,156 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # ModifyCallRequest Model. - class ModifyCallRequest < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [StateEnum] - attr_accessor :state - - # Required if state is 'active' - # @return [String] - attr_accessor :redirect_url - - # Required if state is 'active' - # @return [String] - attr_accessor :redirect_fallback_url - - # Required if state is 'active' - # @return [RedirectMethodEnum] - attr_accessor :redirect_method - - # Required if state is 'active' - # @return [RedirectFallbackMethodEnum] - attr_accessor :redirect_fallback_method - - # Required if state is 'active' - # @return [String] - attr_accessor :username - - # Required if state is 'active' - # @return [String] - attr_accessor :password - - # Required if state is 'active' - # @return [String] - attr_accessor :fallback_username - - # Required if state is 'active' - # @return [String] - attr_accessor :fallback_password - - # Required if state is 'active' - # @return [String] - attr_accessor :tag - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['state'] = 'state' - @_hash['redirect_url'] = 'redirectUrl' - @_hash['redirect_fallback_url'] = 'redirectFallbackUrl' - @_hash['redirect_method'] = 'redirectMethod' - @_hash['redirect_fallback_method'] = 'redirectFallbackMethod' - @_hash['username'] = 'username' - @_hash['password'] = 'password' - @_hash['fallback_username'] = 'fallbackUsername' - @_hash['fallback_password'] = 'fallbackPassword' - @_hash['tag'] = 'tag' - @_hash - end - - # An array for optional fields - def optionals - %w[ - state - redirect_url - redirect_fallback_url - redirect_method - redirect_fallback_method - username - password - fallback_username - fallback_password - tag - ] - end - - # An array for nullable fields - def nullables - %w[ - state - redirect_url - redirect_fallback_url - redirect_method - redirect_fallback_method - username - password - fallback_username - fallback_password - tag - ] - end - - def initialize(state = StateEnum::ACTIVE, - redirect_url = nil, - redirect_fallback_url = nil, - redirect_method = nil, - redirect_fallback_method = nil, - username = nil, - password = nil, - fallback_username = nil, - fallback_password = nil, - tag = nil) - @state = state unless state == SKIP - @redirect_url = redirect_url unless redirect_url == SKIP - @redirect_fallback_url = redirect_fallback_url unless redirect_fallback_url == SKIP - @redirect_method = redirect_method unless redirect_method == SKIP - @redirect_fallback_method = redirect_fallback_method unless redirect_fallback_method == SKIP - @username = username unless username == SKIP - @password = password unless password == SKIP - @fallback_username = fallback_username unless fallback_username == SKIP - @fallback_password = fallback_password unless fallback_password == SKIP - @tag = tag unless tag == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - state = hash['state'] ||= StateEnum::ACTIVE - redirect_url = hash.key?('redirectUrl') ? hash['redirectUrl'] : SKIP - redirect_fallback_url = - hash.key?('redirectFallbackUrl') ? hash['redirectFallbackUrl'] : SKIP - redirect_method = - hash.key?('redirectMethod') ? hash['redirectMethod'] : SKIP - redirect_fallback_method = - hash.key?('redirectFallbackMethod') ? hash['redirectFallbackMethod'] : SKIP - username = hash.key?('username') ? hash['username'] : SKIP - password = hash.key?('password') ? hash['password'] : SKIP - fallback_username = - hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP - fallback_password = - hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP - tag = hash.key?('tag') ? hash['tag'] : SKIP - - # Create object from extracted values. - ModifyCallRequest.new(state, - redirect_url, - redirect_fallback_url, - redirect_method, - redirect_fallback_method, - username, - password, - fallback_username, - fallback_password, - tag) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/modify_conference_request.rb b/lib/bandwidth/voice_lib/voice/models/modify_conference_request.rb deleted file mode 100644 index 5fb49ab1..00000000 --- a/lib/bandwidth/voice_lib/voice/models/modify_conference_request.rb +++ /dev/null @@ -1,144 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # ModifyConferenceRequest Model. - class ModifyConferenceRequest < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [StatusEnum] - attr_accessor :status - - # TODO: Write general description for this method - # @return [String] - attr_accessor :redirect_url - - # TODO: Write general description for this method - # @return [String] - attr_accessor :redirect_fallback_url - - # TODO: Write general description for this method - # @return [RedirectMethodEnum] - attr_accessor :redirect_method - - # TODO: Write general description for this method - # @return [RedirectFallbackMethodEnum] - attr_accessor :redirect_fallback_method - - # TODO: Write general description for this method - # @return [String] - attr_accessor :username - - # TODO: Write general description for this method - # @return [String] - attr_accessor :password - - # TODO: Write general description for this method - # @return [String] - attr_accessor :fallback_username - - # TODO: Write general description for this method - # @return [String] - attr_accessor :fallback_password - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['status'] = 'status' - @_hash['redirect_url'] = 'redirectUrl' - @_hash['redirect_fallback_url'] = 'redirectFallbackUrl' - @_hash['redirect_method'] = 'redirectMethod' - @_hash['redirect_fallback_method'] = 'redirectFallbackMethod' - @_hash['username'] = 'username' - @_hash['password'] = 'password' - @_hash['fallback_username'] = 'fallbackUsername' - @_hash['fallback_password'] = 'fallbackPassword' - @_hash - end - - # An array for optional fields - def optionals - %w[ - status - redirect_url - redirect_fallback_url - redirect_method - redirect_fallback_method - username - password - fallback_username - fallback_password - ] - end - - # An array for nullable fields - def nullables - %w[ - redirect_url - redirect_fallback_url - redirect_method - redirect_fallback_method - username - password - fallback_username - fallback_password - ] - end - - def initialize(status = nil, - redirect_url = nil, - redirect_fallback_url = nil, - redirect_method = nil, - redirect_fallback_method = nil, - username = nil, - password = nil, - fallback_username = nil, - fallback_password = nil) - @status = status unless status == SKIP - @redirect_url = redirect_url unless redirect_url == SKIP - @redirect_fallback_url = redirect_fallback_url unless redirect_fallback_url == SKIP - @redirect_method = redirect_method unless redirect_method == SKIP - @redirect_fallback_method = redirect_fallback_method unless redirect_fallback_method == SKIP - @username = username unless username == SKIP - @password = password unless password == SKIP - @fallback_username = fallback_username unless fallback_username == SKIP - @fallback_password = fallback_password unless fallback_password == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - status = hash.key?('status') ? hash['status'] : SKIP - redirect_url = hash.key?('redirectUrl') ? hash['redirectUrl'] : SKIP - redirect_fallback_url = - hash.key?('redirectFallbackUrl') ? hash['redirectFallbackUrl'] : SKIP - redirect_method = - hash.key?('redirectMethod') ? hash['redirectMethod'] : SKIP - redirect_fallback_method = - hash.key?('redirectFallbackMethod') ? hash['redirectFallbackMethod'] : SKIP - username = hash.key?('username') ? hash['username'] : SKIP - password = hash.key?('password') ? hash['password'] : SKIP - fallback_username = - hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP - fallback_password = - hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP - - # Create object from extracted values. - ModifyConferenceRequest.new(status, - redirect_url, - redirect_fallback_url, - redirect_method, - redirect_fallback_method, - username, - password, - fallback_username, - fallback_password) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/redirect_fallback_method_enum.rb b/lib/bandwidth/voice_lib/voice/models/redirect_fallback_method_enum.rb deleted file mode 100644 index 606beea0..00000000 --- a/lib/bandwidth/voice_lib/voice/models/redirect_fallback_method_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # RedirectFallbackMethod. - class RedirectFallbackMethodEnum - REDIRECT_FALLBACK_METHOD_ENUM = [ - # TODO: Write general description for POST - POST = 'POST'.freeze, - - # TODO: Write general description for GET - GET = 'GET'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb b/lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb deleted file mode 100644 index e4d798f4..00000000 --- a/lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # RedirectMethod. - class RedirectMethodEnum - REDIRECT_METHOD_ENUM = [ - # TODO: Write general description for POST - POST = 'POST'.freeze, - - # TODO: Write general description for GET - GET = 'GET'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/state1_enum.rb b/lib/bandwidth/voice_lib/voice/models/state1_enum.rb deleted file mode 100644 index c23a7d00..00000000 --- a/lib/bandwidth/voice_lib/voice/models/state1_enum.rb +++ /dev/null @@ -1,20 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # State1. - class State1Enum - STATE1_ENUM = [ - # TODO: Write general description for NOT_RECORDING - NOT_RECORDING = 'NOT_RECORDING'.freeze, - - # TODO: Write general description for PAUSED - PAUSED = 'PAUSED'.freeze, - - # TODO: Write general description for RECORDING - RECORDING = 'RECORDING'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/state_enum.rb b/lib/bandwidth/voice_lib/voice/models/state_enum.rb deleted file mode 100644 index da8ed33e..00000000 --- a/lib/bandwidth/voice_lib/voice/models/state_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # State. - class StateEnum - STATE_ENUM = [ - # TODO: Write general description for ACTIVE - ACTIVE = 'active'.freeze, - - # TODO: Write general description for COMPLETED - COMPLETED = 'completed'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/status_enum.rb b/lib/bandwidth/voice_lib/voice/models/status_enum.rb deleted file mode 100644 index cd7e9ba6..00000000 --- a/lib/bandwidth/voice_lib/voice/models/status_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Status. - class StatusEnum - STATUS_ENUM = [ - # TODO: Write general description for ACTIVE - ACTIVE = 'active'.freeze, - - # TODO: Write general description for COMPLETED - COMPLETED = 'completed'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/transcribe_recording_request.rb b/lib/bandwidth/voice_lib/voice/models/transcribe_recording_request.rb deleted file mode 100644 index d07c4d09..00000000 --- a/lib/bandwidth/voice_lib/voice/models/transcribe_recording_request.rb +++ /dev/null @@ -1,108 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # TranscribeRecordingRequest Model. - class TranscribeRecordingRequest < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :callback_url - - # TODO: Write general description for this method - # @return [CallbackMethodEnum] - attr_accessor :callback_method - - # TODO: Write general description for this method - # @return [String] - attr_accessor :username - - # TODO: Write general description for this method - # @return [String] - attr_accessor :password - - # TODO: Write general description for this method - # @return [String] - attr_accessor :tag - - # TODO: Write general description for this method - # @return [Float] - attr_accessor :callback_timeout - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['callback_url'] = 'callbackUrl' - @_hash['callback_method'] = 'callbackMethod' - @_hash['username'] = 'username' - @_hash['password'] = 'password' - @_hash['tag'] = 'tag' - @_hash['callback_timeout'] = 'callbackTimeout' - @_hash - end - - # An array for optional fields - def optionals - %w[ - callback_url - callback_method - username - password - tag - callback_timeout - ] - end - - # An array for nullable fields - def nullables - %w[ - callback_method - username - password - tag - callback_timeout - ] - end - - def initialize(callback_url = nil, - callback_method = nil, - username = nil, - password = nil, - tag = nil, - callback_timeout = nil) - @callback_url = callback_url unless callback_url == SKIP - @callback_method = callback_method unless callback_method == SKIP - @username = username unless username == SKIP - @password = password unless password == SKIP - @tag = tag unless tag == SKIP - @callback_timeout = callback_timeout unless callback_timeout == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - callback_url = hash.key?('callbackUrl') ? hash['callbackUrl'] : SKIP - callback_method = - hash.key?('callbackMethod') ? hash['callbackMethod'] : SKIP - username = hash.key?('username') ? hash['username'] : SKIP - password = hash.key?('password') ? hash['password'] : SKIP - tag = hash.key?('tag') ? hash['tag'] : SKIP - callback_timeout = - hash.key?('callbackTimeout') ? hash['callbackTimeout'] : SKIP - - # Create object from extracted values. - TranscribeRecordingRequest.new(callback_url, - callback_method, - username, - password, - tag, - callback_timeout) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/transcript.rb b/lib/bandwidth/voice_lib/voice/models/transcript.rb deleted file mode 100644 index 403789b4..00000000 --- a/lib/bandwidth/voice_lib/voice/models/transcript.rb +++ /dev/null @@ -1,60 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Transcript Model. - class Transcript < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :text - - # TODO: Write general description for this method - # @return [Float] - attr_accessor :confidence - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['text'] = 'text' - @_hash['confidence'] = 'confidence' - @_hash - end - - # An array for optional fields - def optionals - %w[ - text - confidence - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(text = nil, - confidence = nil) - @text = text unless text == SKIP - @confidence = confidence unless confidence == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - text = hash.key?('text') ? hash['text'] : SKIP - confidence = hash.key?('confidence') ? hash['confidence'] : SKIP - - # Create object from extracted values. - Transcript.new(text, - confidence) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/transcription.rb b/lib/bandwidth/voice_lib/voice/models/transcription.rb deleted file mode 100644 index 0d756678..00000000 --- a/lib/bandwidth/voice_lib/voice/models/transcription.rb +++ /dev/null @@ -1,80 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Transcription Model. - class Transcription < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :id - - # TODO: Write general description for this method - # @return [String] - attr_accessor :url - - # TODO: Write general description for this method - # @return [String] - attr_accessor :status - - # TODO: Write general description for this method - # @return [String] - attr_accessor :completed_time - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['id'] = 'id' - @_hash['url'] = 'url' - @_hash['status'] = 'status' - @_hash['completed_time'] = 'completedTime' - @_hash - end - - # An array for optional fields - def optionals - %w[ - id - url - status - completed_time - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(id = nil, - url = nil, - status = nil, - completed_time = nil) - @id = id unless id == SKIP - @url = url unless url == SKIP - @status = status unless status == SKIP - @completed_time = completed_time unless completed_time == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - id = hash.key?('id') ? hash['id'] : SKIP - url = hash.key?('url') ? hash['url'] : SKIP - status = hash.key?('status') ? hash['status'] : SKIP - completed_time = hash.key?('completedTime') ? hash['completedTime'] : SKIP - - # Create object from extracted values. - Transcription.new(id, - url, - status, - completed_time) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb b/lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb deleted file mode 100644 index 354d3c81..00000000 --- a/lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb +++ /dev/null @@ -1,89 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # TranscriptionMetadata Model. - class TranscriptionMetadata < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [String] - attr_accessor :id - - # The current status of the transcription. Current 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. - # @return [String] - attr_accessor :status - - # The current status of the transcription. Current 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. - # @return [String] - attr_accessor :completed_time - - # The current status of the transcription. Current 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. - # @return [String] - attr_accessor :url - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['id'] = 'id' - @_hash['status'] = 'status' - @_hash['completed_time'] = 'completedTime' - @_hash['url'] = 'url' - @_hash - end - - # An array for optional fields - def optionals - %w[ - id - status - completed_time - url - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(id = nil, - status = nil, - completed_time = nil, - url = nil) - @id = id unless id == SKIP - @status = status unless status == SKIP - @completed_time = completed_time unless completed_time == SKIP - @url = url unless url == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - id = hash.key?('id') ? hash['id'] : SKIP - status = hash.key?('status') ? hash['status'] : SKIP - completed_time = hash.key?('completedTime') ? hash['completedTime'] : SKIP - url = hash.key?('url') ? hash['url'] : SKIP - - # Create object from extracted values. - TranscriptionMetadata.new(id, - status, - completed_time, - url) - end - end -end diff --git a/lib/bandwidth/voice_lib/voice/models/transcription_response.rb b/lib/bandwidth/voice_lib/voice/models/transcription_response.rb deleted file mode 100644 index 42870dd3..00000000 --- a/lib/bandwidth/voice_lib/voice/models/transcription_response.rb +++ /dev/null @@ -1,59 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # TranscriptionResponse Model. - class TranscriptionResponse < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [List of Transcript] - attr_accessor :transcripts - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['transcripts'] = 'transcripts' - @_hash - end - - # An array for optional fields - def optionals - %w[ - transcripts - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(transcripts = nil) - @transcripts = transcripts unless transcripts == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - # Parameter is an array, so we need to iterate through it - transcripts = nil - unless hash['transcripts'].nil? - transcripts = [] - hash['transcripts'].each do |structure| - transcripts << (Transcript.from_hash(structure) if structure) - end - end - - transcripts = SKIP unless hash.key?('transcripts') - - # Create object from extracted values. - TranscriptionResponse.new(transcripts) - end - end -end diff --git a/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb b/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb deleted file mode 100644 index 569cce5b..00000000 --- a/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb +++ /dev/null @@ -1,18 +0,0 @@ -# web_rtc_transfer.rb -# -# Custom transfer BXML for WebRtc -# -# @copyright Bandwidth INC - -module Bandwidth - module WebRtc - def generate_bxml(device_token, voice_call_id, sip_uri="sip:sipx.webrtc.bandwidth.com:5060") - return '' + generate_transfer_bxml_verb(device_token, voice_call_id, sip_uri) + '' - end - - def generate_transfer_bxml_verb(device_token, voice_call_id, sip_uri="sip:sipx.webrtc.bandwidth.com:5060") - voice_call_id = voice_call_id.split("-", 2).last.split("-").join() - return '%s' % [voice_call_id, device_token, sip_uri] - end - end -end diff --git a/lib/bandwidth/web_rtc_lib/web_rtc.rb b/lib/bandwidth/web_rtc_lib/web_rtc.rb deleted file mode 100644 index f87f6bbf..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc.rb +++ /dev/null @@ -1,22 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - - -require_relative 'web_rtc/client.rb' - -# Models -require_relative 'web_rtc/models/session.rb' -require_relative 'web_rtc/models/participant.rb' -require_relative 'web_rtc/models/subscriptions.rb' -require_relative 'web_rtc/models/participant_subscription.rb' -require_relative 'web_rtc/models/accounts_participants_response.rb' -require_relative 'web_rtc/models/device_api_version_enum.rb' -require_relative 'web_rtc/models/publish_permission_enum.rb' - -# Exceptions -require_relative 'web_rtc/exceptions/error_exception.rb' -# Controllers -require_relative 'web_rtc/controllers/base_controller.rb' -require_relative 'web_rtc/controllers/api_controller.rb' diff --git a/lib/bandwidth/web_rtc_lib/web_rtc/client.rb b/lib/bandwidth/web_rtc_lib/web_rtc/client.rb deleted file mode 100644 index 1549137e..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +++ /dev/null @@ -1,60 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - module WebRtc - # bandwidth client class. - class Client - attr_reader :config - - # Access to client controller. - # @return [APIController] Returns the controller instance. - def client - @client ||= APIController.new config - end - - def initialize(timeout: 60, max_retries: 0, retry_interval: 1, - backoff_factor: 2, - retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524], - retry_methods: %i[get put get put], - environment: Environment::PRODUCTION, - base_url: 'https://www.example.com', - messaging_basic_auth_user_name: 'TODO: Replace', - messaging_basic_auth_password: 'TODO: Replace', - multi_factor_auth_basic_auth_user_name: 'TODO: Replace', - multi_factor_auth_basic_auth_password: 'TODO: Replace', - phone_number_lookup_basic_auth_user_name: 'TODO: Replace', - phone_number_lookup_basic_auth_password: 'TODO: Replace', - voice_basic_auth_user_name: 'TODO: Replace', - voice_basic_auth_password: 'TODO: Replace', - web_rtc_basic_auth_user_name: 'TODO: Replace', - web_rtc_basic_auth_password: 'TODO: Replace', - config: nil) - @config = if config.nil? - Configuration.new(timeout: timeout, - max_retries: max_retries, - retry_interval: retry_interval, - backoff_factor: backoff_factor, - retry_statuses: retry_statuses, - retry_methods: retry_methods, - environment: environment, - base_url: base_url, - messaging_basic_auth_user_name: messaging_basic_auth_user_name, - messaging_basic_auth_password: messaging_basic_auth_password, - multi_factor_auth_basic_auth_user_name: multi_factor_auth_basic_auth_user_name, - multi_factor_auth_basic_auth_password: multi_factor_auth_basic_auth_password, - phone_number_lookup_basic_auth_user_name: phone_number_lookup_basic_auth_user_name, - phone_number_lookup_basic_auth_password: phone_number_lookup_basic_auth_password, - voice_basic_auth_user_name: voice_basic_auth_user_name, - voice_basic_auth_password: voice_basic_auth_password, - web_rtc_basic_auth_user_name: web_rtc_basic_auth_user_name, - web_rtc_basic_auth_password: web_rtc_basic_auth_password) - else - config - end - end - end -end -end diff --git a/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb b/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb deleted file mode 100644 index 93dc5d77..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +++ /dev/null @@ -1,703 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth -module WebRtc - # APIController - class APIController < BaseController - def initialize(config, http_call_back: nil) - super(config, http_call_back: http_call_back) - end - - # Create a new participant under this account. - # Participants are idempotent, so relevant parameters must be set in this - # function if desired. - # @param [String] account_id Required parameter: Account ID - # @param [Participant] body Optional parameter: Participant parameters - # @return [AccountsParticipantsResponse] response from the API call - def create_participant(account_id, - body: nil) - # Prepare query url. - _query_builder = config.get_base_uri(Server::WEBRTCDEFAULT) - _query_builder << '/accounts/{accountId}/participants' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.post( - _query_url, - headers: _headers, - parameters: body.to_json - ) - WebRtcBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise APIException.new( - 'Bad Request', - _response - ) - when 401 - raise APIException.new( - 'Unauthorized', - _response - ) - when 403 - raise APIException.new( - 'Access Denied', - _response - ) - end - unless _response.status_code.between?(200, 208) - raise ErrorException.new( - 'Unexpected Error', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, - data: AccountsParticipantsResponse.from_hash(decoded) - ) - end - - # Get participant by ID. - # @param [String] account_id Required parameter: Account ID - # @param [String] participant_id Required parameter: Participant ID - # @return [Participant] response from the API call - def get_participant(account_id, - participant_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::WEBRTCDEFAULT) - _query_builder << '/accounts/{accountId}/participants/{participantId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'participantId' => { 'value' => participant_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - WebRtcBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 401 - raise APIException.new( - 'Unauthorized', - _response - ) - when 403 - raise APIException.new( - 'Access Denied', - _response - ) - when 404 - raise APIException.new( - 'Not Found', - _response - ) - end - unless _response.status_code.between?(200, 208) - raise ErrorException.new( - 'Unexpected Error', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: Participant.from_hash(decoded) - ) - end - - # Delete participant by ID. - # @param [String] account_id Required parameter: Account ID - # @param [String] participant_id Required parameter: Example: - # @return [void] response from the API call - def delete_participant(account_id, - participant_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::WEBRTCDEFAULT) - _query_builder << '/accounts/{accountId}/participants/{participantId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'participantId' => { 'value' => participant_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare and execute HttpRequest. - _request = config.http_client.delete( - _query_url - ) - WebRtcBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 401 - raise APIException.new( - 'Unauthorized', - _response - ) - when 403 - raise APIException.new( - 'Access Denied', - _response - ) - when 404 - raise APIException.new( - 'Not Found', - _response - ) - end - unless _response.status_code.between?(200, 208) - raise ErrorException.new( - 'Unexpected Error', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Create a new session. - # Sessions are idempotent, so relevant parameters must be set in this - # function if desired. - # @param [String] account_id Required parameter: Account ID - # @param [Session] body Optional parameter: Session parameters - # @return [Session] response from the API call - def create_session(account_id, - body: nil) - # Prepare query url. - _query_builder = config.get_base_uri(Server::WEBRTCDEFAULT) - _query_builder << '/accounts/{accountId}/sessions' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.post( - _query_url, - headers: _headers, - parameters: body.to_json - ) - WebRtcBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise APIException.new( - 'Bad Request', - _response - ) - when 401 - raise APIException.new( - 'Unauthorized', - _response - ) - when 403 - raise APIException.new( - 'Access Denied', - _response - ) - end - unless _response.status_code.between?(200, 208) - raise ErrorException.new( - 'Unexpected Error', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: Session.from_hash(decoded) - ) - end - - # Get session by ID. - # @param [String] account_id Required parameter: Account ID - # @param [String] session_id Required parameter: Session ID - # @return [Session] response from the API call - def get_session(account_id, - session_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::WEBRTCDEFAULT) - _query_builder << '/accounts/{accountId}/sessions/{sessionId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'sessionId' => { 'value' => session_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - WebRtcBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 401 - raise APIException.new( - 'Unauthorized', - _response - ) - when 403 - raise APIException.new( - 'Access Denied', - _response - ) - when 404 - raise APIException.new( - 'Not Found', - _response - ) - end - unless _response.status_code.between?(200, 208) - raise ErrorException.new( - 'Unexpected Error', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: Session.from_hash(decoded) - ) - end - - # Delete session by ID. - # @param [String] account_id Required parameter: Account ID - # @param [String] session_id Required parameter: Session ID - # @return [void] response from the API call - def delete_session(account_id, - session_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::WEBRTCDEFAULT) - _query_builder << '/accounts/{accountId}/sessions/{sessionId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'sessionId' => { 'value' => session_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare and execute HttpRequest. - _request = config.http_client.delete( - _query_url - ) - WebRtcBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 401 - raise APIException.new( - 'Unauthorized', - _response - ) - when 403 - raise APIException.new( - 'Access Denied', - _response - ) - when 404 - raise APIException.new( - 'Not Found', - _response - ) - end - unless _response.status_code.between?(200, 208) - raise ErrorException.new( - 'Unexpected Error', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # List participants in a session. - # @param [String] account_id Required parameter: Account ID - # @param [String] session_id Required parameter: Session ID - # @return [List of Participant] response from the API call - def list_session_participants(account_id, - session_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::WEBRTCDEFAULT) - _query_builder << '/accounts/{accountId}/sessions/{sessionId}/participants' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'sessionId' => { 'value' => session_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - WebRtcBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 401 - raise APIException.new( - 'Unauthorized', - _response - ) - when 403 - raise APIException.new( - 'Access Denied', - _response - ) - when 404 - raise APIException.new( - 'Not Found', - _response - ) - end - unless _response.status_code.between?(200, 208) - raise ErrorException.new( - 'Unexpected Error', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, - data: decoded.map { |element| Participant.from_hash(element) } - ) - end - - # Add a participant to a session. - # Subscriptions can optionally be provided as part of this call. - # @param [String] account_id Required parameter: Account ID - # @param [String] session_id Required parameter: Session ID - # @param [String] participant_id Required parameter: Participant ID - # @param [Subscriptions] body Optional parameter: Subscriptions the - # participant should be created with - # @return [void] response from the API call - def add_participant_to_session(account_id, - session_id, - participant_id, - body: nil) - # Prepare query url. - _query_builder = config.get_base_uri(Server::WEBRTCDEFAULT) - _query_builder << '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'sessionId' => { 'value' => session_id, 'encode' => false }, - 'participantId' => { 'value' => participant_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.put( - _query_url, - headers: _headers, - parameters: body.to_json - ) - WebRtcBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 401 - raise APIException.new( - 'Unauthorized', - _response - ) - when 403 - raise APIException.new( - 'Access Denied', - _response - ) - when 404 - raise APIException.new( - 'Not Found', - _response - ) - end - unless _response.status_code.between?(200, 208) - raise ErrorException.new( - 'Unexpected Error', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Remove a participant from a session. - # This will automatically remove any subscriptions the participant has - # associated with this session. - # @param [String] account_id Required parameter: Account ID - # @param [String] session_id Required parameter: Session ID - # @param [String] participant_id Required parameter: Participant ID - # @return [void] response from the API call - def remove_participant_from_session(account_id, - session_id, - participant_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::WEBRTCDEFAULT) - _query_builder << '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'sessionId' => { 'value' => session_id, 'encode' => false }, - 'participantId' => { 'value' => participant_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare and execute HttpRequest. - _request = config.http_client.delete( - _query_url - ) - WebRtcBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 401 - raise APIException.new( - 'Unauthorized', - _response - ) - when 403 - raise APIException.new( - 'Access Denied', - _response - ) - when 404 - raise APIException.new( - 'Not Found', - _response - ) - end - unless _response.status_code.between?(200, 208) - raise ErrorException.new( - 'Unexpected Error', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - - # Get a participant's subscriptions. - # @param [String] account_id Required parameter: Account ID - # @param [String] session_id Required parameter: Session ID - # @param [String] participant_id Required parameter: Participant ID - # @return [Subscriptions] response from the API call - def get_participant_subscriptions(account_id, - session_id, - participant_id) - # Prepare query url. - _query_builder = config.get_base_uri(Server::WEBRTCDEFAULT) - _query_builder << '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'sessionId' => { 'value' => session_id, 'encode' => false }, - 'participantId' => { 'value' => participant_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'accept' => 'application/json' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.get( - _query_url, - headers: _headers - ) - WebRtcBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 401 - raise APIException.new( - 'Unauthorized', - _response - ) - when 403 - raise APIException.new( - 'Access Denied', - _response - ) - when 404 - raise APIException.new( - 'Not Found', - _response - ) - end - unless _response.status_code.between?(200, 208) - raise ErrorException.new( - 'Unexpected Error', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - decoded = APIHelper.json_deserialize(_response.raw_body) - ApiResponse.new( - _response, data: Subscriptions.from_hash(decoded) - ) - end - - # Update a participant's subscriptions. - # This is a full update that will replace the participant's subscriptions. - # First call `getParticipantSubscriptions` if you need the current - # subscriptions. Call this function with no `Subscriptions` object to remove - # all subscriptions. - # @param [String] account_id Required parameter: Account ID - # @param [String] session_id Required parameter: Session ID - # @param [String] participant_id Required parameter: Participant ID - # @param [Subscriptions] body Optional parameter: Initial state - # @return [void] response from the API call - def update_participant_subscriptions(account_id, - session_id, - participant_id, - body: nil) - # Prepare query url. - _query_builder = config.get_base_uri(Server::WEBRTCDEFAULT) - _query_builder << '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions' - _query_builder = APIHelper.append_url_with_template_parameters( - _query_builder, - 'accountId' => { 'value' => account_id, 'encode' => false }, - 'sessionId' => { 'value' => session_id, 'encode' => false }, - 'participantId' => { 'value' => participant_id, 'encode' => false } - ) - _query_url = APIHelper.clean_url _query_builder - - # Prepare headers. - _headers = { - 'content-type' => 'application/json; charset=utf-8' - } - - # Prepare and execute HttpRequest. - _request = config.http_client.put( - _query_url, - headers: _headers, - parameters: body.to_json - ) - WebRtcBasicAuth.apply(config, _request) - _response = execute_request(_request) - - # Validate response against endpoint and global error codes. - case _response.status_code - when 400 - raise APIException.new( - 'Bad Request', - _response - ) - when 401 - raise APIException.new( - 'Unauthorized', - _response - ) - when 403 - raise APIException.new( - 'Access Denied', - _response - ) - when 404 - raise APIException.new( - 'Not Found', - _response - ) - end - unless _response.status_code.between?(200, 208) - raise ErrorException.new( - 'Unexpected Error', - _response - ) - end - validate_response(_response) - - # Return appropriate response type. - ApiResponse.new(_response) - end - end -end -end diff --git a/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb b/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb deleted file mode 100644 index 17e3cbc6..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +++ /dev/null @@ -1,47 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # BaseController. - class BaseController - attr_accessor :config, :http_call_back - - def initialize(config, http_call_back: nil) - @config = config - @http_call_back = http_call_back - - @global_headers = { - 'user-agent' => 'ruby-sdk' - } - end - - def validate_parameters(args) - args.each do |_name, value| - raise ArgumentError, "Required parameter #{_name} cannot be nil." if value.nil? - end - end - - def execute_request(request, binary: false) - @http_call_back&.on_before_request(request) - - APIHelper.clean_hash(request.headers) - request.headers.merge!(@global_headers) - - response = if binary - config.http_client.execute_as_binary(request) - else - config.http_client.execute_as_string(request) - end - @http_call_back&.on_after_response(response) - - response - end - - def validate_response(response) - raise APIException.new 'HTTP Response Not OK', response unless - response.status_code.between?(200, 208) # [200,208] = HTTP OK - end - end -end diff --git a/lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb b/lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb deleted file mode 100644 index d9196c30..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb +++ /dev/null @@ -1,37 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Error class. - class ErrorException < APIException - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [Integer] - attr_accessor :code - - # TODO: Write general description for this method - # @return [String] - attr_accessor :message - - # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. - def initialize(reason, response) - super(reason, response) - hash = APIHelper.json_deserialize(@response.raw_body) - unbox(hash) - end - - # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the - # response body. - def unbox(hash) - @code = hash.key?('code') ? hash['code'] : SKIP - @message = hash.key?('message') ? hash['message'] : SKIP - end - end -end diff --git a/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb b/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb deleted file mode 100644 index 65df293b..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb +++ /dev/null @@ -1,62 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # AccountsParticipantsResponse Model. - class AccountsParticipantsResponse < BaseModel - SKIP = Object.new - private_constant :SKIP - - # A participant object - # @return [Participant] - attr_accessor :participant - - # Auth token for the returned participant - # This should be passed to the participant so that they can connect to the - # platform - # @return [String] - attr_accessor :token - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['participant'] = 'participant' - @_hash['token'] = 'token' - @_hash - end - - # An array for optional fields - def optionals - %w[ - participant - token - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(participant = nil, - token = nil) - @participant = participant unless participant == SKIP - @token = token unless token == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - participant = Participant.from_hash(hash['participant']) if hash['participant'] - token = hash.key?('token') ? hash['token'] : SKIP - - # Create object from extracted values. - AccountsParticipantsResponse.new(participant, - token) - end - end -end diff --git a/lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb b/lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb deleted file mode 100644 index d65d8e26..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Optional field to define the device api version of this participant - class DeviceApiVersionEnum - DEVICE_API_VERSION_ENUM = [ - # TODO: Write general description for V3 - V3 = 'V3'.freeze, - - # TODO: Write general description for V2 - V2 = 'V2'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb b/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb deleted file mode 100644 index b88c72b7..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb +++ /dev/null @@ -1,115 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # A participant object - class Participant < BaseModel - SKIP = Object.new - private_constant :SKIP - - # Unique id of the participant - # @return [String] - attr_accessor :id - - # Full callback url to use for notifications about this participant - # @return [String] - attr_accessor :callback_url - - # Defines if this participant can publish audio or video - # @return [List of PublishPermissionEnum] - attr_accessor :publish_permissions - - # List of session ids this participant is associated with - # Capped to one - # @return [List of String] - attr_accessor :sessions - - # List of session ids this participant is associated with - # Capped to one - # @return [Subscriptions] - attr_accessor :subscriptions - - # User defined tag to associate with the participant - # @return [String] - attr_accessor :tag - - # Optional field to define the device api version of this participant - # @return [DeviceApiVersionEnum] - attr_accessor :device_api_version - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['id'] = 'id' - @_hash['callback_url'] = 'callbackUrl' - @_hash['publish_permissions'] = 'publishPermissions' - @_hash['sessions'] = 'sessions' - @_hash['subscriptions'] = 'subscriptions' - @_hash['tag'] = 'tag' - @_hash['device_api_version'] = 'deviceApiVersion' - @_hash - end - - # An array for optional fields - def optionals - %w[ - id - callback_url - publish_permissions - sessions - subscriptions - tag - device_api_version - ] - end - - # An array for nullable fields - def nullables - %w[ - callback_url - ] - end - - def initialize(id = nil, - callback_url = nil, - publish_permissions = nil, - sessions = nil, - subscriptions = nil, - tag = nil, - device_api_version = DeviceApiVersionEnum::V2) - @id = id unless id == SKIP - @callback_url = callback_url unless callback_url == SKIP - @publish_permissions = publish_permissions unless publish_permissions == SKIP - @sessions = sessions unless sessions == SKIP - @subscriptions = subscriptions unless subscriptions == SKIP - @tag = tag unless tag == SKIP - @device_api_version = device_api_version unless device_api_version == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - id = hash.key?('id') ? hash['id'] : SKIP - callback_url = hash.key?('callbackUrl') ? hash['callbackUrl'] : SKIP - publish_permissions = - hash.key?('publishPermissions') ? hash['publishPermissions'] : SKIP - sessions = hash.key?('sessions') ? hash['sessions'] : SKIP - subscriptions = Subscriptions.from_hash(hash['subscriptions']) if hash['subscriptions'] - tag = hash.key?('tag') ? hash['tag'] : SKIP - device_api_version = hash['deviceApiVersion'] ||= DeviceApiVersionEnum::V2 - - # Create object from extracted values. - Participant.new(id, - callback_url, - publish_permissions, - sessions, - subscriptions, - tag, - device_api_version) - end - end -end diff --git a/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb b/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb deleted file mode 100644 index 40007b31..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb +++ /dev/null @@ -1,48 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # ParticipantSubscription Model. - class ParticipantSubscription < BaseModel - SKIP = Object.new - private_constant :SKIP - - # Participant the subscriber should be subscribed to - # @return [String] - attr_accessor :participant_id - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['participant_id'] = 'participantId' - @_hash - end - - # An array for optional fields - def optionals - [] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(participant_id = nil) - @participant_id = participant_id unless participant_id == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - participant_id = hash.key?('participantId') ? hash['participantId'] : SKIP - - # Create object from extracted values. - ParticipantSubscription.new(participant_id) - end - end -end diff --git a/lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb b/lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb deleted file mode 100644 index ab4e49a0..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # PublishPermission. - class PublishPermissionEnum - PUBLISH_PERMISSION_ENUM = [ - # TODO: Write general description for AUDIO - AUDIO = 'AUDIO'.freeze, - - # TODO: Write general description for VIDEO - VIDEO = 'VIDEO'.freeze - ].freeze - end -end diff --git a/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb b/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb deleted file mode 100644 index 64af0743..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb +++ /dev/null @@ -1,60 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # A session object - class Session < BaseModel - SKIP = Object.new - private_constant :SKIP - - # Unique id of the session - # @return [String] - attr_accessor :id - - # User defined tag to associate with the session - # @return [String] - attr_accessor :tag - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['id'] = 'id' - @_hash['tag'] = 'tag' - @_hash - end - - # An array for optional fields - def optionals - %w[ - id - tag - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(id = nil, - tag = nil) - @id = id unless id == SKIP - @tag = tag unless tag == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - id = hash.key?('id') ? hash['id'] : SKIP - tag = hash.key?('tag') ? hash['tag'] : SKIP - - # Create object from extracted values. - Session.new(id, - tag) - end - end -end diff --git a/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb b/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb deleted file mode 100644 index 8baefc21..00000000 --- a/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb +++ /dev/null @@ -1,71 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -module Bandwidth - # Subscriptions Model. - class Subscriptions < BaseModel - SKIP = Object.new - private_constant :SKIP - - # Session the subscriptions are associated with - # If this is the only field, the subscriber will be subscribed to all - # participants in the session (including any participants that are later - # added to the session) - # @return [String] - attr_accessor :session_id - - # Subset of participants to subscribe to in the session. Optional. - # @return [List of ParticipantSubscription] - attr_accessor :participants - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['session_id'] = 'sessionId' - @_hash['participants'] = 'participants' - @_hash - end - - # An array for optional fields - def optionals - %w[ - participants - ] - end - - # An array for nullable fields - def nullables - [] - end - - def initialize(session_id = nil, - participants = nil) - @session_id = session_id unless session_id == SKIP - @participants = participants unless participants == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - session_id = hash.key?('sessionId') ? hash['sessionId'] : SKIP - # Parameter is an array, so we need to iterate through it - participants = nil - unless hash['participants'].nil? - participants = [] - hash['participants'].each do |structure| - participants << (ParticipantSubscription.from_hash(structure) if structure) - end - end - - participants = SKIP unless hash.key?('participants') - - # Create object from extracted values. - Subscriptions.new(session_id, - participants) - end - end -end diff --git a/test/controllers/controller_test_base.rb b/test/controllers/controller_test_base.rb deleted file mode 100644 index 2ea63c53..00000000 --- a/test/controllers/controller_test_base.rb +++ /dev/null @@ -1,21 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'json' -require 'minitest/autorun' -require 'minitest/hell' -require 'minitest/pride' -require 'minitest/proveit' -require 'bandwidth' -require_relative '../test_helper' -require_relative '../http_response_catcher' - -class ControllerTestBase < Minitest::Test - parallelize_me! - include Bandwidth - - # Create configuration and set any test parameters - CONFIG = Configuration.new -end diff --git a/test/http_response_catcher.rb b/test/http_response_catcher.rb deleted file mode 100644 index c76d12ff..00000000 --- a/test/http_response_catcher.rb +++ /dev/null @@ -1,19 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -class HttpResponseCatcher < Bandwidth::HttpCallBack - attr_accessor :response - - def on_before_request(request) - end - - # Catching the response - def on_after_response(response) - @response = response - end -end - - - diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index c3c157af..00000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,94 +0,0 @@ -# bandwidth -# -# This file was automatically generated by APIMATIC v2.0 -# ( https://apimatic.io ). - -require 'tempfile' -require 'open-uri' - -class TestHelper - - @cache = Hash.new - - # Class method to compare the received headers with the expected headers. - # @param [Hash] A hash of expected headers (keys in lower case). - # @param [Hash] A hash of received headers. - # @param [Boolean, optional] A flag which determines if we allow extra headers. - def self.match_headers(expected_headers, - received_headers, - allow_extra: true) - return false if ((received_headers.length < expected_headers.length) || - ((allow_extra == false) && (received_headers.length > expected_headers.length))) - - received_headers = Hash[received_headers.map{|k, v| [k.to_s.downcase, v]}] - expected_headers.each do |e_key, e_value| - return false unless received_headers.key?(e_key) - return false if ((e_value != nil) && - (e_value != received_headers[e_key])) - end - - return true - end - - # Class method to compare the received body with the expected body. - # @param [Dynamic] The expected body. - # @param [Dynamic] The received body. - # @param [Boolean, optional] A flag which determines if we check values in dictionaries. - # @param [Boolean, optional] A flag which determines if we check the order of array elements. - # @param [Boolean, optional] A flag which determines if we check the count of array elements. - def self.match_body(expected_body, - received_body, - check_values: false, - check_order: false, - check_count: false) - if expected_body.instance_of? Hash - return false unless received_body.instance_of? Hash - for key in expected_body.keys - return false unless received_body.keys.include? key - if check_values or expected_body[key].instance_of? Hash - return false unless TestHelper.match_body(expected_body[key], - received_body[key], - check_values: check_values, - check_order: check_order, - check_count: check_count) - end - end - elsif expected_body.instance_of? Array - return False unless received_body.instance_of? Array - if check_count == true && (expected_body.length != received_body.length) - return false - else - previous_matches = Array.new - expected_body.each.with_index do |expected_element, i| - matches = (received_body.map.with_index do |received_element, j| - j if TestHelper.match_body(expected_element, - received_element, - check_values: check_values, - check_order: check_order, - check_count: check_count) - end).compact - return false if matches.length == 0 - if check_order == true - return false if (i != 0 && matches.map{|x| previous_matches.map{|y| y > x}.all?}.all?) - previous_matches = matches - end - end - end - elsif expected_body != received_body - return false - end - return true - end - - # Class method which takes a URL, downloads the file (if not already downloaded - # for this test session) and returns the path of the file. - # @param [String] The URL of the required file. - def self.get_file(url) - unless @cache.keys.include? url - @cache[url] = Tempfile.new('APIMatic') - @cache[url].binmode - @cache[url].write(open(url, {ssl_ca_cert: Certifi.where}).read) - end - return @cache[url].path - end -end \ No newline at end of file From 357837f02b4852f3787e2061c853598ef2a1f7c8 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Fri, 17 Feb 2023 16:37:41 -0500 Subject: [PATCH 03/30] Update to OpenAPI Generator v6.3 (#66) * use version 6.3 of the generator * regenerate tests * drop ruby 2.6 * add 3.2 to test matrix * split tests and do messaging integration as test * remove from test.rb * checkout v3 * tests in readme * put constant env vars in spec_helper * remove constants from messaging * add unit and integration tasks to rake * move other unit tests to unit folder * clean up integration test files * remove messaging integration tests to put in separate pr * gitignore gemfile.lock --- .github/workflows/test.yml | 6 +- .gitlab-ci.yml | 2 +- .openapi-generator/FILES | 527 ++++----- .openapi-generator/VERSION | 2 +- .travis.yml | 5 +- Gemfile.lock | 74 ++ README.md | 40 +- Rakefile | 12 + bandwidth-sdk.gemspec | 4 +- bandwidth.yml | 1000 ++++++----------- docs/InboundMessageCallback.md | 26 + docs/InboundMessageCallbackMessage.md | 40 + docs/MediaApi.md | 2 +- docs/MessageDeliveredCallback.md | 26 + docs/MessageDeliveredCallbackMessage.md | 40 + docs/MessageFailedCallback.md | 28 + docs/MessageFailedCallbackMessage.md | 40 + docs/MessageRequest.md | 2 +- docs/MessageSendingCallback.md | 26 + docs/MessageSendingCallbackMessage.md | 40 + lib/bandwidth-sdk.rb | 23 +- lib/bandwidth-sdk/api/calls_api.rb | 2 +- lib/bandwidth-sdk/api/conferences_api.rb | 2 +- lib/bandwidth-sdk/api/media_api.rb | 6 +- lib/bandwidth-sdk/api/messages_api.rb | 2 +- lib/bandwidth-sdk/api/mfa_api.rb | 2 +- .../api/phone_number_lookup_api.rb | 2 +- lib/bandwidth-sdk/api/recordings_api.rb | 2 +- lib/bandwidth-sdk/api/statistics_api.rb | 2 +- lib/bandwidth-sdk/api_client.rb | 6 +- lib/bandwidth-sdk/api_error.rb | 3 +- lib/bandwidth-sdk/configuration.rb | 79 +- .../models/account_statistics.rb | 2 +- lib/bandwidth-sdk/models/answer_callback.rb | 24 +- .../models/bridge_complete_callback.rb | 24 +- .../models/bridge_target_complete_callback.rb | 24 +- .../models/call_direction_enum.rb | 2 +- .../models/call_recording_metadata.rb | 24 +- lib/bandwidth-sdk/models/call_state.rb | 24 +- lib/bandwidth-sdk/models/call_state_enum.rb | 2 +- .../models/callback_method_enum.rb | 2 +- lib/bandwidth-sdk/models/code_request.rb | 2 +- lib/bandwidth-sdk/models/conference.rb | 24 +- .../models/conference_completed_callback.rb | 2 +- .../models/conference_created_callback.rb | 2 +- lib/bandwidth-sdk/models/conference_member.rb | 2 +- .../models/conference_member_exit_callback.rb | 2 +- .../models/conference_member_join_callback.rb | 2 +- ...conference_recording_available_callback.rb | 24 +- .../models/conference_recording_metadata.rb | 24 +- .../models/conference_redirect_callback.rb | 2 +- .../models/conference_state_enum.rb | 2 +- lib/bandwidth-sdk/models/create_call.rb | 24 +- .../models/create_call_response.rb | 24 +- .../models/create_lookup_response.rb | 24 +- .../models/create_message_request_error.rb | 2 +- lib/bandwidth-sdk/models/deferred_result.rb | 2 +- .../models/disconenct_callback.rb | 24 +- lib/bandwidth-sdk/models/diversion.rb | 2 +- lib/bandwidth-sdk/models/dtmf_callback.rb | 24 +- lib/bandwidth-sdk/models/field_error.rb | 2 +- lib/bandwidth-sdk/models/file_format_enum.rb | 2 +- lib/bandwidth-sdk/models/gather_callback.rb | 24 +- .../models/inbound_message_callback.rb | 281 +++++ .../inbound_message_callback_message.rb | 399 +++++++ lib/bandwidth-sdk/models/initiate_callback.rb | 24 +- .../models/list_message_direction_enum.rb | 2 +- lib/bandwidth-sdk/models/list_message_item.rb | 24 +- lib/bandwidth-sdk/models/lookup_request.rb | 2 +- lib/bandwidth-sdk/models/lookup_result.rb | 2 +- lib/bandwidth-sdk/models/lookup_status.rb | 24 +- .../models/lookup_status_enum.rb | 2 +- .../machine_detection_complete_callback.rb | 24 +- .../models/machine_detection_configuration.rb | 24 +- .../models/machine_detection_mode_enum.rb | 2 +- lib/bandwidth-sdk/models/media.rb | 2 +- lib/bandwidth-sdk/models/message.rb | 24 +- .../models/message_delivered_callback.rb | 281 +++++ .../message_delivered_callback_message.rb | 404 +++++++ .../models/message_direction_enum.rb | 2 +- .../models/message_failed_callback.rb | 295 +++++ .../models/message_failed_callback_message.rb | 409 +++++++ lib/bandwidth-sdk/models/message_request.rb | 26 +- .../models/message_sending_callback.rb | 281 +++++ .../message_sending_callback_message.rb | 409 +++++++ .../models/message_status_enum.rb | 2 +- lib/bandwidth-sdk/models/message_type_enum.rb | 2 +- lib/bandwidth-sdk/models/messages_list.rb | 2 +- .../models/messaging_code_response.rb | 2 +- .../models/messaging_request_error.rb | 2 +- .../models/mfa_forbidden_request_error.rb | 2 +- lib/bandwidth-sdk/models/mfa_request_error.rb | 2 +- .../models/mfa_unauthorized_request_error.rb | 2 +- lib/bandwidth-sdk/models/page_info.rb | 2 +- lib/bandwidth-sdk/models/priority_enum.rb | 2 +- .../models/recording_available_callback.rb | 24 +- .../models/recording_complete_callback.rb | 24 +- .../models/recording_state_enum.rb | 2 +- lib/bandwidth-sdk/models/redirect_callback.rb | 24 +- .../models/redirect_method_enum.rb | 2 +- lib/bandwidth-sdk/models/stir_shaken.rb | 2 +- lib/bandwidth-sdk/models/tag.rb | 2 +- .../models/tn_lookup_request_error.rb | 2 +- .../models/transcribe_recording.rb | 24 +- lib/bandwidth-sdk/models/transcription.rb | 2 +- .../transcription_available_callback.rb | 24 +- .../models/transcription_list.rb | 2 +- .../models/transcription_metadata.rb | 2 +- .../models/transfer_answer_callback.rb | 24 +- .../models/transfer_complete_callback.rb | 24 +- .../models/transfer_disconnect_callback.rb | 24 +- lib/bandwidth-sdk/models/update_call.rb | 24 +- .../models/update_call_recording.rb | 24 +- lib/bandwidth-sdk/models/update_conference.rb | 24 +- .../models/update_conference_member.rb | 2 +- .../models/verify_code_request.rb | 2 +- .../models/verify_code_response.rb | 2 +- lib/bandwidth-sdk/models/voice_api_error.rb | 2 +- .../models/voice_code_response.rb | 2 +- lib/bandwidth-sdk/version.rb | 2 +- openapi-config.yml | 4 +- spec/api/participants_api_spec.rb | 74 -- spec/api/sessions_api_spec.rb | 145 --- .../integration/calls_api_integration_spec.rb | 43 + .../conferences_api_integration_spec.rb | 78 ++ .../integration/media_api_integration_spec.rb | 43 + .../messages_api_integration_spec.rb | 28 + spec/integration/mfa_api_integration_spec.rb | 36 + ...hone_number_lookup_api_integration_spec.rb | 29 + .../recordings_api_integration_spec.rb | 85 ++ .../statistics_api_integration_spec.rb | 22 + .../create_participant_response_spec.rb | 40 - spec/models/device_api_version_enum_spec.rb | 28 - spec/models/forbidden_request_spec.rb | 34 - spec/models/participant_subscription_spec.rb | 40 - spec/models/publish_permissions_enum_spec.rb | 28 - spec/models/request_error_spec.rb | 40 - spec/models/session_spec.rb | 40 - spec/models/subscriptions_spec.rb | 40 - spec/models/unauthorized_request_spec.rb | 34 - spec/spec_helper.rb | 21 +- spec/test.rb | 219 +--- spec/{ => unit}/api/calls_api_spec.rb | 2 +- spec/{ => unit}/api/conferences_api_spec.rb | 2 +- spec/{ => unit}/api/media_api_spec.rb | 4 +- spec/{ => unit}/api/messages_api_spec.rb | 11 +- spec/{ => unit}/api/mfa_api_spec.rb | 2 +- .../api/phone_number_lookup_api_spec.rb | 2 +- spec/{ => unit}/api/recordings_api_spec.rb | 2 +- spec/{ => unit}/api/statistics_api_spec.rb | 2 +- spec/{ => unit}/api_client_spec.rb | 2 +- spec/{ => unit}/configuration_spec.rb | 2 +- .../models/account_statistics_spec.rb | 2 +- .../{ => unit}/models/answer_callback_spec.rb | 2 +- .../models/bridge_complete_callback_spec.rb | 2 +- .../bridge_target_complete_callback_spec.rb | 2 +- .../models/call_direction_enum_spec.rb | 2 +- .../models/call_recording_metadata_spec.rb | 2 +- .../{ => unit}/models/call_state_enum_spec.rb | 2 +- spec/{ => unit}/models/call_state_spec.rb | 2 +- .../models/callback_method_enum_spec.rb | 2 +- spec/{ => unit}/models/code_request_spec.rb | 2 +- .../conference_completed_callback_spec.rb | 2 +- .../conference_created_callback_spec.rb | 2 +- .../conference_member_exit_callback_spec.rb | 2 +- .../conference_member_join_callback_spec.rb | 2 +- .../models/conference_member_spec.rb | 2 +- ...rence_recording_available_callback_spec.rb | 2 +- .../conference_recording_metadata_spec.rb | 2 +- .../conference_redirect_callback_spec.rb | 2 +- spec/{ => unit}/models/conference_spec.rb | 2 +- .../models/conference_state_enum_spec.rb | 2 +- .../models/create_call_response_spec.rb | 2 +- spec/{ => unit}/models/create_call_spec.rb | 2 +- .../models/create_lookup_response_spec.rb | 2 +- .../create_message_request_error_spec.rb | 2 +- .../{ => unit}/models/deferred_result_spec.rb | 2 +- .../models/disconenct_callback_spec.rb | 2 +- spec/{ => unit}/models/diversion_spec.rb | 2 +- spec/{ => unit}/models/dtmf_callback_spec.rb | 2 +- spec/{ => unit}/models/field_error_spec.rb | 2 +- .../models/file_format_enum_spec.rb | 2 +- .../{ => unit}/models/gather_callback_spec.rb | 2 +- .../inbound_message_callback_message_spec.rb | 100 ++ .../models/inbound_message_callback_spec.rb} | 28 +- .../models/initiate_callback_spec.rb | 2 +- .../list_message_direction_enum_spec.rb | 2 +- .../models/list_message_item_spec.rb | 2 +- spec/{ => unit}/models/lookup_request_spec.rb | 2 +- spec/{ => unit}/models/lookup_result_spec.rb | 2 +- .../models/lookup_status_enum_spec.rb | 2 +- spec/{ => unit}/models/lookup_status_spec.rb | 2 +- ...achine_detection_complete_callback_spec.rb | 2 +- .../machine_detection_configuration_spec.rb | 2 +- .../machine_detection_mode_enum_spec.rb | 2 +- spec/{ => unit}/models/media_spec.rb | 2 +- ...message_delivered_callback_message_spec.rb | 100 ++ .../models/message_delivered_callback_spec.rb | 58 + .../models/message_direction_enum_spec.rb | 2 +- .../message_failed_callback_message_spec.rb | 100 ++ .../models/message_failed_callback_spec.rb} | 32 +- .../{ => unit}/models/message_request_spec.rb | 2 +- .../message_sending_callback_message_spec.rb | 100 ++ .../models/message_sending_callback_spec.rb | 58 + spec/{ => unit}/models/message_spec.rb | 2 +- .../models/message_status_enum_spec.rb | 2 +- .../models/message_type_enum_spec.rb | 2 +- spec/{ => unit}/models/messages_list_spec.rb | 2 +- .../models/messaging_code_response_spec.rb | 2 +- .../models/messaging_request_error_spec.rb | 2 +- .../mfa_forbidden_request_error_spec.rb | 2 +- .../models/mfa_request_error_spec.rb | 2 +- .../mfa_unauthorized_request_error_spec.rb | 2 +- spec/{ => unit}/models/page_info_spec.rb | 2 +- spec/{ => unit}/models/priority_enum_spec.rb | 2 +- .../recording_available_callback_spec.rb | 2 +- .../recording_complete_callback_spec.rb | 2 +- .../models/recording_state_enum_spec.rb | 2 +- .../models/redirect_callback_spec.rb | 2 +- .../models/redirect_method_enum_spec.rb | 2 +- spec/{ => unit}/models/stir_shaken_spec.rb | 2 +- spec/{ => unit}/models/tag_spec.rb | 2 +- .../models/tn_lookup_request_error_spec.rb | 2 +- .../models/transcribe_recording_spec.rb | 2 +- .../transcription_available_callback_spec.rb | 2 +- .../models/transcription_list_spec.rb | 2 +- .../models/transcription_metadata_spec.rb | 2 +- spec/{ => unit}/models/transcription_spec.rb | 2 +- .../models/transfer_answer_callback_spec.rb | 2 +- .../models/transfer_complete_callback_spec.rb | 2 +- .../transfer_disconnect_callback_spec.rb | 2 +- .../models/update_call_recording_spec.rb | 2 +- spec/{ => unit}/models/update_call_spec.rb | 2 +- .../models/update_conference_member_spec.rb | 2 +- .../models/update_conference_spec.rb | 2 +- .../models/verify_code_request_spec.rb | 2 +- .../models/verify_code_response_spec.rb | 2 +- .../{ => unit}/models/voice_api_error_spec.rb | 2 +- .../models/voice_code_response_spec.rb | 2 +- 239 files changed, 5591 insertions(+), 2023 deletions(-) create mode 100644 Gemfile.lock create mode 100644 docs/InboundMessageCallback.md create mode 100644 docs/InboundMessageCallbackMessage.md create mode 100644 docs/MessageDeliveredCallback.md create mode 100644 docs/MessageDeliveredCallbackMessage.md create mode 100644 docs/MessageFailedCallback.md create mode 100644 docs/MessageFailedCallbackMessage.md create mode 100644 docs/MessageSendingCallback.md create mode 100644 docs/MessageSendingCallbackMessage.md create mode 100644 lib/bandwidth-sdk/models/inbound_message_callback.rb create mode 100644 lib/bandwidth-sdk/models/inbound_message_callback_message.rb create mode 100644 lib/bandwidth-sdk/models/message_delivered_callback.rb create mode 100644 lib/bandwidth-sdk/models/message_delivered_callback_message.rb create mode 100644 lib/bandwidth-sdk/models/message_failed_callback.rb create mode 100644 lib/bandwidth-sdk/models/message_failed_callback_message.rb create mode 100644 lib/bandwidth-sdk/models/message_sending_callback.rb create mode 100644 lib/bandwidth-sdk/models/message_sending_callback_message.rb delete mode 100644 spec/api/participants_api_spec.rb delete mode 100644 spec/api/sessions_api_spec.rb create mode 100644 spec/integration/calls_api_integration_spec.rb create mode 100644 spec/integration/conferences_api_integration_spec.rb create mode 100644 spec/integration/media_api_integration_spec.rb create mode 100644 spec/integration/messages_api_integration_spec.rb create mode 100644 spec/integration/mfa_api_integration_spec.rb create mode 100644 spec/integration/phone_number_lookup_api_integration_spec.rb create mode 100644 spec/integration/recordings_api_integration_spec.rb create mode 100644 spec/integration/statistics_api_integration_spec.rb delete mode 100644 spec/models/create_participant_response_spec.rb delete mode 100644 spec/models/device_api_version_enum_spec.rb delete mode 100644 spec/models/forbidden_request_spec.rb delete mode 100644 spec/models/participant_subscription_spec.rb delete mode 100644 spec/models/publish_permissions_enum_spec.rb delete mode 100644 spec/models/request_error_spec.rb delete mode 100644 spec/models/session_spec.rb delete mode 100644 spec/models/subscriptions_spec.rb delete mode 100644 spec/models/unauthorized_request_spec.rb rename spec/{ => unit}/api/calls_api_spec.rb (99%) rename spec/{ => unit}/api/conferences_api_spec.rb (99%) rename spec/{ => unit}/api/media_api_spec.rb (89%) rename spec/{ => unit}/api/messages_api_spec.rb (94%) rename spec/{ => unit}/api/mfa_api_spec.rb (98%) rename spec/{ => unit}/api/phone_number_lookup_api_spec.rb (98%) rename spec/{ => unit}/api/recordings_api_spec.rb (99%) rename spec/{ => unit}/api/statistics_api_spec.rb (97%) rename spec/{ => unit}/api_client_spec.rb (99%) rename spec/{ => unit}/configuration_spec.rb (96%) rename spec/{ => unit}/models/account_statistics_spec.rb (97%) rename spec/{ => unit}/models/answer_callback_spec.rb (99%) rename spec/{ => unit}/models/bridge_complete_callback_spec.rb (99%) rename spec/{ => unit}/models/bridge_target_complete_callback_spec.rb (98%) rename spec/{ => unit}/models/call_direction_enum_spec.rb (95%) rename spec/{ => unit}/models/call_recording_metadata_spec.rb (99%) rename spec/{ => unit}/models/call_state_enum_spec.rb (95%) rename spec/{ => unit}/models/call_state_spec.rb (99%) rename spec/{ => unit}/models/callback_method_enum_spec.rb (95%) rename spec/{ => unit}/models/code_request_spec.rb (98%) rename spec/{ => unit}/models/conference_completed_callback_spec.rb (98%) rename spec/{ => unit}/models/conference_created_callback_spec.rb (98%) rename spec/{ => unit}/models/conference_member_exit_callback_spec.rb (98%) rename spec/{ => unit}/models/conference_member_join_callback_spec.rb (98%) rename spec/{ => unit}/models/conference_member_spec.rb (98%) rename spec/{ => unit}/models/conference_recording_available_callback_spec.rb (99%) rename spec/{ => unit}/models/conference_recording_metadata_spec.rb (98%) rename spec/{ => unit}/models/conference_redirect_callback_spec.rb (98%) rename spec/{ => unit}/models/conference_spec.rb (98%) rename spec/{ => unit}/models/conference_state_enum_spec.rb (95%) rename spec/{ => unit}/models/create_call_response_spec.rb (99%) rename spec/{ => unit}/models/create_call_spec.rb (99%) rename spec/{ => unit}/models/create_lookup_response_spec.rb (97%) rename spec/{ => unit}/models/create_message_request_error_spec.rb (97%) rename spec/{ => unit}/models/deferred_result_spec.rb (96%) rename spec/{ => unit}/models/disconenct_callback_spec.rb (99%) rename spec/{ => unit}/models/diversion_spec.rb (98%) rename spec/{ => unit}/models/dtmf_callback_spec.rb (99%) rename spec/{ => unit}/models/field_error_spec.rb (96%) rename spec/{ => unit}/models/file_format_enum_spec.rb (95%) rename spec/{ => unit}/models/gather_callback_spec.rb (99%) create mode 100644 spec/unit/models/inbound_message_callback_message_spec.rb rename spec/{models/create_participant_request_spec.rb => unit/models/inbound_message_callback_spec.rb} (56%) rename spec/{ => unit}/models/initiate_callback_spec.rb (98%) rename spec/{ => unit}/models/list_message_direction_enum_spec.rb (95%) rename spec/{ => unit}/models/list_message_item_spec.rb (99%) rename spec/{ => unit}/models/lookup_request_spec.rb (96%) rename spec/{ => unit}/models/lookup_result_spec.rb (98%) rename spec/{ => unit}/models/lookup_status_enum_spec.rb (95%) rename spec/{ => unit}/models/lookup_status_spec.rb (97%) rename spec/{ => unit}/models/machine_detection_complete_callback_spec.rb (99%) rename spec/{ => unit}/models/machine_detection_configuration_spec.rb (99%) rename spec/{ => unit}/models/machine_detection_mode_enum_spec.rb (95%) rename spec/{ => unit}/models/media_spec.rb (97%) create mode 100644 spec/unit/models/message_delivered_callback_message_spec.rb create mode 100644 spec/unit/models/message_delivered_callback_spec.rb rename spec/{ => unit}/models/message_direction_enum_spec.rb (95%) create mode 100644 spec/unit/models/message_failed_callback_message_spec.rb rename spec/{models/participant_spec.rb => unit/models/message_failed_callback_spec.rb} (61%) rename spec/{ => unit}/models/message_request_spec.rb (98%) create mode 100644 spec/unit/models/message_sending_callback_message_spec.rb create mode 100644 spec/unit/models/message_sending_callback_spec.rb rename spec/{ => unit}/models/message_spec.rb (98%) rename spec/{ => unit}/models/message_status_enum_spec.rb (95%) rename spec/{ => unit}/models/message_type_enum_spec.rb (95%) rename spec/{ => unit}/models/messages_list_spec.rb (97%) rename spec/{ => unit}/models/messaging_code_response_spec.rb (96%) rename spec/{ => unit}/models/messaging_request_error_spec.rb (97%) rename spec/{ => unit}/models/mfa_forbidden_request_error_spec.rb (96%) rename spec/{ => unit}/models/mfa_request_error_spec.rb (96%) rename spec/{ => unit}/models/mfa_unauthorized_request_error_spec.rb (96%) rename spec/{ => unit}/models/page_info_spec.rb (97%) rename spec/{ => unit}/models/priority_enum_spec.rb (95%) rename spec/{ => unit}/models/recording_available_callback_spec.rb (99%) rename spec/{ => unit}/models/recording_complete_callback_spec.rb (99%) rename spec/{ => unit}/models/recording_state_enum_spec.rb (95%) rename spec/{ => unit}/models/redirect_callback_spec.rb (99%) rename spec/{ => unit}/models/redirect_method_enum_spec.rb (95%) rename spec/{ => unit}/models/stir_shaken_spec.rb (97%) rename spec/{ => unit}/models/tag_spec.rb (96%) rename spec/{ => unit}/models/tn_lookup_request_error_spec.rb (96%) rename spec/{ => unit}/models/transcribe_recording_spec.rb (98%) rename spec/{ => unit}/models/transcription_available_callback_spec.rb (99%) rename spec/{ => unit}/models/transcription_list_spec.rb (96%) rename spec/{ => unit}/models/transcription_metadata_spec.rb (97%) rename spec/{ => unit}/models/transcription_spec.rb (96%) rename spec/{ => unit}/models/transfer_answer_callback_spec.rb (99%) rename spec/{ => unit}/models/transfer_complete_callback_spec.rb (99%) rename spec/{ => unit}/models/transfer_disconnect_callback_spec.rb (99%) rename spec/{ => unit}/models/update_call_recording_spec.rb (96%) rename spec/{ => unit}/models/update_call_spec.rb (98%) rename spec/{ => unit}/models/update_conference_member_spec.rb (97%) rename spec/{ => unit}/models/update_conference_spec.rb (98%) rename spec/{ => unit}/models/verify_code_request_spec.rb (97%) rename spec/{ => unit}/models/verify_code_response_spec.rb (96%) rename spec/{ => unit}/models/voice_api_error_spec.rb (97%) rename spec/{ => unit}/models/voice_code_response_spec.rb (96%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index edddd1c0..d3373d52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,11 +12,11 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-2022, windows-2019, ubuntu-18.04, ubuntu-20.04] - ruby-version: [2.6, 2.7, 3.0] + os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04] + ruby-version: [2.7, 3.0, 3.1, 3.2] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d57c5b3..3a253c45 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ - bundle install -j $(nproc) parallel: matrix: - - RUBY_VERSION: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0'] + - RUBY_VERSION: ['2.7', '3.0', '3.1'] image: "ruby:$RUBY_VERSION" cache: paths: diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 85b6cb4c..860006dc 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,319 +1,208 @@ -.gitignore -.gitlab-ci.yml -.openapi-generator-ignore -.rspec -.rubocop.yml -.travis.yml -Gemfile -README.md -Rakefile -bandwidth-sdk.gemspec -docs/AccountStatistics.md -docs/AnswerCallback.md -docs/BridgeCompleteCallback.md -docs/BridgeTargetCompleteCallback.md -docs/CallDirectionEnum.md -docs/CallRecordingMetadata.md -docs/CallState.md -docs/CallStateEnum.md -docs/CallbackMethodEnum.md -docs/CallsApi.md -docs/CodeRequest.md -docs/Conference.md -docs/ConferenceCompletedCallback.md -docs/ConferenceCreatedCallback.md -docs/ConferenceMember.md -docs/ConferenceMemberExitCallback.md -docs/ConferenceMemberJoinCallback.md -docs/ConferenceRecordingAvailableCallback.md -docs/ConferenceRecordingMetadata.md -docs/ConferenceRedirectCallback.md -docs/ConferenceStateEnum.md -docs/ConferencesApi.md -docs/CreateCall.md -docs/CreateCallResponse.md -docs/CreateLookupResponse.md -docs/CreateMessageRequestError.md -docs/CreateParticipantRequest.md -docs/CreateParticipantResponse.md -docs/DeferredResult.md -docs/DeviceApiVersionEnum.md -docs/DisconenctCallback.md -docs/Diversion.md -docs/DtmfCallback.md -docs/FieldError.md -docs/FileFormatEnum.md -docs/ForbiddenRequest.md -docs/GatherCallback.md -docs/InitiateCallback.md -docs/ListMessageDirectionEnum.md -docs/ListMessageItem.md -docs/LookupRequest.md -docs/LookupResult.md -docs/LookupStatus.md -docs/LookupStatusEnum.md -docs/MFAApi.md -docs/MachineDetectionCompleteCallback.md -docs/MachineDetectionConfiguration.md -docs/MachineDetectionModeEnum.md -docs/Media.md -docs/MediaApi.md -docs/Message.md -docs/MessageDirectionEnum.md -docs/MessageRequest.md -docs/MessageStatusEnum.md -docs/MessageTypeEnum.md -docs/MessagesApi.md -docs/MessagesList.md -docs/MessagingCodeResponse.md -docs/MessagingRequestError.md -docs/MfaForbiddenRequestError.md -docs/MfaRequestError.md -docs/MfaUnauthorizedRequestError.md -docs/PageInfo.md -docs/Participant.md -docs/ParticipantSubscription.md -docs/ParticipantsApi.md -docs/PhoneNumberLookupApi.md -docs/PriorityEnum.md -docs/PublishPermissionsEnum.md -docs/RecordingAvailableCallback.md -docs/RecordingCompleteCallback.md -docs/RecordingStateEnum.md -docs/RecordingsApi.md -docs/RedirectCallback.md -docs/RedirectMethodEnum.md -docs/RequestError.md -docs/Session.md -docs/SessionsApi.md -docs/StatisticsApi.md -docs/StirShaken.md -docs/Subscriptions.md -docs/Tag.md -docs/TnLookupRequestError.md -docs/TranscribeRecording.md -docs/Transcription.md -docs/TranscriptionAvailableCallback.md -docs/TranscriptionList.md -docs/TranscriptionMetadata.md -docs/TransferAnswerCallback.md -docs/TransferCompleteCallback.md -docs/TransferDisconnectCallback.md -docs/UnauthorizedRequest.md -docs/UpdateCall.md -docs/UpdateCallRecording.md -docs/UpdateConference.md -docs/UpdateConferenceMember.md -docs/VerifyCodeRequest.md -docs/VerifyCodeResponse.md -docs/VoiceApiError.md -docs/VoiceCodeResponse.md -git_push.sh -lib/bandwidth-sdk.rb -lib/bandwidth-sdk/api/calls_api.rb -lib/bandwidth-sdk/api/conferences_api.rb -lib/bandwidth-sdk/api/media_api.rb -lib/bandwidth-sdk/api/messages_api.rb -lib/bandwidth-sdk/api/mfa_api.rb -lib/bandwidth-sdk/api/participants_api.rb -lib/bandwidth-sdk/api/phone_number_lookup_api.rb -lib/bandwidth-sdk/api/recordings_api.rb -lib/bandwidth-sdk/api/sessions_api.rb -lib/bandwidth-sdk/api/statistics_api.rb -lib/bandwidth-sdk/api_client.rb -lib/bandwidth-sdk/api_error.rb -lib/bandwidth-sdk/configuration.rb -lib/bandwidth-sdk/models/account_statistics.rb -lib/bandwidth-sdk/models/answer_callback.rb -lib/bandwidth-sdk/models/bridge_complete_callback.rb -lib/bandwidth-sdk/models/bridge_target_complete_callback.rb -lib/bandwidth-sdk/models/call_direction_enum.rb -lib/bandwidth-sdk/models/call_recording_metadata.rb -lib/bandwidth-sdk/models/call_state.rb -lib/bandwidth-sdk/models/call_state_enum.rb -lib/bandwidth-sdk/models/callback_method_enum.rb -lib/bandwidth-sdk/models/code_request.rb -lib/bandwidth-sdk/models/conference.rb -lib/bandwidth-sdk/models/conference_completed_callback.rb -lib/bandwidth-sdk/models/conference_created_callback.rb -lib/bandwidth-sdk/models/conference_member.rb -lib/bandwidth-sdk/models/conference_member_exit_callback.rb -lib/bandwidth-sdk/models/conference_member_join_callback.rb -lib/bandwidth-sdk/models/conference_recording_available_callback.rb -lib/bandwidth-sdk/models/conference_recording_metadata.rb -lib/bandwidth-sdk/models/conference_redirect_callback.rb -lib/bandwidth-sdk/models/conference_state_enum.rb -lib/bandwidth-sdk/models/create_call.rb -lib/bandwidth-sdk/models/create_call_response.rb -lib/bandwidth-sdk/models/create_lookup_response.rb -lib/bandwidth-sdk/models/create_message_request_error.rb -lib/bandwidth-sdk/models/create_participant_request.rb -lib/bandwidth-sdk/models/create_participant_response.rb -lib/bandwidth-sdk/models/deferred_result.rb -lib/bandwidth-sdk/models/device_api_version_enum.rb -lib/bandwidth-sdk/models/disconenct_callback.rb -lib/bandwidth-sdk/models/diversion.rb -lib/bandwidth-sdk/models/dtmf_callback.rb -lib/bandwidth-sdk/models/field_error.rb -lib/bandwidth-sdk/models/file_format_enum.rb -lib/bandwidth-sdk/models/forbidden_request.rb -lib/bandwidth-sdk/models/gather_callback.rb -lib/bandwidth-sdk/models/initiate_callback.rb -lib/bandwidth-sdk/models/list_message_direction_enum.rb -lib/bandwidth-sdk/models/list_message_item.rb -lib/bandwidth-sdk/models/lookup_request.rb -lib/bandwidth-sdk/models/lookup_result.rb -lib/bandwidth-sdk/models/lookup_status.rb -lib/bandwidth-sdk/models/lookup_status_enum.rb -lib/bandwidth-sdk/models/machine_detection_complete_callback.rb -lib/bandwidth-sdk/models/machine_detection_configuration.rb -lib/bandwidth-sdk/models/machine_detection_mode_enum.rb -lib/bandwidth-sdk/models/media.rb -lib/bandwidth-sdk/models/message.rb -lib/bandwidth-sdk/models/message_direction_enum.rb -lib/bandwidth-sdk/models/message_request.rb -lib/bandwidth-sdk/models/message_status_enum.rb -lib/bandwidth-sdk/models/message_type_enum.rb -lib/bandwidth-sdk/models/messages_list.rb -lib/bandwidth-sdk/models/messaging_code_response.rb -lib/bandwidth-sdk/models/messaging_request_error.rb -lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb -lib/bandwidth-sdk/models/mfa_request_error.rb -lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb -lib/bandwidth-sdk/models/page_info.rb -lib/bandwidth-sdk/models/participant.rb -lib/bandwidth-sdk/models/participant_subscription.rb -lib/bandwidth-sdk/models/priority_enum.rb -lib/bandwidth-sdk/models/publish_permissions_enum.rb -lib/bandwidth-sdk/models/recording_available_callback.rb -lib/bandwidth-sdk/models/recording_complete_callback.rb -lib/bandwidth-sdk/models/recording_state_enum.rb -lib/bandwidth-sdk/models/redirect_callback.rb -lib/bandwidth-sdk/models/redirect_method_enum.rb -lib/bandwidth-sdk/models/request_error.rb -lib/bandwidth-sdk/models/session.rb -lib/bandwidth-sdk/models/stir_shaken.rb -lib/bandwidth-sdk/models/subscriptions.rb -lib/bandwidth-sdk/models/tag.rb -lib/bandwidth-sdk/models/tn_lookup_request_error.rb -lib/bandwidth-sdk/models/transcribe_recording.rb -lib/bandwidth-sdk/models/transcription.rb -lib/bandwidth-sdk/models/transcription_available_callback.rb -lib/bandwidth-sdk/models/transcription_list.rb -lib/bandwidth-sdk/models/transcription_metadata.rb -lib/bandwidth-sdk/models/transfer_answer_callback.rb -lib/bandwidth-sdk/models/transfer_complete_callback.rb -lib/bandwidth-sdk/models/transfer_disconnect_callback.rb -lib/bandwidth-sdk/models/unauthorized_request.rb -lib/bandwidth-sdk/models/update_call.rb -lib/bandwidth-sdk/models/update_call_recording.rb -lib/bandwidth-sdk/models/update_conference.rb -lib/bandwidth-sdk/models/update_conference_member.rb -lib/bandwidth-sdk/models/verify_code_request.rb -lib/bandwidth-sdk/models/verify_code_response.rb -lib/bandwidth-sdk/models/voice_api_error.rb -lib/bandwidth-sdk/models/voice_code_response.rb -lib/bandwidth-sdk/version.rb -spec/api/calls_api_spec.rb -spec/api/conferences_api_spec.rb -spec/api/media_api_spec.rb -spec/api/messages_api_spec.rb -spec/api/mfa_api_spec.rb -spec/api/participants_api_spec.rb -spec/api/phone_number_lookup_api_spec.rb -spec/api/recordings_api_spec.rb -spec/api/sessions_api_spec.rb -spec/api/statistics_api_spec.rb -spec/api_client_spec.rb -spec/configuration_spec.rb -spec/models/account_statistics_spec.rb -spec/models/answer_callback_spec.rb -spec/models/bridge_complete_callback_spec.rb -spec/models/bridge_target_complete_callback_spec.rb -spec/models/call_direction_enum_spec.rb -spec/models/call_recording_metadata_spec.rb -spec/models/call_state_enum_spec.rb -spec/models/call_state_spec.rb -spec/models/callback_method_enum_spec.rb -spec/models/code_request_spec.rb -spec/models/conference_completed_callback_spec.rb -spec/models/conference_created_callback_spec.rb -spec/models/conference_member_exit_callback_spec.rb -spec/models/conference_member_join_callback_spec.rb -spec/models/conference_member_spec.rb -spec/models/conference_recording_available_callback_spec.rb -spec/models/conference_recording_metadata_spec.rb -spec/models/conference_redirect_callback_spec.rb -spec/models/conference_spec.rb -spec/models/conference_state_enum_spec.rb -spec/models/create_call_response_spec.rb -spec/models/create_call_spec.rb -spec/models/create_lookup_response_spec.rb -spec/models/create_message_request_error_spec.rb -spec/models/create_participant_request_spec.rb -spec/models/create_participant_response_spec.rb -spec/models/deferred_result_spec.rb -spec/models/device_api_version_enum_spec.rb -spec/models/disconenct_callback_spec.rb -spec/models/diversion_spec.rb -spec/models/dtmf_callback_spec.rb -spec/models/field_error_spec.rb -spec/models/file_format_enum_spec.rb -spec/models/forbidden_request_spec.rb -spec/models/gather_callback_spec.rb -spec/models/initiate_callback_spec.rb -spec/models/list_message_direction_enum_spec.rb -spec/models/list_message_item_spec.rb -spec/models/lookup_request_spec.rb -spec/models/lookup_result_spec.rb -spec/models/lookup_status_enum_spec.rb -spec/models/lookup_status_spec.rb -spec/models/machine_detection_complete_callback_spec.rb -spec/models/machine_detection_configuration_spec.rb -spec/models/machine_detection_mode_enum_spec.rb -spec/models/media_spec.rb -spec/models/message_direction_enum_spec.rb -spec/models/message_request_spec.rb -spec/models/message_spec.rb -spec/models/message_status_enum_spec.rb -spec/models/message_type_enum_spec.rb -spec/models/messages_list_spec.rb -spec/models/messaging_code_response_spec.rb -spec/models/messaging_request_error_spec.rb -spec/models/mfa_forbidden_request_error_spec.rb -spec/models/mfa_request_error_spec.rb -spec/models/mfa_unauthorized_request_error_spec.rb -spec/models/page_info_spec.rb -spec/models/participant_spec.rb -spec/models/participant_subscription_spec.rb -spec/models/priority_enum_spec.rb -spec/models/publish_permissions_enum_spec.rb -spec/models/recording_available_callback_spec.rb -spec/models/recording_complete_callback_spec.rb -spec/models/recording_state_enum_spec.rb -spec/models/redirect_callback_spec.rb -spec/models/redirect_method_enum_spec.rb -spec/models/request_error_spec.rb -spec/models/session_spec.rb -spec/models/stir_shaken_spec.rb -spec/models/subscriptions_spec.rb -spec/models/tag_spec.rb -spec/models/tn_lookup_request_error_spec.rb -spec/models/transcribe_recording_spec.rb -spec/models/transcription_available_callback_spec.rb -spec/models/transcription_list_spec.rb -spec/models/transcription_metadata_spec.rb -spec/models/transcription_spec.rb -spec/models/transfer_answer_callback_spec.rb -spec/models/transfer_complete_callback_spec.rb -spec/models/transfer_disconnect_callback_spec.rb -spec/models/unauthorized_request_spec.rb -spec/models/update_call_recording_spec.rb -spec/models/update_call_spec.rb -spec/models/update_conference_member_spec.rb -spec/models/update_conference_spec.rb -spec/models/verify_code_request_spec.rb -spec/models/verify_code_response_spec.rb -spec/models/voice_api_error_spec.rb -spec/models/voice_code_response_spec.rb -spec/spec_helper.rb +.gitignore +.gitlab-ci.yml +.rspec +.rubocop.yml +.travis.yml +Gemfile +README.md +Rakefile +bandwidth-sdk.gemspec +docs/AccountStatistics.md +docs/AnswerCallback.md +docs/BridgeCompleteCallback.md +docs/BridgeTargetCompleteCallback.md +docs/CallDirectionEnum.md +docs/CallRecordingMetadata.md +docs/CallState.md +docs/CallStateEnum.md +docs/CallbackMethodEnum.md +docs/CallsApi.md +docs/CodeRequest.md +docs/Conference.md +docs/ConferenceCompletedCallback.md +docs/ConferenceCreatedCallback.md +docs/ConferenceMember.md +docs/ConferenceMemberExitCallback.md +docs/ConferenceMemberJoinCallback.md +docs/ConferenceRecordingAvailableCallback.md +docs/ConferenceRecordingMetadata.md +docs/ConferenceRedirectCallback.md +docs/ConferenceStateEnum.md +docs/ConferencesApi.md +docs/CreateCall.md +docs/CreateCallResponse.md +docs/CreateLookupResponse.md +docs/CreateMessageRequestError.md +docs/DeferredResult.md +docs/DisconenctCallback.md +docs/Diversion.md +docs/DtmfCallback.md +docs/FieldError.md +docs/FileFormatEnum.md +docs/GatherCallback.md +docs/InboundMessageCallback.md +docs/InboundMessageCallbackMessage.md +docs/InitiateCallback.md +docs/ListMessageDirectionEnum.md +docs/ListMessageItem.md +docs/LookupRequest.md +docs/LookupResult.md +docs/LookupStatus.md +docs/LookupStatusEnum.md +docs/MFAApi.md +docs/MachineDetectionCompleteCallback.md +docs/MachineDetectionConfiguration.md +docs/MachineDetectionModeEnum.md +docs/Media.md +docs/MediaApi.md +docs/Message.md +docs/MessageDeliveredCallback.md +docs/MessageDeliveredCallbackMessage.md +docs/MessageDirectionEnum.md +docs/MessageFailedCallback.md +docs/MessageFailedCallbackMessage.md +docs/MessageRequest.md +docs/MessageSendingCallback.md +docs/MessageSendingCallbackMessage.md +docs/MessageStatusEnum.md +docs/MessageTypeEnum.md +docs/MessagesApi.md +docs/MessagesList.md +docs/MessagingCodeResponse.md +docs/MessagingRequestError.md +docs/MfaForbiddenRequestError.md +docs/MfaRequestError.md +docs/MfaUnauthorizedRequestError.md +docs/PageInfo.md +docs/PhoneNumberLookupApi.md +docs/PriorityEnum.md +docs/RecordingAvailableCallback.md +docs/RecordingCompleteCallback.md +docs/RecordingStateEnum.md +docs/RecordingsApi.md +docs/RedirectCallback.md +docs/RedirectMethodEnum.md +docs/StatisticsApi.md +docs/StirShaken.md +docs/Tag.md +docs/TnLookupRequestError.md +docs/TranscribeRecording.md +docs/Transcription.md +docs/TranscriptionAvailableCallback.md +docs/TranscriptionList.md +docs/TranscriptionMetadata.md +docs/TransferAnswerCallback.md +docs/TransferCompleteCallback.md +docs/TransferDisconnectCallback.md +docs/UpdateCall.md +docs/UpdateCallRecording.md +docs/UpdateConference.md +docs/UpdateConferenceMember.md +docs/VerifyCodeRequest.md +docs/VerifyCodeResponse.md +docs/VoiceApiError.md +docs/VoiceCodeResponse.md +git_push.sh +lib/bandwidth-sdk.rb +lib/bandwidth-sdk/api/calls_api.rb +lib/bandwidth-sdk/api/conferences_api.rb +lib/bandwidth-sdk/api/media_api.rb +lib/bandwidth-sdk/api/messages_api.rb +lib/bandwidth-sdk/api/mfa_api.rb +lib/bandwidth-sdk/api/phone_number_lookup_api.rb +lib/bandwidth-sdk/api/recordings_api.rb +lib/bandwidth-sdk/api/statistics_api.rb +lib/bandwidth-sdk/api_client.rb +lib/bandwidth-sdk/api_error.rb +lib/bandwidth-sdk/configuration.rb +lib/bandwidth-sdk/models/account_statistics.rb +lib/bandwidth-sdk/models/answer_callback.rb +lib/bandwidth-sdk/models/bridge_complete_callback.rb +lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +lib/bandwidth-sdk/models/call_direction_enum.rb +lib/bandwidth-sdk/models/call_recording_metadata.rb +lib/bandwidth-sdk/models/call_state.rb +lib/bandwidth-sdk/models/call_state_enum.rb +lib/bandwidth-sdk/models/callback_method_enum.rb +lib/bandwidth-sdk/models/code_request.rb +lib/bandwidth-sdk/models/conference.rb +lib/bandwidth-sdk/models/conference_completed_callback.rb +lib/bandwidth-sdk/models/conference_created_callback.rb +lib/bandwidth-sdk/models/conference_member.rb +lib/bandwidth-sdk/models/conference_member_exit_callback.rb +lib/bandwidth-sdk/models/conference_member_join_callback.rb +lib/bandwidth-sdk/models/conference_recording_available_callback.rb +lib/bandwidth-sdk/models/conference_recording_metadata.rb +lib/bandwidth-sdk/models/conference_redirect_callback.rb +lib/bandwidth-sdk/models/conference_state_enum.rb +lib/bandwidth-sdk/models/create_call.rb +lib/bandwidth-sdk/models/create_call_response.rb +lib/bandwidth-sdk/models/create_lookup_response.rb +lib/bandwidth-sdk/models/create_message_request_error.rb +lib/bandwidth-sdk/models/deferred_result.rb +lib/bandwidth-sdk/models/disconenct_callback.rb +lib/bandwidth-sdk/models/diversion.rb +lib/bandwidth-sdk/models/dtmf_callback.rb +lib/bandwidth-sdk/models/field_error.rb +lib/bandwidth-sdk/models/file_format_enum.rb +lib/bandwidth-sdk/models/gather_callback.rb +lib/bandwidth-sdk/models/inbound_message_callback.rb +lib/bandwidth-sdk/models/inbound_message_callback_message.rb +lib/bandwidth-sdk/models/initiate_callback.rb +lib/bandwidth-sdk/models/list_message_direction_enum.rb +lib/bandwidth-sdk/models/list_message_item.rb +lib/bandwidth-sdk/models/lookup_request.rb +lib/bandwidth-sdk/models/lookup_result.rb +lib/bandwidth-sdk/models/lookup_status.rb +lib/bandwidth-sdk/models/lookup_status_enum.rb +lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +lib/bandwidth-sdk/models/machine_detection_configuration.rb +lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +lib/bandwidth-sdk/models/media.rb +lib/bandwidth-sdk/models/message.rb +lib/bandwidth-sdk/models/message_delivered_callback.rb +lib/bandwidth-sdk/models/message_delivered_callback_message.rb +lib/bandwidth-sdk/models/message_direction_enum.rb +lib/bandwidth-sdk/models/message_failed_callback.rb +lib/bandwidth-sdk/models/message_failed_callback_message.rb +lib/bandwidth-sdk/models/message_request.rb +lib/bandwidth-sdk/models/message_sending_callback.rb +lib/bandwidth-sdk/models/message_sending_callback_message.rb +lib/bandwidth-sdk/models/message_status_enum.rb +lib/bandwidth-sdk/models/message_type_enum.rb +lib/bandwidth-sdk/models/messages_list.rb +lib/bandwidth-sdk/models/messaging_code_response.rb +lib/bandwidth-sdk/models/messaging_request_error.rb +lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +lib/bandwidth-sdk/models/mfa_request_error.rb +lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +lib/bandwidth-sdk/models/page_info.rb +lib/bandwidth-sdk/models/priority_enum.rb +lib/bandwidth-sdk/models/recording_available_callback.rb +lib/bandwidth-sdk/models/recording_complete_callback.rb +lib/bandwidth-sdk/models/recording_state_enum.rb +lib/bandwidth-sdk/models/redirect_callback.rb +lib/bandwidth-sdk/models/redirect_method_enum.rb +lib/bandwidth-sdk/models/stir_shaken.rb +lib/bandwidth-sdk/models/tag.rb +lib/bandwidth-sdk/models/tn_lookup_request_error.rb +lib/bandwidth-sdk/models/transcribe_recording.rb +lib/bandwidth-sdk/models/transcription.rb +lib/bandwidth-sdk/models/transcription_available_callback.rb +lib/bandwidth-sdk/models/transcription_list.rb +lib/bandwidth-sdk/models/transcription_metadata.rb +lib/bandwidth-sdk/models/transfer_answer_callback.rb +lib/bandwidth-sdk/models/transfer_complete_callback.rb +lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +lib/bandwidth-sdk/models/update_call.rb +lib/bandwidth-sdk/models/update_call_recording.rb +lib/bandwidth-sdk/models/update_conference.rb +lib/bandwidth-sdk/models/update_conference_member.rb +lib/bandwidth-sdk/models/verify_code_request.rb +lib/bandwidth-sdk/models/verify_code_response.rb +lib/bandwidth-sdk/models/voice_api_error.rb +lib/bandwidth-sdk/models/voice_code_response.rb +lib/bandwidth-sdk/version.rb +spec/api_client_spec.rb +spec/configuration_spec.rb +spec/spec_helper.rb diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 4ac4fded..e7e42a4b 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.2.0 \ No newline at end of file +6.3.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index baa968ef..2e321fcc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,9 @@ language: ruby cache: bundler rvm: - - 2.3 - - 2.4 - - 2.5 - - 2.6 - 2.7 - 3.0 + - 3.1 script: - bundle install --path vendor/bundle - bundle exec rspec diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..1761ea14 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,74 @@ +PATH + remote: . + specs: + bandwidth-sdk (11.0.0) + faraday (>= 1.0.1, < 3.0) + faraday-multipart + +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.2) + byebug (11.1.3) + coderay (1.1.3) + diff-lcs (1.5.0) + faraday (2.7.4) + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (3.0.2) + jaro_winkler (1.5.4) + method_source (1.0.0) + multipart-post (2.3.0) + parallel (1.22.1) + parser (3.2.0.0) + ast (~> 2.4.1) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-byebug (3.10.1) + byebug (~> 11.0) + pry (>= 0.13, < 0.15) + psych (5.0.2) + stringio + rainbow (3.1.1) + rake (13.0.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.0) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.0) + rubocop (0.66.0) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.5, != 2.5.1.1) + psych (>= 3.1.0) + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 1.6) + ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) + stringio (3.0.4) + unicode-display_width (1.5.0) + +PLATFORMS + arm64-darwin-22 + +DEPENDENCIES + bandwidth-sdk! + pry-byebug + rake (~> 13.0.1) + rspec (~> 3.6, >= 3.6.0) + rubocop (~> 0.66.0) + +BUNDLED WITH + 2.3.26 diff --git a/README.md b/README.md index d1938519..7bf4a24e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ # bandwidth-sdk +[![Test](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test.yml) + + +| **OS** | **Ruby** | +|:---:|:---:| +| Windows 2019 | 2.7, 3.0, 3.1, 3.2 | +| Windows 2022 | 2.7, 3.0, 3.1, 3.2 | +| Ubuntu 20.04 | 2.7, 3.0, 3.1, 3.2 | +| Ubuntu 22.04 | 2.7, 3.0, 3.1, 3.2 | + Bandwidth - the Ruby gem for the Bandwidth Bandwidth's Communication APIs @@ -106,9 +116,6 @@ Class | Method | HTTP request | Description *Bandwidth::MediaApi* | [**upload_media**](docs/MediaApi.md#upload_media) | **PUT** /users/{accountId}/media/{mediaId} | Upload Media *Bandwidth::MessagesApi* | [**create_message**](docs/MessagesApi.md#create_message) | **POST** /users/{accountId}/messages | Create Message *Bandwidth::MessagesApi* | [**list_messages**](docs/MessagesApi.md#list_messages) | **GET** /users/{accountId}/messages | List Messages -*Bandwidth::ParticipantsApi* | [**create_participant**](docs/ParticipantsApi.md#create_participant) | **POST** /accounts/{accountId}/participants | Create Participant -*Bandwidth::ParticipantsApi* | [**delete_participant**](docs/ParticipantsApi.md#delete_participant) | **DELETE** /accounts/{accountId}/participants/{participantId} | Delete Participant -*Bandwidth::ParticipantsApi* | [**get_participant**](docs/ParticipantsApi.md#get_participant) | **GET** /accounts/{accountId}/participants/{participantId} | Get Participant *Bandwidth::PhoneNumberLookupApi* | [**create_lookup**](docs/PhoneNumberLookupApi.md#create_lookup) | **POST** /accounts/{accountId}/tnlookup | Create Lookup *Bandwidth::PhoneNumberLookupApi* | [**get_lookup_status**](docs/PhoneNumberLookupApi.md#get_lookup_status) | **GET** /accounts/{accountId}/tnlookup/{requestId} | Get Lookup Request Status *Bandwidth::RecordingsApi* | [**delete_call_transcription**](docs/RecordingsApi.md#delete_call_transcription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription @@ -121,14 +128,6 @@ Class | Method | HTTP request | Description *Bandwidth::RecordingsApi* | [**list_call_recordings**](docs/RecordingsApi.md#list_call_recordings) | **GET** /accounts/{accountId}/calls/{callId}/recordings | List Call Recordings *Bandwidth::RecordingsApi* | [**transcribe_call_recording**](docs/RecordingsApi.md#transcribe_call_recording) | **POST** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Create Transcription Request *Bandwidth::RecordingsApi* | [**update_call_recording_state**](docs/RecordingsApi.md#update_call_recording_state) | **PUT** /accounts/{accountId}/calls/{callId}/recording | Update Recording -*Bandwidth::SessionsApi* | [**add_participant_to_session**](docs/SessionsApi.md#add_participant_to_session) | **PUT** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId} | Add Participant to Session -*Bandwidth::SessionsApi* | [**create_session**](docs/SessionsApi.md#create_session) | **POST** /accounts/{accountId}/sessions | Create Session -*Bandwidth::SessionsApi* | [**delete_session**](docs/SessionsApi.md#delete_session) | **DELETE** /accounts/{accountId}/sessions/{sessionId} | Delete Session -*Bandwidth::SessionsApi* | [**get_participant_subscriptions**](docs/SessionsApi.md#get_participant_subscriptions) | **GET** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions | Get Participant Subscriptions -*Bandwidth::SessionsApi* | [**get_session**](docs/SessionsApi.md#get_session) | **GET** /accounts/{accountId}/sessions/{sessionId} | Get Session -*Bandwidth::SessionsApi* | [**list_session_participants**](docs/SessionsApi.md#list_session_participants) | **GET** /accounts/{accountId}/sessions/{sessionId}/participants | List Participants in Session -*Bandwidth::SessionsApi* | [**remove_participant_from_session**](docs/SessionsApi.md#remove_participant_from_session) | **DELETE** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId} | Remove Participant from Session -*Bandwidth::SessionsApi* | [**update_participant_subscriptions**](docs/SessionsApi.md#update_participant_subscriptions) | **PUT** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions | Update Participant Subscriptions *Bandwidth::StatisticsApi* | [**get_statistics**](docs/StatisticsApi.md#get_statistics) | **GET** /accounts/{accountId}/statistics | Get Account Statistics @@ -158,17 +157,15 @@ Class | Method | HTTP request | Description - [Bandwidth::CreateCallResponse](docs/CreateCallResponse.md) - [Bandwidth::CreateLookupResponse](docs/CreateLookupResponse.md) - [Bandwidth::CreateMessageRequestError](docs/CreateMessageRequestError.md) - - [Bandwidth::CreateParticipantRequest](docs/CreateParticipantRequest.md) - - [Bandwidth::CreateParticipantResponse](docs/CreateParticipantResponse.md) - [Bandwidth::DeferredResult](docs/DeferredResult.md) - - [Bandwidth::DeviceApiVersionEnum](docs/DeviceApiVersionEnum.md) - [Bandwidth::DisconenctCallback](docs/DisconenctCallback.md) - [Bandwidth::Diversion](docs/Diversion.md) - [Bandwidth::DtmfCallback](docs/DtmfCallback.md) - [Bandwidth::FieldError](docs/FieldError.md) - [Bandwidth::FileFormatEnum](docs/FileFormatEnum.md) - - [Bandwidth::ForbiddenRequest](docs/ForbiddenRequest.md) - [Bandwidth::GatherCallback](docs/GatherCallback.md) + - [Bandwidth::InboundMessageCallback](docs/InboundMessageCallback.md) + - [Bandwidth::InboundMessageCallbackMessage](docs/InboundMessageCallbackMessage.md) - [Bandwidth::InitiateCallback](docs/InitiateCallback.md) - [Bandwidth::ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md) - [Bandwidth::ListMessageItem](docs/ListMessageItem.md) @@ -181,8 +178,14 @@ Class | Method | HTTP request | Description - [Bandwidth::MachineDetectionModeEnum](docs/MachineDetectionModeEnum.md) - [Bandwidth::Media](docs/Media.md) - [Bandwidth::Message](docs/Message.md) + - [Bandwidth::MessageDeliveredCallback](docs/MessageDeliveredCallback.md) + - [Bandwidth::MessageDeliveredCallbackMessage](docs/MessageDeliveredCallbackMessage.md) - [Bandwidth::MessageDirectionEnum](docs/MessageDirectionEnum.md) + - [Bandwidth::MessageFailedCallback](docs/MessageFailedCallback.md) + - [Bandwidth::MessageFailedCallbackMessage](docs/MessageFailedCallbackMessage.md) - [Bandwidth::MessageRequest](docs/MessageRequest.md) + - [Bandwidth::MessageSendingCallback](docs/MessageSendingCallback.md) + - [Bandwidth::MessageSendingCallbackMessage](docs/MessageSendingCallbackMessage.md) - [Bandwidth::MessageStatusEnum](docs/MessageStatusEnum.md) - [Bandwidth::MessageTypeEnum](docs/MessageTypeEnum.md) - [Bandwidth::MessagesList](docs/MessagesList.md) @@ -192,19 +195,13 @@ Class | Method | HTTP request | Description - [Bandwidth::MfaRequestError](docs/MfaRequestError.md) - [Bandwidth::MfaUnauthorizedRequestError](docs/MfaUnauthorizedRequestError.md) - [Bandwidth::PageInfo](docs/PageInfo.md) - - [Bandwidth::Participant](docs/Participant.md) - - [Bandwidth::ParticipantSubscription](docs/ParticipantSubscription.md) - [Bandwidth::PriorityEnum](docs/PriorityEnum.md) - - [Bandwidth::PublishPermissionsEnum](docs/PublishPermissionsEnum.md) - [Bandwidth::RecordingAvailableCallback](docs/RecordingAvailableCallback.md) - [Bandwidth::RecordingCompleteCallback](docs/RecordingCompleteCallback.md) - [Bandwidth::RecordingStateEnum](docs/RecordingStateEnum.md) - [Bandwidth::RedirectCallback](docs/RedirectCallback.md) - [Bandwidth::RedirectMethodEnum](docs/RedirectMethodEnum.md) - - [Bandwidth::RequestError](docs/RequestError.md) - - [Bandwidth::Session](docs/Session.md) - [Bandwidth::StirShaken](docs/StirShaken.md) - - [Bandwidth::Subscriptions](docs/Subscriptions.md) - [Bandwidth::Tag](docs/Tag.md) - [Bandwidth::TnLookupRequestError](docs/TnLookupRequestError.md) - [Bandwidth::TranscribeRecording](docs/TranscribeRecording.md) @@ -215,7 +212,6 @@ Class | Method | HTTP request | Description - [Bandwidth::TransferAnswerCallback](docs/TransferAnswerCallback.md) - [Bandwidth::TransferCompleteCallback](docs/TransferCompleteCallback.md) - [Bandwidth::TransferDisconnectCallback](docs/TransferDisconnectCallback.md) - - [Bandwidth::UnauthorizedRequest](docs/UnauthorizedRequest.md) - [Bandwidth::UpdateCall](docs/UpdateCall.md) - [Bandwidth::UpdateCallRecording](docs/UpdateCallRecording.md) - [Bandwidth::UpdateConference](docs/UpdateConference.md) diff --git a/Rakefile b/Rakefile index c72ca30d..37e0ead6 100644 --- a/Rakefile +++ b/Rakefile @@ -3,7 +3,19 @@ require "bundler/gem_tasks" begin require 'rspec/core/rake_task' + desc 'Run All Tests' RSpec::Core::RakeTask.new(:spec) + + desc 'Run Only Unit Tests' + RSpec::Core::RakeTask.new(:unit) do |t| + t.pattern = './spec/unit/**/*_spec.rb' + end + + desc 'Run Only Integration Tests' + RSpec::Core::RakeTask.new(:integration) do |t| + t.pattern = './spec/integration/*_spec.rb' + end + task default: :spec rescue LoadError # no rspec available diff --git a/bandwidth-sdk.gemspec b/bandwidth-sdk.gemspec index b3102277..11e7edb9 100644 --- a/bandwidth-sdk.gemspec +++ b/bandwidth-sdk.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -25,7 +25,7 @@ Gem::Specification.new do |s| s.summary = "Bandwidth Ruby SDK" s.description = "The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs" s.license = "MIT" - s.required_ruby_version = ">=2.4" + s.required_ruby_version = ">=2.7" s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0' s.add_runtime_dependency 'faraday-multipart' diff --git a/bandwidth.yml b/bandwidth.yml index 797ca0dd..2b1997e4 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -18,8 +18,6 @@ tags: - name: Statistics - name: MFA - name: Phone Number Lookup - - name: Participants - - name: Sessions paths: /users/{accountId}/media: get: @@ -85,6 +83,10 @@ paths: some control to your media file. + If a file is uploaded with the same name as a file that already exists + under this account, the previous file will be overwritten. + + A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). operationId: uploadMedia @@ -214,6 +216,11 @@ paths: $ref: '#/components/responses/messagingTooManyRequestsError' '500': $ref: '#/components/responses/messagingInternalServerError' + callbacks: + inboundCallback: + $ref: '#/components/callbacks/inboundCallback' + statusCallback: + $ref: '#/components/callbacks/statusCallback' servers: *ref_0 /accounts/{accountId}/calls: post: @@ -1164,296 +1171,6 @@ paths: '500': $ref: '#/components/responses/tnLookupInternalServerError' servers: *ref_3 - /accounts/{accountId}/participants: - post: - tags: - - Participants - summary: Create Participant - description: >- - Create a new participant under this account. Participants are - idempotent, so relevant parameters must be set in this function if - desired. - operationId: createParticipant - parameters: - - $ref: '#/components/parameters/accountId4' - requestBody: - $ref: '#/components/requestBodies/createParticipantRequest' - responses: - '200': - $ref: '#/components/responses/createParticipantResponse' - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: &ref_4 - - url: https://api.webrtc.bandwidth.com/v1 - description: Production - /accounts/{accountId}/participants/{participantId}: - get: - tags: - - Participants - summary: Get Participant - description: Get participant by ID. - operationId: getParticipant - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/participantId' - responses: - '200': - $ref: '#/components/responses/getParticipantResponse' - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - delete: - tags: - - Participants - summary: Delete Participant - description: Delete participant by ID. - operationId: deleteParticipant - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/participantId' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 - /accounts/{accountId}/sessions: - post: - tags: - - Sessions - summary: Create Session - description: >- - Create a new session. Sessions are idempotent, so relevant parameters - must be set in this function if desired. - operationId: createSession - parameters: - - $ref: '#/components/parameters/accountId4' - requestBody: - $ref: '#/components/requestBodies/createSessionRequest' - responses: - '200': - $ref: '#/components/responses/sessionResponse' - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 - /accounts/{accountId}/sessions/{sessionId}: - get: - tags: - - Sessions - summary: Get Session - description: Get session by ID. - operationId: getSession - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - responses: - '200': - $ref: '#/components/responses/sessionResponse' - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - delete: - tags: - - Sessions - summary: Delete Session - description: Delete session by ID. - operationId: deleteSession - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 - /accounts/{accountId}/sessions/{sessionId}/participants: - get: - tags: - - Sessions - summary: List Participants in Session - description: List participants in a session. - operationId: listSessionParticipants - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - responses: - '200': - $ref: '#/components/responses/listSessionParticipantsResponse' - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 - /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}: - put: - tags: - - Sessions - summary: Add Participant to Session - description: | - Add a participant to a session. - - Subscriptions can optionally be provided as part of this call. - operationId: addParticipantToSession - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - - $ref: '#/components/parameters/participantId' - requestBody: - $ref: '#/components/requestBodies/addParticipantToSessionRequest' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '409': - $ref: '#/components/responses/webrtcConflictError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - delete: - tags: - - Sessions - summary: Remove Participant from Session - description: >- - Remove a participant from a session. This will automatically remove any - subscriptions the participant has associated with this session. - operationId: removeParticipantFromSession - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - - $ref: '#/components/parameters/participantId' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 - /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions: - get: - tags: - - Sessions - summary: Get Participant Subscriptions - description: Get a participant's subscriptions. - operationId: getParticipantSubscriptions - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - - $ref: '#/components/parameters/participantId' - responses: - '200': - $ref: '#/components/responses/getParticipantSubscriptionsResponse' - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - put: - tags: - - Sessions - summary: Update Participant Subscriptions - description: >- - Update a participant's subscriptions. This is a full update that will - replace the participant's subscriptions. It allows subscription to the - entire Session, a subset list of Participants in that Session, or - specific media streams on any of the listed Participants. - - First call `getParticipantSubscriptions` if you need the current - subscriptions. - - Calling this API with no `Subscriptions` object to remove all - subscriptions. - operationId: updateParticipantSubscriptions - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - - $ref: '#/components/parameters/participantId' - requestBody: - $ref: '#/components/requestBodies/updateParticipantSubscriptionsRequest' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 components: schemas: priorityEnum: @@ -1768,9 +1485,12 @@ components: items: type: string format: uri + maxLength: 4096 description: >- A list of URLs to include as media attachments as part of the message. + + Each URL can be at most 4096 characters. example: - https://dev.bandwidth.com/images/bandwidth-logo.png - https://dev.bandwidth.com/images/github_logo.png @@ -1789,6 +1509,335 @@ components: automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. example: '2021-02-01T11:29:18-05:00' + inboundMessageCallback: + description: Inbound Message Callback + type: object + properties: + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + type: + type: string + example: message-received + to: + type: string + example: '+15552223333' + description: + type: string + example: Incoming message received + message: + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string + example: Hello world + tag: + type: string + example: custom string + media: + type: array + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text + required: + - time + - type + - to + - description + - message + messageSendingCallback: + type: object + description: Message Sending Callback + properties: + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + type: + type: string + example: message-sending + to: + type: string + example: '+15552223333' + description: + type: string + example: Message is sending to carrier + message: + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string + example: '' + tag: + type: string + example: custom string + media: + type: array + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text + - media + - priority + required: + - time + - type + - to + - description + - message + messageDeliveredCallback: + description: Message Delivered Callback + type: object + properties: + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + type: + type: string + example: message-delivered + to: + type: string + example: '+15552223333' + description: + type: string + example: Message delivered to carrier. + message: + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string + example: '' + tag: + type: string + example: custom string + media: + type: array + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text + - tag + required: + - time + - type + - to + - description + - message + messageFailedCallback: + description: Message Failed Callback + type: object + properties: + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + type: + type: string + example: message-failed + to: + type: string + example: '+15552223333' + description: + type: string + example: rejected-unallocated-from-number + message: + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string + example: '' + tag: + type: string + example: custom string + media: + type: array + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text + - tag + - priority + errorCode: + type: integer + example: 9902 + required: + - time + - type + - to + - description + - message + - errorCode callbackMethodEnum: type: string nullable: true @@ -4254,193 +4303,6 @@ components: type: string description: A description of what validation error occurred. example: example error message - publishPermissionsEnum: - type: string - enum: - - AUDIO - - VIDEO - deviceApiVersionEnum: - type: string - description: Optional field to define the device api version of this participant. - example: V3 - default: V3 - enum: - - V3 - session: - type: object - description: Session object. - properties: - id: - type: string - description: Unique id of the session. - example: 75c21163-e110-41bc-bd76-1bb428ec85d5 - tag: - type: string - description: User defined tag to associate with the session. - example: session1 - participant: - type: object - description: Participant object. - properties: - id: - type: string - description: Unique id of the participant. - readOnly: true - example: 320e2af6-13ec-498d-8b51-daba52c37853 - callbackUrl: - type: string - nullable: true - description: Full callback url to use for notifications about this participant. - example: https://example.com/callback - publishPermissions: - type: array - description: Defines if this participant can publish audio or video. - example: - - VIDEO - - AUDIO - uniqueItems: true - items: - $ref: '#/components/schemas/publishPermissionsEnum' - sessions: - type: array - description: |- - List of session ids this participant is associated with - - Capped to one - - Upon creation of a Participant, returns as an empty array. - example: - - 75c21163-e110-41bc-bd76-1bb428ec85d5 - readOnly: true - items: - type: string - subscriptions: - $ref: '#/components/schemas/subscriptions' - tag: - type: string - description: User defined tag to associate with the participant. - example: participant1 - deviceApiVersion: - $ref: '#/components/schemas/deviceApiVersionEnum' - createParticipantResponse: - type: object - description: Response generated when a Participant is created. - properties: - participant: - $ref: '#/components/schemas/participant' - token: - type: string - example: >- - eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiaWF0IjoxNTE2MjM5MDIyfQ.L8i6g3PfcHlioHCCPURC9pmXT7gdJpx3kOoyAfNUwCc - description: >- - Auth token for the returned participant. This should be passed to - the participant so that they can connect to the platform. - createParticipantRequest: - type: object - description: Create a participant request. - properties: - callbackUrl: - type: string - nullable: true - description: Full callback url to use for notifications about this participant. - example: https://example.com/callback - publishPermissions: - type: array - description: Defines if this participant can publish audio or video. - example: - - VIDEO - - AUDIO - uniqueItems: true - items: - $ref: '#/components/schemas/publishPermissionsEnum' - tag: - type: string - description: User defined tag to associate with the participant. - example: participant1 - deviceApiVersion: - $ref: '#/components/schemas/deviceApiVersionEnum' - subscriptions: - type: object - readOnly: true - properties: - sessionId: - type: string - description: >- - If present, and not overridden by the array of participants, it - represents the session the subscriptions are associated with. If - this is the only field, the subscriber will be subscribed to all - participants in the session (including any participants that are - later added to the session). Upon creation of a Participant, returns - as an empty object. - example: d8886aad-b956-4e1b-b2f4-d7c9f8162772 - participants: - type: array - description: >- - (optional) A list of participants in the session that will be - subscribed to. If present and not empty or null, this will - override any sessionId specified in the body. Returns empty if used - during the creation of a Participant. - example: - - participantId: 568749d5-04d5-483d-adf5-deac7dd3d521 - - participantId: 0275e47f-dd21-4cf0-a1e1-dfdc719e73a7 - streamAliases: - - alias_1 - - alias_2 - items: - $ref: '#/components/schemas/participantSubscription' - participantSubscription: - type: object - required: - - participantId - properties: - participantId: - type: string - description: The Participant the subscriber will be subscribed to - example: 568749d5-04d5-483d-adf5-deac7dd3d521 - streamAliases: - type: array - description: >- - (optional) An array of specific streamAliases owned by the - Participant that the subscriber will be subscribed to. Background: A - streamAlias is created by a WebRTC client when it connects and - declares a name for the related stream. The client is responsible - for informing the application of any created streamAliases to enable - the application to subscribe to specific streamAliases. Subscribing - to a `streamAlias` that does not exist is undefined. If the array is - empty all aliases are assumed. - example: - - alias_1 - - alias_2 - uniqueItems: true - items: - type: string - requestError: - type: object - properties: - error: - type: string - description: A message describing the error with your request. - example: Internal error - requestId: - type: string - description: The associated requestId from AWS. - example: 12af78d1-5f88-4917-925d-17c1ac8fda7a - unauthorizedRequest: - type: object - properties: - message: - type: string - description: Unauthorized - example: Unauthorized - forbiddenRequest: - type: object - properties: - message: - type: string - description: >- - The message containing the reason behind the request being - forbidden. - example: Missing Authentication Token responses: createMessageResponse: description: Accepted @@ -4857,80 +4719,6 @@ components: summary: Example Internal Server Error Error value: message: Request has not been passed further. - createParticipantResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/createParticipantResponse' - getParticipantResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/participant' - sessionResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/session' - listSessionParticipantsResponse: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/participant' - getParticipantSubscriptionsResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/subscriptions' - webrtcBadRequestError: - description: Bad Request - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/requestError' - webrtcUnauthorizedError: - description: Unauthorized - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/unauthorizedRequest' - webrtcForbiddenError: - description: Forbidden - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/forbiddenRequest' - webrtcNotFoundError: - description: Not Found - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/requestError' - webrtcConflictError: - description: Conflict - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/requestError' - webrtcInternalServerError: - description: Internal Server Error - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/requestError' parameters: accountId: in: path @@ -5254,30 +5042,6 @@ components: type: string description: The phone number lookup request ID from Bandwidth. example: 004223a0-8b17-41b1-bf81-20732adf5590 - accountId4: - name: accountId - in: path - description: Account ID - required: true - schema: - type: string - example: '9900000' - sessionId: - name: sessionId - in: path - description: Session ID - required: true - schema: - type: string - example: cb5054ee-a69b-41ac-9ab2-04d6370826b4 - participantId: - name: participantId - in: path - description: Participant ID - required: true - schema: - type: string - example: 62e0ecb9-0b1b-5115-aae4-4f36123d6bb1 requestBodies: createMessageRequest: content: @@ -5567,55 +5331,6 @@ components: $ref: '#/components/examples/singleNumberRequestExample' multipleNumberRequestExample: $ref: '#/components/examples/multipleNumberRequestExample' - createParticipantRequest: - description: Create participant request body. - content: - application/json: - schema: - $ref: '#/components/schemas/createParticipantRequest' - createSessionRequest: - description: Create session request body. - content: - application/json: - schema: - $ref: '#/components/schemas/session' - addParticipantToSessionRequest: - description: >- - The Body describes an optional set of subscriptions to apply to the - participant. - - - Calling this endpoint with no/empty body will only add the participant - to the session, and will not subscribe the Participant to any media. - - - The request body for this endpoint is OPTIONAL and provided as a - convenience to avoid additional calls to the Update Participant - Subscriptions endpoint. --- If a body is provided it will result in - direct control over what Participants are subscribed to. - - - if the participants Array is provided and not empty, that list of Participants will be subscribed To - - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created - required: false - content: - application/json: - schema: - $ref: '#/components/schemas/subscriptions' - updateParticipantSubscriptionsRequest: - description: >- - The body describes the desired subscriptions for the Participant. --- If - a body is provided it will result in direct control over what - Participants are subscribed to. - - - if the participants Array is provided and not empty, that list of Participants will be subscribed To - - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created - required: false - content: - application/json: - schema: - $ref: '#/components/schemas/subscriptions' securitySchemes: Basic: type: http @@ -5626,6 +5341,37 @@ components: header that contains the word Basic followed by a space and a base64-encoded string `username:password`Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==` + callbacks: + inboundCallback: + '{inboundCallbackUrl}': + post: + requestBody: + required: true + description: Inbound Message Callback Payload + content: + application/json: + schema: + $ref: '#/components/schemas/inboundMessageCallback' + responses: + '200': + description: OK + statusCallback: + '{statusCallbackUrl}': + post: + requestBody: + required: true + description: Status Callback Payload + content: + application/json: + schema: + type: object + oneOf: + - $ref: '#/components/schemas/messageSendingCallback' + - $ref: '#/components/schemas/messageDeliveredCallback' + - $ref: '#/components/schemas/messageFailedCallback' + responses: + '200': + description: OK examples: createCallResponseExample: summary: Example of a createCall Response @@ -5795,4 +5541,4 @@ components: Message: NXDOMAIN E.164 Format: '+19195550000' Formatted: (919) 555-0000 - Country: US \ No newline at end of file + Country: US diff --git a/docs/InboundMessageCallback.md b/docs/InboundMessageCallback.md new file mode 100644 index 00000000..73d327f0 --- /dev/null +++ b/docs/InboundMessageCallback.md @@ -0,0 +1,26 @@ +# Bandwidth::InboundMessageCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **time** | **Time** | | | +| **type** | **String** | | | +| **to** | **String** | | | +| **description** | **String** | | | +| **message** | [**InboundMessageCallbackMessage**](InboundMessageCallbackMessage.md) | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::InboundMessageCallback.new( + time: 2016-09-14T18:20:16Z, + type: message-received, + to: +15552223333, + description: Incoming message received, + message: null +) +``` + diff --git a/docs/InboundMessageCallbackMessage.md b/docs/InboundMessageCallbackMessage.md new file mode 100644 index 00000000..4ef3b41f --- /dev/null +++ b/docs/InboundMessageCallbackMessage.md @@ -0,0 +1,40 @@ +# Bandwidth::InboundMessageCallbackMessage + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | | +| **owner** | **String** | | | +| **application_id** | **String** | | | +| **time** | **Time** | | | +| **segment_count** | **Integer** | | | +| **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | | +| **to** | **Array<String>** | | | +| **from** | **String** | | | +| **text** | **String** | | | +| **tag** | **String** | | [optional] | +| **media** | **Array<String>** | | [optional] | +| **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::InboundMessageCallbackMessage.new( + id: 1661365814859loidf7mcwd4qacn7, + owner: +15553332222, + application_id: 93de2206-9669-4e07-948d-329f4b722ee2, + time: 2016-09-14T18:20:16Z, + segment_count: 1, + direction: null, + to: ["+15552223333"], + 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: null +) +``` + diff --git a/docs/MediaApi.md b/docs/MediaApi.md index e1d3938c..ac0c433e 100644 --- a/docs/MediaApi.md +++ b/docs/MediaApi.md @@ -233,7 +233,7 @@ end Upload Media -Upload a file. You may add headers to the request in order to provide some control to your media file. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). +Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). ### Examples diff --git a/docs/MessageDeliveredCallback.md b/docs/MessageDeliveredCallback.md new file mode 100644 index 00000000..a28ffd85 --- /dev/null +++ b/docs/MessageDeliveredCallback.md @@ -0,0 +1,26 @@ +# Bandwidth::MessageDeliveredCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **time** | **Time** | | | +| **type** | **String** | | | +| **to** | **String** | | | +| **description** | **String** | | | +| **message** | [**MessageDeliveredCallbackMessage**](MessageDeliveredCallbackMessage.md) | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessageDeliveredCallback.new( + time: 2016-09-14T18:20:16Z, + type: message-delivered, + to: +15552223333, + description: Message delivered to carrier., + message: null +) +``` + diff --git a/docs/MessageDeliveredCallbackMessage.md b/docs/MessageDeliveredCallbackMessage.md new file mode 100644 index 00000000..39db1c6f --- /dev/null +++ b/docs/MessageDeliveredCallbackMessage.md @@ -0,0 +1,40 @@ +# Bandwidth::MessageDeliveredCallbackMessage + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | | +| **owner** | **String** | | | +| **application_id** | **String** | | | +| **time** | **Time** | | | +| **segment_count** | **Integer** | | | +| **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | | +| **to** | **Array<String>** | | | +| **from** | **String** | | | +| **text** | **String** | | | +| **tag** | **String** | | | +| **media** | **Array<String>** | | [optional] | +| **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessageDeliveredCallbackMessage.new( + id: 1661365814859loidf7mcwd4qacn7, + owner: +15553332222, + application_id: 93de2206-9669-4e07-948d-329f4b722ee2, + time: 2016-09-14T18:20:16Z, + segment_count: 1, + direction: null, + to: ["+15552223333"], + from: +15553332222, + text: , + tag: custom string, + media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority: null +) +``` + diff --git a/docs/MessageFailedCallback.md b/docs/MessageFailedCallback.md new file mode 100644 index 00000000..d9d65772 --- /dev/null +++ b/docs/MessageFailedCallback.md @@ -0,0 +1,28 @@ +# Bandwidth::MessageFailedCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **time** | **Time** | | | +| **type** | **String** | | | +| **to** | **String** | | | +| **description** | **String** | | | +| **message** | [**MessageFailedCallbackMessage**](MessageFailedCallbackMessage.md) | | | +| **error_code** | **Integer** | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessageFailedCallback.new( + time: 2016-09-14T18:20:16Z, + type: message-failed, + to: +15552223333, + description: rejected-unallocated-from-number, + message: null, + error_code: 9902 +) +``` + diff --git a/docs/MessageFailedCallbackMessage.md b/docs/MessageFailedCallbackMessage.md new file mode 100644 index 00000000..e82397d6 --- /dev/null +++ b/docs/MessageFailedCallbackMessage.md @@ -0,0 +1,40 @@ +# Bandwidth::MessageFailedCallbackMessage + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | | +| **owner** | **String** | | | +| **application_id** | **String** | | | +| **time** | **Time** | | | +| **segment_count** | **Integer** | | | +| **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | | +| **to** | **Array<String>** | | | +| **from** | **String** | | | +| **text** | **String** | | | +| **tag** | **String** | | | +| **media** | **Array<String>** | | [optional] | +| **priority** | [**PriorityEnum**](PriorityEnum.md) | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessageFailedCallbackMessage.new( + id: 1661365814859loidf7mcwd4qacn7, + owner: +15553332222, + application_id: 93de2206-9669-4e07-948d-329f4b722ee2, + time: 2016-09-14T18:20:16Z, + segment_count: 1, + direction: null, + to: ["+15552223333"], + from: +15553332222, + text: , + tag: custom string, + media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority: null +) +``` + diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md index f41af03f..f35a7459 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -8,7 +8,7 @@ | **to** | **Array<String>** | The phone number(s) the message should be sent to in E164 format. | | | **from** | **String** | One of your telephone numbers the message should come from in E164 format. | | | **text** | **String** | The contents of the text message. Must be 2048 characters or less. | [optional] | -| **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. | [optional] | +| **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] | | **tag** | **String** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | | **expiration** | **String** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. | [optional] | diff --git a/docs/MessageSendingCallback.md b/docs/MessageSendingCallback.md new file mode 100644 index 00000000..cd233d8e --- /dev/null +++ b/docs/MessageSendingCallback.md @@ -0,0 +1,26 @@ +# Bandwidth::MessageSendingCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **time** | **Time** | | | +| **type** | **String** | | | +| **to** | **String** | | | +| **description** | **String** | | | +| **message** | [**MessageSendingCallbackMessage**](MessageSendingCallbackMessage.md) | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessageSendingCallback.new( + time: 2016-09-14T18:20:16Z, + type: message-sending, + to: +15552223333, + description: Message is sending to carrier, + message: null +) +``` + diff --git a/docs/MessageSendingCallbackMessage.md b/docs/MessageSendingCallbackMessage.md new file mode 100644 index 00000000..507e6e6e --- /dev/null +++ b/docs/MessageSendingCallbackMessage.md @@ -0,0 +1,40 @@ +# Bandwidth::MessageSendingCallbackMessage + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | | +| **owner** | **String** | | | +| **application_id** | **String** | | | +| **time** | **Time** | | | +| **segment_count** | **Integer** | | | +| **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | | +| **to** | **Array<String>** | | | +| **from** | **String** | | | +| **text** | **String** | | | +| **tag** | **String** | | [optional] | +| **media** | **Array<String>** | | | +| **priority** | [**PriorityEnum**](PriorityEnum.md) | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MessageSendingCallbackMessage.new( + id: 1661365814859loidf7mcwd4qacn7, + owner: +15553332222, + application_id: 93de2206-9669-4e07-948d-329f4b722ee2, + time: 2016-09-14T18:20:16Z, + segment_count: 1, + direction: null, + to: ["+15552223333"], + from: +15553332222, + text: , + tag: custom string, + media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority: null +) +``` + diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index e1144b86..abe20b63 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -41,17 +41,15 @@ require 'bandwidth-sdk/models/create_call_response' require 'bandwidth-sdk/models/create_lookup_response' require 'bandwidth-sdk/models/create_message_request_error' -require 'bandwidth-sdk/models/create_participant_request' -require 'bandwidth-sdk/models/create_participant_response' require 'bandwidth-sdk/models/deferred_result' -require 'bandwidth-sdk/models/device_api_version_enum' require 'bandwidth-sdk/models/disconenct_callback' require 'bandwidth-sdk/models/diversion' require 'bandwidth-sdk/models/dtmf_callback' require 'bandwidth-sdk/models/field_error' require 'bandwidth-sdk/models/file_format_enum' -require 'bandwidth-sdk/models/forbidden_request' require 'bandwidth-sdk/models/gather_callback' +require 'bandwidth-sdk/models/inbound_message_callback' +require 'bandwidth-sdk/models/inbound_message_callback_message' require 'bandwidth-sdk/models/initiate_callback' require 'bandwidth-sdk/models/list_message_direction_enum' require 'bandwidth-sdk/models/list_message_item' @@ -64,8 +62,14 @@ require 'bandwidth-sdk/models/machine_detection_mode_enum' require 'bandwidth-sdk/models/media' require 'bandwidth-sdk/models/message' +require 'bandwidth-sdk/models/message_delivered_callback' +require 'bandwidth-sdk/models/message_delivered_callback_message' require 'bandwidth-sdk/models/message_direction_enum' +require 'bandwidth-sdk/models/message_failed_callback' +require 'bandwidth-sdk/models/message_failed_callback_message' require 'bandwidth-sdk/models/message_request' +require 'bandwidth-sdk/models/message_sending_callback' +require 'bandwidth-sdk/models/message_sending_callback_message' require 'bandwidth-sdk/models/message_status_enum' require 'bandwidth-sdk/models/message_type_enum' require 'bandwidth-sdk/models/messages_list' @@ -75,19 +79,13 @@ require 'bandwidth-sdk/models/mfa_request_error' require 'bandwidth-sdk/models/mfa_unauthorized_request_error' require 'bandwidth-sdk/models/page_info' -require 'bandwidth-sdk/models/participant' -require 'bandwidth-sdk/models/participant_subscription' require 'bandwidth-sdk/models/priority_enum' -require 'bandwidth-sdk/models/publish_permissions_enum' require 'bandwidth-sdk/models/recording_available_callback' require 'bandwidth-sdk/models/recording_complete_callback' require 'bandwidth-sdk/models/recording_state_enum' require 'bandwidth-sdk/models/redirect_callback' require 'bandwidth-sdk/models/redirect_method_enum' -require 'bandwidth-sdk/models/request_error' -require 'bandwidth-sdk/models/session' require 'bandwidth-sdk/models/stir_shaken' -require 'bandwidth-sdk/models/subscriptions' require 'bandwidth-sdk/models/tag' require 'bandwidth-sdk/models/tn_lookup_request_error' require 'bandwidth-sdk/models/transcribe_recording' @@ -98,7 +96,6 @@ require 'bandwidth-sdk/models/transfer_answer_callback' require 'bandwidth-sdk/models/transfer_complete_callback' require 'bandwidth-sdk/models/transfer_disconnect_callback' -require 'bandwidth-sdk/models/unauthorized_request' require 'bandwidth-sdk/models/update_call' require 'bandwidth-sdk/models/update_call_recording' require 'bandwidth-sdk/models/update_conference' @@ -114,10 +111,8 @@ require 'bandwidth-sdk/api/mfa_api' require 'bandwidth-sdk/api/media_api' require 'bandwidth-sdk/api/messages_api' -require 'bandwidth-sdk/api/participants_api' require 'bandwidth-sdk/api/phone_number_lookup_api' require 'bandwidth-sdk/api/recordings_api' -require 'bandwidth-sdk/api/sessions_api' require 'bandwidth-sdk/api/statistics_api' module Bandwidth diff --git a/lib/bandwidth-sdk/api/calls_api.rb b/lib/bandwidth-sdk/api/calls_api.rb index 2526b6b7..2c7c2e5b 100644 --- a/lib/bandwidth-sdk/api/calls_api.rb +++ b/lib/bandwidth-sdk/api/calls_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/api/conferences_api.rb b/lib/bandwidth-sdk/api/conferences_api.rb index 72f2ac59..53e2688d 100644 --- a/lib/bandwidth-sdk/api/conferences_api.rb +++ b/lib/bandwidth-sdk/api/conferences_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/api/media_api.rb b/lib/bandwidth-sdk/api/media_api.rb index 3d79a84d..179e09ea 100644 --- a/lib/bandwidth-sdk/api/media_api.rb +++ b/lib/bandwidth-sdk/api/media_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -224,7 +224,7 @@ def list_media_with_http_info(account_id, opts = {}) end # Upload Media - # Upload a file. You may add headers to the request in order to provide some control to your media file. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). + # Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). # @param account_id [String] Your Bandwidth Account ID. # @param media_id [String] Media ID to retrieve. # @param body [File] @@ -238,7 +238,7 @@ def upload_media(account_id, media_id, body, opts = {}) end # Upload Media - # Upload a file. You may add headers to the request in order to provide some control to your media file. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). + # Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). # @param account_id [String] Your Bandwidth Account ID. # @param media_id [String] Media ID to retrieve. # @param body [File] diff --git a/lib/bandwidth-sdk/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb index 3e93641e..77f3fef0 100644 --- a/lib/bandwidth-sdk/api/messages_api.rb +++ b/lib/bandwidth-sdk/api/messages_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/api/mfa_api.rb b/lib/bandwidth-sdk/api/mfa_api.rb index 7b43bc7a..ed4d159f 100644 --- a/lib/bandwidth-sdk/api/mfa_api.rb +++ b/lib/bandwidth-sdk/api/mfa_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb index 65268107..778e9fe2 100644 --- a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +++ b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/api/recordings_api.rb b/lib/bandwidth-sdk/api/recordings_api.rb index 8297f3fa..9e296b51 100644 --- a/lib/bandwidth-sdk/api/recordings_api.rb +++ b/lib/bandwidth-sdk/api/recordings_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/api/statistics_api.rb b/lib/bandwidth-sdk/api/statistics_api.rb index 8d2ef637..f0d80b14 100644 --- a/lib/bandwidth-sdk/api/statistics_api.rb +++ b/lib/bandwidth-sdk/api/statistics_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/api_client.rb b/lib/bandwidth-sdk/api_client.rb index 5ff076b9..b1881fe1 100644 --- a/lib/bandwidth-sdk/api_client.rb +++ b/lib/bandwidth-sdk/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -58,7 +58,7 @@ def call_api(http_method, path, opts = {}) end unless response.success? - if response.status == 0 + if response.status == 0 && response.respond_to?(:return_message) # Errors from libcurl will be made visible here fail ApiError.new(code: 0, message: response.return_message) @@ -71,6 +71,8 @@ def call_api(http_method, path, opts = {}) end rescue Faraday::TimeoutError fail ApiError.new('Connection timed out') + rescue Faraday::ConnectionFailed + fail ApiError.new('Connection failed') end if opts[:return_type] diff --git a/lib/bandwidth-sdk/api_error.rb b/lib/bandwidth-sdk/api_error.rb index 8ea438ab..eeb0a28d 100644 --- a/lib/bandwidth-sdk/api_error.rb +++ b/lib/bandwidth-sdk/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -32,6 +32,7 @@ def initialize(arg = nil) end else super arg + @message = arg end end diff --git a/lib/bandwidth-sdk/configuration.rb b/lib/bandwidth-sdk/configuration.rb index 08bbb5d4..ac60502b 100644 --- a/lib/bandwidth-sdk/configuration.rb +++ b/lib/bandwidth-sdk/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -62,6 +62,11 @@ class Configuration # Defines the access token (Bearer) used with OAuth2. attr_accessor :access_token + # Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2. + # Overrides the access_token if set + # @return [Proc] + attr_accessor :access_token_getter + # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response # details will be logged with `logger.debug` (see the `logger` attribute). # Default to false. @@ -211,6 +216,12 @@ def api_key_with_prefix(param_name, param_alias = nil) end end + # Gets access_token using access_token_getter or uses the static access_token + def access_token_with_refresh + return access_token if access_token_getter.nil? + access_token_getter.call + end + # Gets Basic Auth token string def basic_auth_token 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") @@ -373,24 +384,6 @@ def operation_server_settings description: "Production", } ], - "ParticipantsApi.create_participant": [ - { - url: "https://api.webrtc.bandwidth.com/v1", - description: "Production", - } - ], - "ParticipantsApi.delete_participant": [ - { - url: "https://api.webrtc.bandwidth.com/v1", - description: "Production", - } - ], - "ParticipantsApi.get_participant": [ - { - url: "https://api.webrtc.bandwidth.com/v1", - description: "Production", - } - ], "PhoneNumberLookupApi.create_lookup": [ { url: "https://numbers.bandwidth.com/api/v1", @@ -463,54 +456,6 @@ def operation_server_settings description: "Production", } ], - "SessionsApi.add_participant_to_session": [ - { - url: "https://api.webrtc.bandwidth.com/v1", - description: "Production", - } - ], - "SessionsApi.create_session": [ - { - url: "https://api.webrtc.bandwidth.com/v1", - description: "Production", - } - ], - "SessionsApi.delete_session": [ - { - url: "https://api.webrtc.bandwidth.com/v1", - description: "Production", - } - ], - "SessionsApi.get_participant_subscriptions": [ - { - url: "https://api.webrtc.bandwidth.com/v1", - description: "Production", - } - ], - "SessionsApi.get_session": [ - { - url: "https://api.webrtc.bandwidth.com/v1", - description: "Production", - } - ], - "SessionsApi.list_session_participants": [ - { - url: "https://api.webrtc.bandwidth.com/v1", - description: "Production", - } - ], - "SessionsApi.remove_participant_from_session": [ - { - url: "https://api.webrtc.bandwidth.com/v1", - description: "Production", - } - ], - "SessionsApi.update_participant_subscriptions": [ - { - url: "https://api.webrtc.bandwidth.com/v1", - description: "Production", - } - ], "StatisticsApi.get_statistics": [ { url: "https://voice.bandwidth.com/api/v2", diff --git a/lib/bandwidth-sdk/models/account_statistics.rb b/lib/bandwidth-sdk/models/account_statistics.rb index 36e44d09..88af713e 100644 --- a/lib/bandwidth-sdk/models/account_statistics.rb +++ b/lib/bandwidth-sdk/models/account_statistics.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/answer_callback.rb b/lib/bandwidth-sdk/models/answer_callback.rb index 8c98d5a0..5f71a948 100644 --- a/lib/bandwidth-sdk/models/answer_callback.rb +++ b/lib/bandwidth-sdk/models/answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -57,6 +57,28 @@ class AnswerCallback # (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete attr_accessor :machine_detection_result + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/bridge_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_complete_callback.rb index 993f99e4..aa13003b 100644 --- a/lib/bandwidth-sdk/models/bridge_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -63,6 +63,28 @@ class BridgeCompleteCallback # Bandwidth's internal id that references the error event. attr_accessor :error_id + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb index 187ed492..ba2b3334 100644 --- a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -54,6 +54,28 @@ class BridgeTargetCompleteCallback # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. attr_accessor :tag + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/call_direction_enum.rb b/lib/bandwidth-sdk/models/call_direction_enum.rb index 3ce97b83..d55e5b23 100644 --- a/lib/bandwidth-sdk/models/call_direction_enum.rb +++ b/lib/bandwidth-sdk/models/call_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/call_recording_metadata.rb b/lib/bandwidth-sdk/models/call_recording_metadata.rb index 3c74e4c6..f8d9863d 100644 --- a/lib/bandwidth-sdk/models/call_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/call_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -66,6 +66,28 @@ class CallRecordingMetadata attr_accessor :transcription + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/call_state.rb b/lib/bandwidth-sdk/models/call_state.rb index e0f3aa1d..30400b48 100644 --- a/lib/bandwidth-sdk/models/call_state.rb +++ b/lib/bandwidth-sdk/models/call_state.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -68,6 +68,28 @@ class CallState # The last time the call had a state update, in ISO 8601 format. attr_accessor :last_update + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/call_state_enum.rb b/lib/bandwidth-sdk/models/call_state_enum.rb index 387362e3..d5bc7404 100644 --- a/lib/bandwidth-sdk/models/call_state_enum.rb +++ b/lib/bandwidth-sdk/models/call_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/callback_method_enum.rb b/lib/bandwidth-sdk/models/callback_method_enum.rb index 2d6005af..d717459c 100644 --- a/lib/bandwidth-sdk/models/callback_method_enum.rb +++ b/lib/bandwidth-sdk/models/callback_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/code_request.rb b/lib/bandwidth-sdk/models/code_request.rb index 27257878..3c6369e4 100644 --- a/lib/bandwidth-sdk/models/code_request.rb +++ b/lib/bandwidth-sdk/models/code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/conference.rb b/lib/bandwidth-sdk/models/conference.rb index 01d937cb..f47c11b8 100644 --- a/lib/bandwidth-sdk/models/conference.rb +++ b/lib/bandwidth-sdk/models/conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -38,6 +38,28 @@ class Conference # 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) attr_accessor :active_members + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/conference_completed_callback.rb b/lib/bandwidth-sdk/models/conference_completed_callback.rb index 9c7eb44d..82f27389 100644 --- a/lib/bandwidth-sdk/models/conference_completed_callback.rb +++ b/lib/bandwidth-sdk/models/conference_completed_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/conference_created_callback.rb b/lib/bandwidth-sdk/models/conference_created_callback.rb index 4bccebd9..656433a4 100644 --- a/lib/bandwidth-sdk/models/conference_created_callback.rb +++ b/lib/bandwidth-sdk/models/conference_created_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/conference_member.rb b/lib/bandwidth-sdk/models/conference_member.rb index 8c0de005..ca1c3248 100644 --- a/lib/bandwidth-sdk/models/conference_member.rb +++ b/lib/bandwidth-sdk/models/conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb index 4f4f890e..c4e0436a 100644 --- a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/conference_member_join_callback.rb b/lib/bandwidth-sdk/models/conference_member_join_callback.rb index c1b226a1..09ae2fd5 100644 --- a/lib/bandwidth-sdk/models/conference_member_join_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_join_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb index 27888d6c..44cee423 100644 --- a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -57,6 +57,28 @@ class ConferenceRecordingAvailableCallback # 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. attr_accessor :status + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/conference_recording_metadata.rb b/lib/bandwidth-sdk/models/conference_recording_metadata.rb index b0be0494..43e5ab8d 100644 --- a/lib/bandwidth-sdk/models/conference_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/conference_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -47,6 +47,28 @@ class ConferenceRecordingMetadata # The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. attr_accessor :media_url + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/conference_redirect_callback.rb b/lib/bandwidth-sdk/models/conference_redirect_callback.rb index 6d1acbe1..3909e9ad 100644 --- a/lib/bandwidth-sdk/models/conference_redirect_callback.rb +++ b/lib/bandwidth-sdk/models/conference_redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/conference_state_enum.rb b/lib/bandwidth-sdk/models/conference_state_enum.rb index 3b72e062..0d6845b2 100644 --- a/lib/bandwidth-sdk/models/conference_state_enum.rb +++ b/lib/bandwidth-sdk/models/conference_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/create_call.rb b/lib/bandwidth-sdk/models/create_call.rb index 56fdc030..28f24a45 100644 --- a/lib/bandwidth-sdk/models/create_call.rb +++ b/lib/bandwidth-sdk/models/create_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -68,6 +68,28 @@ class CreateCall # 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. attr_accessor :tag + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/create_call_response.rb b/lib/bandwidth-sdk/models/create_call_response.rb index 6cf41aac..d766cecb 100644 --- a/lib/bandwidth-sdk/models/create_call_response.rb +++ b/lib/bandwidth-sdk/models/create_call_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -75,6 +75,28 @@ class CreateCallResponse # The priority of this call over other calls from your account. attr_accessor :priority + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/create_lookup_response.rb b/lib/bandwidth-sdk/models/create_lookup_response.rb index 48d5c2b0..136645b7 100644 --- a/lib/bandwidth-sdk/models/create_lookup_response.rb +++ b/lib/bandwidth-sdk/models/create_lookup_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -21,6 +21,28 @@ class CreateLookupResponse attr_accessor :status + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/create_message_request_error.rb b/lib/bandwidth-sdk/models/create_message_request_error.rb index 06128560..233223be 100644 --- a/lib/bandwidth-sdk/models/create_message_request_error.rb +++ b/lib/bandwidth-sdk/models/create_message_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/deferred_result.rb b/lib/bandwidth-sdk/models/deferred_result.rb index d15fb796..bbdce958 100644 --- a/lib/bandwidth-sdk/models/deferred_result.rb +++ b/lib/bandwidth-sdk/models/deferred_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/disconenct_callback.rb b/lib/bandwidth-sdk/models/disconenct_callback.rb index bcf6bf3f..1af058a7 100644 --- a/lib/bandwidth-sdk/models/disconenct_callback.rb +++ b/lib/bandwidth-sdk/models/disconenct_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -66,6 +66,28 @@ class DisconenctCallback # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. attr_accessor :tag + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/diversion.rb b/lib/bandwidth-sdk/models/diversion.rb index 134746c3..e4030b1f 100644 --- a/lib/bandwidth-sdk/models/diversion.rb +++ b/lib/bandwidth-sdk/models/diversion.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/dtmf_callback.rb b/lib/bandwidth-sdk/models/dtmf_callback.rb index 583c0286..8cd77962 100644 --- a/lib/bandwidth-sdk/models/dtmf_callback.rb +++ b/lib/bandwidth-sdk/models/dtmf_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -66,6 +66,28 @@ class DtmfCallback # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. attr_accessor :tag + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/field_error.rb b/lib/bandwidth-sdk/models/field_error.rb index 6b26d374..b32d8164 100644 --- a/lib/bandwidth-sdk/models/field_error.rb +++ b/lib/bandwidth-sdk/models/field_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/file_format_enum.rb b/lib/bandwidth-sdk/models/file_format_enum.rb index 81337dfb..4e426f67 100644 --- a/lib/bandwidth-sdk/models/file_format_enum.rb +++ b/lib/bandwidth-sdk/models/file_format_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/gather_callback.rb b/lib/bandwidth-sdk/models/gather_callback.rb index 4ef625d8..9fa91994 100644 --- a/lib/bandwidth-sdk/models/gather_callback.rb +++ b/lib/bandwidth-sdk/models/gather_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -69,6 +69,28 @@ class GatherCallback # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. attr_accessor :tag + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/inbound_message_callback.rb b/lib/bandwidth-sdk/models/inbound_message_callback.rb new file mode 100644 index 00000000..9880727a --- /dev/null +++ b/lib/bandwidth-sdk/models/inbound_message_callback.rb @@ -0,0 +1,281 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # Inbound Message Callback + class InboundMessageCallback + attr_accessor :time + + attr_accessor :type + + attr_accessor :to + + attr_accessor :description + + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'time' => :'time', + :'type' => :'type', + :'to' => :'to', + :'description' => :'description', + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'time' => :'Time', + :'type' => :'String', + :'to' => :'String', + :'description' => :'String', + :'message' => :'InboundMessageCallbackMessage' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::InboundMessageCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::InboundMessageCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @time.nil? + invalid_properties.push('invalid value for "time", time cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + if @description.nil? + invalid_properties.push('invalid value for "description", description cannot be nil.') + end + + if @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @time.nil? + return false if @type.nil? + return false if @to.nil? + return false if @description.nil? + return false if @message.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + time == o.time && + type == o.type && + to == o.to && + description == o.description && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [time, type, to, description, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb new file mode 100644 index 00000000..b917968f --- /dev/null +++ b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb @@ -0,0 +1,399 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class InboundMessageCallbackMessage + attr_accessor :id + + attr_accessor :owner + + attr_accessor :application_id + + attr_accessor :time + + attr_accessor :segment_count + + attr_accessor :direction + + attr_accessor :to + + attr_accessor :from + + attr_accessor :text + + attr_accessor :tag + + attr_accessor :media + + attr_accessor :priority + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'owner' => :'owner', + :'application_id' => :'applicationId', + :'time' => :'time', + :'segment_count' => :'segmentCount', + :'direction' => :'direction', + :'to' => :'to', + :'from' => :'from', + :'text' => :'text', + :'tag' => :'tag', + :'media' => :'media', + :'priority' => :'priority' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'owner' => :'String', + :'application_id' => :'String', + :'time' => :'Time', + :'segment_count' => :'Integer', + :'direction' => :'MessageDirectionEnum', + :'to' => :'Array', + :'from' => :'String', + :'text' => :'String', + :'tag' => :'String', + :'media' => :'Array', + :'priority' => :'PriorityEnum' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::InboundMessageCallbackMessage` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::InboundMessageCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'owner') + self.owner = attributes[:'owner'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'segment_count') + self.segment_count = attributes[:'segment_count'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'to') + if (value = attributes[:'to']).is_a?(Array) + self.to = value + end + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'text') + self.text = attributes[:'text'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'media') + if (value = attributes[:'media']).is_a?(Array) + self.media = value + end + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @owner.nil? + invalid_properties.push('invalid value for "owner", owner cannot be nil.') + end + + if @application_id.nil? + invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') + end + + if @time.nil? + invalid_properties.push('invalid value for "time", time cannot be nil.') + end + + if @segment_count.nil? + invalid_properties.push('invalid value for "segment_count", segment_count cannot be nil.') + end + + if @direction.nil? + invalid_properties.push('invalid value for "direction", direction cannot be nil.') + end + + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + if @from.nil? + invalid_properties.push('invalid value for "from", from cannot be nil.') + end + + if @text.nil? + invalid_properties.push('invalid value for "text", text cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @id.nil? + return false if @owner.nil? + return false if @application_id.nil? + return false if @time.nil? + return false if @segment_count.nil? + return false if @direction.nil? + return false if @to.nil? + return false if @from.nil? + return false if @text.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] to Value to be assigned + def to=(to) + if to.nil? + fail ArgumentError, 'to cannot be nil' + end + + @to = to + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + owner == o.owner && + application_id == o.application_id && + time == o.time && + segment_count == o.segment_count && + direction == o.direction && + to == o.to && + from == o.from && + text == o.text && + tag == o.tag && + media == o.media && + priority == o.priority + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/initiate_callback.rb b/lib/bandwidth-sdk/models/initiate_callback.rb index 12cfaeb4..f009a7f4 100644 --- a/lib/bandwidth-sdk/models/initiate_callback.rb +++ b/lib/bandwidth-sdk/models/initiate_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -49,6 +49,28 @@ class InitiateCallback attr_accessor :stir_shaken + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/list_message_direction_enum.rb b/lib/bandwidth-sdk/models/list_message_direction_enum.rb index 92bd3a71..255f7531 100644 --- a/lib/bandwidth-sdk/models/list_message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/list_message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/list_message_item.rb b/lib/bandwidth-sdk/models/list_message_item.rb index 583a517e..4bbb8a2e 100644 --- a/lib/bandwidth-sdk/models/list_message_item.rb +++ b/lib/bandwidth-sdk/models/list_message_item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -60,6 +60,28 @@ class ListMessageItem # The campaign class of the message if it has one. attr_accessor :campaign_class + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/lookup_request.rb b/lib/bandwidth-sdk/models/lookup_request.rb index afdf42c8..e5003e82 100644 --- a/lib/bandwidth-sdk/models/lookup_request.rb +++ b/lib/bandwidth-sdk/models/lookup_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/lookup_result.rb b/lib/bandwidth-sdk/models/lookup_result.rb index 19049309..4d2583ed 100644 --- a/lib/bandwidth-sdk/models/lookup_result.rb +++ b/lib/bandwidth-sdk/models/lookup_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/lookup_status.rb b/lib/bandwidth-sdk/models/lookup_status.rb index 136624c9..a41ea924 100644 --- a/lib/bandwidth-sdk/models/lookup_status.rb +++ b/lib/bandwidth-sdk/models/lookup_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -27,6 +27,28 @@ class LookupStatus # The telephone numbers whose lookup failed. attr_accessor :failed_telephone_numbers + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/lookup_status_enum.rb b/lib/bandwidth-sdk/models/lookup_status_enum.rb index 0f0f8eec..0f013462 100644 --- a/lib/bandwidth-sdk/models/lookup_status_enum.rb +++ b/lib/bandwidth-sdk/models/lookup_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb index b010a543..aacb5b4a 100644 --- a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +++ b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -57,6 +57,28 @@ class MachineDetectionCompleteCallback # (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete attr_accessor :machine_detection_result + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/machine_detection_configuration.rb b/lib/bandwidth-sdk/models/machine_detection_configuration.rb index 18d3734f..57f324d9 100644 --- a/lib/bandwidth-sdk/models/machine_detection_configuration.rb +++ b/lib/bandwidth-sdk/models/machine_detection_configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -58,6 +58,28 @@ class MachineDetectionConfiguration # Basic auth password. attr_accessor :fallback_password + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb index 47c0f42d..755fc9b7 100644 --- a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +++ b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/media.rb b/lib/bandwidth-sdk/models/media.rb index 610f2797..7b4d5d38 100644 --- a/lib/bandwidth-sdk/models/media.rb +++ b/lib/bandwidth-sdk/models/media.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/message.rb b/lib/bandwidth-sdk/models/message.rb index 203d41e9..568cc016 100644 --- a/lib/bandwidth-sdk/models/message.rb +++ b/lib/bandwidth-sdk/models/message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -49,6 +49,28 @@ class Message attr_accessor :priority + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/message_delivered_callback.rb b/lib/bandwidth-sdk/models/message_delivered_callback.rb new file mode 100644 index 00000000..47d84c5f --- /dev/null +++ b/lib/bandwidth-sdk/models/message_delivered_callback.rb @@ -0,0 +1,281 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # Message Delivered Callback + class MessageDeliveredCallback + attr_accessor :time + + attr_accessor :type + + attr_accessor :to + + attr_accessor :description + + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'time' => :'time', + :'type' => :'type', + :'to' => :'to', + :'description' => :'description', + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'time' => :'Time', + :'type' => :'String', + :'to' => :'String', + :'description' => :'String', + :'message' => :'MessageDeliveredCallbackMessage' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageDeliveredCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageDeliveredCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @time.nil? + invalid_properties.push('invalid value for "time", time cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + if @description.nil? + invalid_properties.push('invalid value for "description", description cannot be nil.') + end + + if @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @time.nil? + return false if @type.nil? + return false if @to.nil? + return false if @description.nil? + return false if @message.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + time == o.time && + type == o.type && + to == o.to && + description == o.description && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [time, type, to, description, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb new file mode 100644 index 00000000..25aff946 --- /dev/null +++ b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb @@ -0,0 +1,404 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MessageDeliveredCallbackMessage + attr_accessor :id + + attr_accessor :owner + + attr_accessor :application_id + + attr_accessor :time + + attr_accessor :segment_count + + attr_accessor :direction + + attr_accessor :to + + attr_accessor :from + + attr_accessor :text + + attr_accessor :tag + + attr_accessor :media + + attr_accessor :priority + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'owner' => :'owner', + :'application_id' => :'applicationId', + :'time' => :'time', + :'segment_count' => :'segmentCount', + :'direction' => :'direction', + :'to' => :'to', + :'from' => :'from', + :'text' => :'text', + :'tag' => :'tag', + :'media' => :'media', + :'priority' => :'priority' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'owner' => :'String', + :'application_id' => :'String', + :'time' => :'Time', + :'segment_count' => :'Integer', + :'direction' => :'MessageDirectionEnum', + :'to' => :'Array', + :'from' => :'String', + :'text' => :'String', + :'tag' => :'String', + :'media' => :'Array', + :'priority' => :'PriorityEnum' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageDeliveredCallbackMessage` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageDeliveredCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'owner') + self.owner = attributes[:'owner'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'segment_count') + self.segment_count = attributes[:'segment_count'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'to') + if (value = attributes[:'to']).is_a?(Array) + self.to = value + end + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'text') + self.text = attributes[:'text'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'media') + if (value = attributes[:'media']).is_a?(Array) + self.media = value + end + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @owner.nil? + invalid_properties.push('invalid value for "owner", owner cannot be nil.') + end + + if @application_id.nil? + invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') + end + + if @time.nil? + invalid_properties.push('invalid value for "time", time cannot be nil.') + end + + if @segment_count.nil? + invalid_properties.push('invalid value for "segment_count", segment_count cannot be nil.') + end + + if @direction.nil? + invalid_properties.push('invalid value for "direction", direction cannot be nil.') + end + + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + if @from.nil? + invalid_properties.push('invalid value for "from", from cannot be nil.') + end + + if @text.nil? + invalid_properties.push('invalid value for "text", text cannot be nil.') + end + + if @tag.nil? + invalid_properties.push('invalid value for "tag", tag cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @id.nil? + return false if @owner.nil? + return false if @application_id.nil? + return false if @time.nil? + return false if @segment_count.nil? + return false if @direction.nil? + return false if @to.nil? + return false if @from.nil? + return false if @text.nil? + return false if @tag.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] to Value to be assigned + def to=(to) + if to.nil? + fail ArgumentError, 'to cannot be nil' + end + + @to = to + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + owner == o.owner && + application_id == o.application_id && + time == o.time && + segment_count == o.segment_count && + direction == o.direction && + to == o.to && + from == o.from && + text == o.text && + tag == o.tag && + media == o.media && + priority == o.priority + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/message_direction_enum.rb b/lib/bandwidth-sdk/models/message_direction_enum.rb index d62b7108..83fad806 100644 --- a/lib/bandwidth-sdk/models/message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/message_failed_callback.rb b/lib/bandwidth-sdk/models/message_failed_callback.rb new file mode 100644 index 00000000..23372198 --- /dev/null +++ b/lib/bandwidth-sdk/models/message_failed_callback.rb @@ -0,0 +1,295 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # Message Failed Callback + class MessageFailedCallback + attr_accessor :time + + attr_accessor :type + + attr_accessor :to + + attr_accessor :description + + attr_accessor :message + + attr_accessor :error_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'time' => :'time', + :'type' => :'type', + :'to' => :'to', + :'description' => :'description', + :'message' => :'message', + :'error_code' => :'errorCode' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'time' => :'Time', + :'type' => :'String', + :'to' => :'String', + :'description' => :'String', + :'message' => :'MessageFailedCallbackMessage', + :'error_code' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageFailedCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageFailedCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'error_code') + self.error_code = attributes[:'error_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @time.nil? + invalid_properties.push('invalid value for "time", time cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + if @description.nil? + invalid_properties.push('invalid value for "description", description cannot be nil.') + end + + if @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + if @error_code.nil? + invalid_properties.push('invalid value for "error_code", error_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @time.nil? + return false if @type.nil? + return false if @to.nil? + return false if @description.nil? + return false if @message.nil? + return false if @error_code.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + time == o.time && + type == o.type && + to == o.to && + description == o.description && + message == o.message && + error_code == o.error_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [time, type, to, description, message, error_code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/message_failed_callback_message.rb b/lib/bandwidth-sdk/models/message_failed_callback_message.rb new file mode 100644 index 00000000..22c265fd --- /dev/null +++ b/lib/bandwidth-sdk/models/message_failed_callback_message.rb @@ -0,0 +1,409 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MessageFailedCallbackMessage + attr_accessor :id + + attr_accessor :owner + + attr_accessor :application_id + + attr_accessor :time + + attr_accessor :segment_count + + attr_accessor :direction + + attr_accessor :to + + attr_accessor :from + + attr_accessor :text + + attr_accessor :tag + + attr_accessor :media + + attr_accessor :priority + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'owner' => :'owner', + :'application_id' => :'applicationId', + :'time' => :'time', + :'segment_count' => :'segmentCount', + :'direction' => :'direction', + :'to' => :'to', + :'from' => :'from', + :'text' => :'text', + :'tag' => :'tag', + :'media' => :'media', + :'priority' => :'priority' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'owner' => :'String', + :'application_id' => :'String', + :'time' => :'Time', + :'segment_count' => :'Integer', + :'direction' => :'MessageDirectionEnum', + :'to' => :'Array', + :'from' => :'String', + :'text' => :'String', + :'tag' => :'String', + :'media' => :'Array', + :'priority' => :'PriorityEnum' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageFailedCallbackMessage` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageFailedCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'owner') + self.owner = attributes[:'owner'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'segment_count') + self.segment_count = attributes[:'segment_count'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'to') + if (value = attributes[:'to']).is_a?(Array) + self.to = value + end + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'text') + self.text = attributes[:'text'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'media') + if (value = attributes[:'media']).is_a?(Array) + self.media = value + end + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @owner.nil? + invalid_properties.push('invalid value for "owner", owner cannot be nil.') + end + + if @application_id.nil? + invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') + end + + if @time.nil? + invalid_properties.push('invalid value for "time", time cannot be nil.') + end + + if @segment_count.nil? + invalid_properties.push('invalid value for "segment_count", segment_count cannot be nil.') + end + + if @direction.nil? + invalid_properties.push('invalid value for "direction", direction cannot be nil.') + end + + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + if @from.nil? + invalid_properties.push('invalid value for "from", from cannot be nil.') + end + + if @text.nil? + invalid_properties.push('invalid value for "text", text cannot be nil.') + end + + if @tag.nil? + invalid_properties.push('invalid value for "tag", tag cannot be nil.') + end + + if @priority.nil? + invalid_properties.push('invalid value for "priority", priority cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @id.nil? + return false if @owner.nil? + return false if @application_id.nil? + return false if @time.nil? + return false if @segment_count.nil? + return false if @direction.nil? + return false if @to.nil? + return false if @from.nil? + return false if @text.nil? + return false if @tag.nil? + return false if @priority.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] to Value to be assigned + def to=(to) + if to.nil? + fail ArgumentError, 'to cannot be nil' + end + + @to = to + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + owner == o.owner && + application_id == o.application_id && + time == o.time && + segment_count == o.segment_count && + direction == o.direction && + to == o.to && + from == o.from && + text == o.text && + tag == o.tag && + media == o.media && + priority == o.priority + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/message_request.rb b/lib/bandwidth-sdk/models/message_request.rb index 951d904c..f3104854 100644 --- a/lib/bandwidth-sdk/models/message_request.rb +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -27,7 +27,7 @@ class MessageRequest # The contents of the text message. Must be 2048 characters or less. attr_accessor :text - # A list of URLs to include as media attachments as part of the message. + # A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. attr_accessor :media # A custom string that will be included in callback events of the message. Max 1024 characters. @@ -38,6 +38,28 @@ class MessageRequest # A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. attr_accessor :expiration + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/message_sending_callback.rb b/lib/bandwidth-sdk/models/message_sending_callback.rb new file mode 100644 index 00000000..b312d70e --- /dev/null +++ b/lib/bandwidth-sdk/models/message_sending_callback.rb @@ -0,0 +1,281 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # Message Sending Callback + class MessageSendingCallback + attr_accessor :time + + attr_accessor :type + + attr_accessor :to + + attr_accessor :description + + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'time' => :'time', + :'type' => :'type', + :'to' => :'to', + :'description' => :'description', + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'time' => :'Time', + :'type' => :'String', + :'to' => :'String', + :'description' => :'String', + :'message' => :'MessageSendingCallbackMessage' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageSendingCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageSendingCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @time.nil? + invalid_properties.push('invalid value for "time", time cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + if @description.nil? + invalid_properties.push('invalid value for "description", description cannot be nil.') + end + + if @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @time.nil? + return false if @type.nil? + return false if @to.nil? + return false if @description.nil? + return false if @message.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + time == o.time && + type == o.type && + to == o.to && + description == o.description && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [time, type, to, description, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/message_sending_callback_message.rb b/lib/bandwidth-sdk/models/message_sending_callback_message.rb new file mode 100644 index 00000000..3cbbab6a --- /dev/null +++ b/lib/bandwidth-sdk/models/message_sending_callback_message.rb @@ -0,0 +1,409 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class MessageSendingCallbackMessage + attr_accessor :id + + attr_accessor :owner + + attr_accessor :application_id + + attr_accessor :time + + attr_accessor :segment_count + + attr_accessor :direction + + attr_accessor :to + + attr_accessor :from + + attr_accessor :text + + attr_accessor :tag + + attr_accessor :media + + attr_accessor :priority + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'owner' => :'owner', + :'application_id' => :'applicationId', + :'time' => :'time', + :'segment_count' => :'segmentCount', + :'direction' => :'direction', + :'to' => :'to', + :'from' => :'from', + :'text' => :'text', + :'tag' => :'tag', + :'media' => :'media', + :'priority' => :'priority' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'owner' => :'String', + :'application_id' => :'String', + :'time' => :'Time', + :'segment_count' => :'Integer', + :'direction' => :'MessageDirectionEnum', + :'to' => :'Array', + :'from' => :'String', + :'text' => :'String', + :'tag' => :'String', + :'media' => :'Array', + :'priority' => :'PriorityEnum' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageSendingCallbackMessage` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageSendingCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'owner') + self.owner = attributes[:'owner'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'segment_count') + self.segment_count = attributes[:'segment_count'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'to') + if (value = attributes[:'to']).is_a?(Array) + self.to = value + end + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'text') + self.text = attributes[:'text'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'media') + if (value = attributes[:'media']).is_a?(Array) + self.media = value + end + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @owner.nil? + invalid_properties.push('invalid value for "owner", owner cannot be nil.') + end + + if @application_id.nil? + invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') + end + + if @time.nil? + invalid_properties.push('invalid value for "time", time cannot be nil.') + end + + if @segment_count.nil? + invalid_properties.push('invalid value for "segment_count", segment_count cannot be nil.') + end + + if @direction.nil? + invalid_properties.push('invalid value for "direction", direction cannot be nil.') + end + + if @to.nil? + invalid_properties.push('invalid value for "to", to cannot be nil.') + end + + if @from.nil? + invalid_properties.push('invalid value for "from", from cannot be nil.') + end + + if @text.nil? + invalid_properties.push('invalid value for "text", text cannot be nil.') + end + + if @media.nil? + invalid_properties.push('invalid value for "media", media cannot be nil.') + end + + if @priority.nil? + invalid_properties.push('invalid value for "priority", priority cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @id.nil? + return false if @owner.nil? + return false if @application_id.nil? + return false if @time.nil? + return false if @segment_count.nil? + return false if @direction.nil? + return false if @to.nil? + return false if @from.nil? + return false if @text.nil? + return false if @media.nil? + return false if @priority.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] to Value to be assigned + def to=(to) + if to.nil? + fail ArgumentError, 'to cannot be nil' + end + + @to = to + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + owner == o.owner && + application_id == o.application_id && + time == o.time && + segment_count == o.segment_count && + direction == o.direction && + to == o.to && + from == o.from && + text == o.text && + tag == o.tag && + media == o.media && + priority == o.priority + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/message_status_enum.rb b/lib/bandwidth-sdk/models/message_status_enum.rb index bd8c7810..1f653a26 100644 --- a/lib/bandwidth-sdk/models/message_status_enum.rb +++ b/lib/bandwidth-sdk/models/message_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/message_type_enum.rb b/lib/bandwidth-sdk/models/message_type_enum.rb index 7550e394..37f3219f 100644 --- a/lib/bandwidth-sdk/models/message_type_enum.rb +++ b/lib/bandwidth-sdk/models/message_type_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/messages_list.rb b/lib/bandwidth-sdk/models/messages_list.rb index 0a7acc45..09436ce5 100644 --- a/lib/bandwidth-sdk/models/messages_list.rb +++ b/lib/bandwidth-sdk/models/messages_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/messaging_code_response.rb b/lib/bandwidth-sdk/models/messaging_code_response.rb index 0da522c8..7e86e9e9 100644 --- a/lib/bandwidth-sdk/models/messaging_code_response.rb +++ b/lib/bandwidth-sdk/models/messaging_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/messaging_request_error.rb b/lib/bandwidth-sdk/models/messaging_request_error.rb index 4d91dbda..08c18005 100644 --- a/lib/bandwidth-sdk/models/messaging_request_error.rb +++ b/lib/bandwidth-sdk/models/messaging_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb index 45b69d80..af8ebc9d 100644 --- a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/mfa_request_error.rb b/lib/bandwidth-sdk/models/mfa_request_error.rb index cb038e4e..c9a7842a 100644 --- a/lib/bandwidth-sdk/models/mfa_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb index 0c61b29c..d3db724a 100644 --- a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/page_info.rb b/lib/bandwidth-sdk/models/page_info.rb index 35d739fa..1ea3fd2b 100644 --- a/lib/bandwidth-sdk/models/page_info.rb +++ b/lib/bandwidth-sdk/models/page_info.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/priority_enum.rb b/lib/bandwidth-sdk/models/priority_enum.rb index da52874c..ba42d784 100644 --- a/lib/bandwidth-sdk/models/priority_enum.rb +++ b/lib/bandwidth-sdk/models/priority_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/recording_available_callback.rb b/lib/bandwidth-sdk/models/recording_available_callback.rb index 8e71d33d..19eb5746 100644 --- a/lib/bandwidth-sdk/models/recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -80,6 +80,28 @@ class RecordingAvailableCallback # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). attr_accessor :transfer_to + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/recording_complete_callback.rb b/lib/bandwidth-sdk/models/recording_complete_callback.rb index 87dfe676..f3add876 100644 --- a/lib/bandwidth-sdk/models/recording_complete_callback.rb +++ b/lib/bandwidth-sdk/models/recording_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -80,6 +80,28 @@ class RecordingCompleteCallback # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). attr_accessor :transfer_to + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/recording_state_enum.rb b/lib/bandwidth-sdk/models/recording_state_enum.rb index f02572ba..40ca7c72 100644 --- a/lib/bandwidth-sdk/models/recording_state_enum.rb +++ b/lib/bandwidth-sdk/models/recording_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/redirect_callback.rb b/lib/bandwidth-sdk/models/redirect_callback.rb index abf6c508..874e4ea5 100644 --- a/lib/bandwidth-sdk/models/redirect_callback.rb +++ b/lib/bandwidth-sdk/models/redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -63,6 +63,28 @@ class RedirectCallback # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). attr_accessor :transfer_to + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/redirect_method_enum.rb b/lib/bandwidth-sdk/models/redirect_method_enum.rb index c30fa2ab..5f4d63b2 100644 --- a/lib/bandwidth-sdk/models/redirect_method_enum.rb +++ b/lib/bandwidth-sdk/models/redirect_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/stir_shaken.rb b/lib/bandwidth-sdk/models/stir_shaken.rb index 2e68f124..21f1535d 100644 --- a/lib/bandwidth-sdk/models/stir_shaken.rb +++ b/lib/bandwidth-sdk/models/stir_shaken.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/tag.rb b/lib/bandwidth-sdk/models/tag.rb index ce48b5ec..46791f6f 100644 --- a/lib/bandwidth-sdk/models/tag.rb +++ b/lib/bandwidth-sdk/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb index 6537ccd5..866acaa4 100644 --- a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +++ b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/transcribe_recording.rb b/lib/bandwidth-sdk/models/transcribe_recording.rb index bb59784f..a8594b36 100644 --- a/lib/bandwidth-sdk/models/transcribe_recording.rb +++ b/lib/bandwidth-sdk/models/transcribe_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -32,6 +32,28 @@ class TranscribeRecording # This is the timeout (in seconds) to use when delivering the webhook to `callbackUrl`. Can be any numeric value (including decimals) between 1 and 25. attr_accessor :callback_timeout + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/transcription.rb b/lib/bandwidth-sdk/models/transcription.rb index acbe1c46..d0f077fd 100644 --- a/lib/bandwidth-sdk/models/transcription.rb +++ b/lib/bandwidth-sdk/models/transcription.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/transcription_available_callback.rb b/lib/bandwidth-sdk/models/transcription_available_callback.rb index d17422f5..89ff4613 100644 --- a/lib/bandwidth-sdk/models/transcription_available_callback.rb +++ b/lib/bandwidth-sdk/models/transcription_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -76,6 +76,28 @@ class TranscriptionAvailableCallback # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). attr_accessor :transfer_to + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/transcription_list.rb b/lib/bandwidth-sdk/models/transcription_list.rb index 57ea7a72..d52d0e37 100644 --- a/lib/bandwidth-sdk/models/transcription_list.rb +++ b/lib/bandwidth-sdk/models/transcription_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/transcription_metadata.rb b/lib/bandwidth-sdk/models/transcription_metadata.rb index b2e6e70a..f4a50e38 100644 --- a/lib/bandwidth-sdk/models/transcription_metadata.rb +++ b/lib/bandwidth-sdk/models/transcription_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/transfer_answer_callback.rb b/lib/bandwidth-sdk/models/transfer_answer_callback.rb index 3f471e58..1b914f82 100644 --- a/lib/bandwidth-sdk/models/transfer_answer_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -60,6 +60,28 @@ class TransferAnswerCallback # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). attr_accessor :transfer_to + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/transfer_complete_callback.rb b/lib/bandwidth-sdk/models/transfer_complete_callback.rb index c6df9e55..0f5f2390 100644 --- a/lib/bandwidth-sdk/models/transfer_complete_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -69,6 +69,28 @@ class TransferCompleteCallback # Bandwidth's internal id that references the error event. attr_accessor :error_id + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb index bf5b3920..2f12aebe 100644 --- a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -75,6 +75,28 @@ class TransferDisconnectCallback # Bandwidth's internal id that references the error event. attr_accessor :error_id + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/update_call.rb b/lib/bandwidth-sdk/models/update_call.rb index a0d92dfd..8a62a400 100644 --- a/lib/bandwidth-sdk/models/update_call.rb +++ b/lib/bandwidth-sdk/models/update_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -42,6 +42,28 @@ class UpdateCall # 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`. attr_accessor :tag + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/update_call_recording.rb b/lib/bandwidth-sdk/models/update_call_recording.rb index 5dde4551..b239a250 100644 --- a/lib/bandwidth-sdk/models/update_call_recording.rb +++ b/lib/bandwidth-sdk/models/update_call_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -17,6 +17,28 @@ module Bandwidth class UpdateCallRecording attr_accessor :state + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/update_conference.rb b/lib/bandwidth-sdk/models/update_conference.rb index 854ae3e8..eb5465ae 100644 --- a/lib/bandwidth-sdk/models/update_conference.rb +++ b/lib/bandwidth-sdk/models/update_conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -39,6 +39,28 @@ class UpdateConference # Basic auth password. attr_accessor :fallback_password + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/bandwidth-sdk/models/update_conference_member.rb b/lib/bandwidth-sdk/models/update_conference_member.rb index c99f970e..128d887c 100644 --- a/lib/bandwidth-sdk/models/update_conference_member.rb +++ b/lib/bandwidth-sdk/models/update_conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/verify_code_request.rb b/lib/bandwidth-sdk/models/verify_code_request.rb index 7d1a45c5..a859f0fa 100644 --- a/lib/bandwidth-sdk/models/verify_code_request.rb +++ b/lib/bandwidth-sdk/models/verify_code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/verify_code_response.rb b/lib/bandwidth-sdk/models/verify_code_response.rb index 8b4b1167..a80477f6 100644 --- a/lib/bandwidth-sdk/models/verify_code_response.rb +++ b/lib/bandwidth-sdk/models/verify_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/voice_api_error.rb b/lib/bandwidth-sdk/models/voice_api_error.rb index d2dae274..b7d149de 100644 --- a/lib/bandwidth-sdk/models/voice_api_error.rb +++ b/lib/bandwidth-sdk/models/voice_api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/models/voice_code_response.rb b/lib/bandwidth-sdk/models/voice_code_response.rb index 84cd5b97..6876518a 100644 --- a/lib/bandwidth-sdk/models/voice_code_response.rb +++ b/lib/bandwidth-sdk/models/voice_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/lib/bandwidth-sdk/version.rb b/lib/bandwidth-sdk/version.rb index ab9b8e47..f1abbcc0 100644 --- a/lib/bandwidth-sdk/version.rb +++ b/lib/bandwidth-sdk/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/openapi-config.yml b/openapi-config.yml index 6fd5c7db..c4fa47e0 100644 --- a/openapi-config.yml +++ b/openapi-config.yml @@ -4,8 +4,8 @@ gemDescription: The official client SDK for Bandwidth's Voice, Messaging, MFA, a gemHomepage: https://github.com/Bandwidth/ruby-sdk gemLicense: MIT gemName: bandwidth-sdk -gemRequiredRubyVersion: '>=2.4' +gemRequiredRubyVersion: '>=2.7' gemSummary: Bandwidth Ruby SDK gemVersion: 11.0.0 library: faraday -moduleName: Bandwidth \ No newline at end of file +moduleName: Bandwidth diff --git a/spec/api/participants_api_spec.rb b/spec/api/participants_api_spec.rb deleted file mode 100644 index 36643c2c..00000000 --- a/spec/api/participants_api_spec.rb +++ /dev/null @@ -1,74 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Bandwidth::ParticipantsApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ParticipantsApi' do - before do - # run before each test - @api_instance = Bandwidth::ParticipantsApi.new - end - - after do - # run after each test - end - - describe 'test an instance of ParticipantsApi' do - it 'should create an instance of ParticipantsApi' do - expect(@api_instance).to be_instance_of(Bandwidth::ParticipantsApi) - end - end - - # unit tests for create_participant - # Create Participant - # Create a new participant under this account. Participants are idempotent, so relevant parameters must be set in this function if desired. - # @param account_id Account ID - # @param [Hash] opts the optional parameters - # @option opts [CreateParticipantRequest] :create_participant_request Create participant request body. - # @return [CreateParticipantResponse] - describe 'create_participant test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for delete_participant - # Delete Participant - # Delete participant by ID. - # @param account_id Account ID - # @param participant_id Participant ID - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_participant test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for get_participant - # Get Participant - # Get participant by ID. - # @param account_id Account ID - # @param participant_id Participant ID - # @param [Hash] opts the optional parameters - # @return [Participant] - describe 'get_participant test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/spec/api/sessions_api_spec.rb b/spec/api/sessions_api_spec.rb deleted file mode 100644 index 998dc22e..00000000 --- a/spec/api/sessions_api_spec.rb +++ /dev/null @@ -1,145 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Bandwidth::SessionsApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'SessionsApi' do - before do - # run before each test - @api_instance = Bandwidth::SessionsApi.new - end - - after do - # run after each test - end - - describe 'test an instance of SessionsApi' do - it 'should create an instance of SessionsApi' do - expect(@api_instance).to be_instance_of(Bandwidth::SessionsApi) - end - end - - # unit tests for add_participant_to_session - # Add Participant to Session - # Add a participant to a session. Subscriptions can optionally be provided as part of this call. - # @param account_id Account ID - # @param session_id Session ID - # @param participant_id Participant ID - # @param [Hash] opts the optional parameters - # @option opts [Subscriptions] :subscriptions The Body describes an optional set of subscriptions to apply to the participant. Calling this endpoint with no/empty body will only add the participant to the session, and will not subscribe the Participant to any media. The request body for this endpoint is OPTIONAL and provided as a convenience to avoid additional calls to the Update Participant Subscriptions endpoint. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created - # @return [nil] - describe 'add_participant_to_session test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for create_session - # Create Session - # Create a new session. Sessions are idempotent, so relevant parameters must be set in this function if desired. - # @param account_id Account ID - # @param [Hash] opts the optional parameters - # @option opts [Session] :session Create session request body. - # @return [Session] - describe 'create_session test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for delete_session - # Delete Session - # Delete session by ID. - # @param account_id Account ID - # @param session_id Session ID - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_session test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for get_participant_subscriptions - # Get Participant Subscriptions - # Get a participant's subscriptions. - # @param account_id Account ID - # @param session_id Session ID - # @param participant_id Participant ID - # @param [Hash] opts the optional parameters - # @return [Subscriptions] - describe 'get_participant_subscriptions test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for get_session - # Get Session - # Get session by ID. - # @param account_id Account ID - # @param session_id Session ID - # @param [Hash] opts the optional parameters - # @return [Session] - describe 'get_session test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for list_session_participants - # List Participants in Session - # List participants in a session. - # @param account_id Account ID - # @param session_id Session ID - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'list_session_participants test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for remove_participant_from_session - # Remove Participant from Session - # Remove a participant from a session. This will automatically remove any subscriptions the participant has associated with this session. - # @param account_id Account ID - # @param session_id Session ID - # @param participant_id Participant ID - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'remove_participant_from_session test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for update_participant_subscriptions - # Update Participant Subscriptions - # Update a participant's subscriptions. This is a full update that will replace the participant's subscriptions. It allows subscription to the entire Session, a subset list of Participants in that Session, or specific media streams on any of the listed Participants. First call `getParticipantSubscriptions` if you need the current subscriptions. Calling this API with no `Subscriptions` object to remove all subscriptions. - # @param account_id Account ID - # @param session_id Session ID - # @param participant_id Participant ID - # @param [Hash] opts the optional parameters - # @option opts [Subscriptions] :subscriptions The body describes the desired subscriptions for the Participant. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created - # @return [nil] - describe 'update_participant_subscriptions test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/spec/integration/calls_api_integration_spec.rb b/spec/integration/calls_api_integration_spec.rb new file mode 100644 index 00000000..760e0b8d --- /dev/null +++ b/spec/integration/calls_api_integration_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' +require 'json' + +# Integration Tests for Bandwidth::CallsApi +describe 'CallsApi Integration Tests' do + before do + # run before each test + @api_instance = Bandwidth::CallsApi.new + end + + after do + # run after each test + end + + # Create Call + describe 'create_call test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Get Call State Information + describe 'get_call_state test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Update Call + describe 'update_call test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Update Call BXML + describe 'update_call_bxml test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/integration/conferences_api_integration_spec.rb b/spec/integration/conferences_api_integration_spec.rb new file mode 100644 index 00000000..58683c78 --- /dev/null +++ b/spec/integration/conferences_api_integration_spec.rb @@ -0,0 +1,78 @@ +require 'spec_helper' +require 'json' + +# Integration Tests for Bandwidth::ConferencesApi +describe 'ConferencesApi Integration Tests' do + before do + # run before each test + @api_instance = Bandwidth::ConferencesApi.new + end + + after do + # run after each test + end + + # Download Conference Recording + describe 'download_conference_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Get Conference Information + describe 'get_conference test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Get Conference Member + describe 'get_conference_member test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Get Conference Recording Information + describe 'get_conference_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Get Conference Recordings + describe 'list_conference_recordings test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Get Conferences + describe 'list_conferences test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Update Conference + describe 'update_conference test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Update Conference BXML + describe 'update_conference_bxml test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Update Conference Member + describe 'update_conference_member test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/integration/media_api_integration_spec.rb b/spec/integration/media_api_integration_spec.rb new file mode 100644 index 00000000..06e92232 --- /dev/null +++ b/spec/integration/media_api_integration_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' +require 'json' + +# Integration Tests for Bandwidth::MediaApi +describe 'MediaApi Integration Tests' do + before do + # run before each test + @api_instance = Bandwidth::MediaApi.new + end + + after do + # run after each test + end + + # Delete Media + describe 'delete_media test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Get Media + describe 'get_media test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # List Media + describe 'list_media test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Upload Media + describe 'upload_media test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/integration/messages_api_integration_spec.rb b/spec/integration/messages_api_integration_spec.rb new file mode 100644 index 00000000..13243004 --- /dev/null +++ b/spec/integration/messages_api_integration_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' +require 'json' + +# Integration Tests for Bandwidth::MessagesApi +describe 'MessagesApi Integration Tests' do + before(:all) do + @api_instance_msg = Bandwidth::MessagesApi.new() + end + + before do + Bandwidth.configure do |config| + config.username = BW_USERNAME + config.password = BW_PASSWORD + #config.ssl_verify = false # remove for testing on push + end + end + + # Create Message + describe 'create_message' do + + end + + # List Messages + describe 'list_messages' do + + end + +end diff --git a/spec/integration/mfa_api_integration_spec.rb b/spec/integration/mfa_api_integration_spec.rb new file mode 100644 index 00000000..ee9af92f --- /dev/null +++ b/spec/integration/mfa_api_integration_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' +require 'json' + +# Integration Tests for Bandwidth::MFAApi +describe 'MFAApi Integration Tests' do + before do + # run before each test + @api_instance = Bandwidth::MFAApi.new + end + + after do + # run after each test + end + + # Messaging Authentication Code + describe 'generate_messaging_code test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Voice Authentication Code + describe 'generate_voice_code test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Verify Authentication Code + describe 'verify_code test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/integration/phone_number_lookup_api_integration_spec.rb b/spec/integration/phone_number_lookup_api_integration_spec.rb new file mode 100644 index 00000000..088c89a0 --- /dev/null +++ b/spec/integration/phone_number_lookup_api_integration_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' +require 'json' + +# Integration Tests for Bandwidth::PhoneNumberLookupApi +describe 'PhoneNumberLookupApi Integration Tests' do + before do + # run before each test + @api_instance = Bandwidth::PhoneNumberLookupApi.new + end + + after do + # run after each test + end + + # Create Lookup + describe 'create_lookup test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Get Lookup Request Status + describe 'get_lookup_status test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/integration/recordings_api_integration_spec.rb b/spec/integration/recordings_api_integration_spec.rb new file mode 100644 index 00000000..a2477bc8 --- /dev/null +++ b/spec/integration/recordings_api_integration_spec.rb @@ -0,0 +1,85 @@ +require 'spec_helper' +require 'json' + +# Integration Tests for Bandwidth::RecordingsApi +describe 'RecordingsApi Integration Tests' do + before do + # run before each test + @api_instance = Bandwidth::RecordingsApi.new + end + + after do + # run after each test + end + + # Delete Transcription + describe 'delete_call_transcription test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Delete Recording + describe 'delete_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Delete Recording Media + describe 'delete_recording_media test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Download Recording + describe 'download_call_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Get Call Recording + describe 'get_call_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Get Transcription + describe 'get_call_transcription test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Get Call Recordings + describe 'list_account_call_recordings test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # List Call Recordings + describe 'list_call_recordings test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Create Transcription Request + describe 'transcribe_call_recording test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # Update Recording + describe 'update_call_recording_state test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/integration/statistics_api_integration_spec.rb b/spec/integration/statistics_api_integration_spec.rb new file mode 100644 index 00000000..efcc7700 --- /dev/null +++ b/spec/integration/statistics_api_integration_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' +require 'json' + +# Integration Tests for Bandwidth::StatisticsApi +describe 'StatisticsApi Integration Tests' do + before do + # run before each test + @api_instance = Bandwidth::StatisticsApi.new + end + + after do + # run after each test + end + + # Get Account Statistics + describe 'get_statistics test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/create_participant_response_spec.rb b/spec/models/create_participant_response_spec.rb deleted file mode 100644 index 1789e895..00000000 --- a/spec/models/create_participant_response_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Bandwidth::CreateParticipantResponse -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::CreateParticipantResponse do - let(:instance) { Bandwidth::CreateParticipantResponse.new } - - describe 'test an instance of CreateParticipantResponse' do - it 'should create an instance of CreateParticipantResponse' do - expect(instance).to be_instance_of(Bandwidth::CreateParticipantResponse) - end - end - describe 'test attribute "participant"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "token"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/spec/models/device_api_version_enum_spec.rb b/spec/models/device_api_version_enum_spec.rb deleted file mode 100644 index c416bb4e..00000000 --- a/spec/models/device_api_version_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Bandwidth::DeviceApiVersionEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::DeviceApiVersionEnum do - let(:instance) { Bandwidth::DeviceApiVersionEnum.new } - - describe 'test an instance of DeviceApiVersionEnum' do - it 'should create an instance of DeviceApiVersionEnum' do - expect(instance).to be_instance_of(Bandwidth::DeviceApiVersionEnum) - end - end -end diff --git a/spec/models/forbidden_request_spec.rb b/spec/models/forbidden_request_spec.rb deleted file mode 100644 index ec55d16e..00000000 --- a/spec/models/forbidden_request_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Bandwidth::ForbiddenRequest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ForbiddenRequest do - let(:instance) { Bandwidth::ForbiddenRequest.new } - - describe 'test an instance of ForbiddenRequest' do - it 'should create an instance of ForbiddenRequest' do - expect(instance).to be_instance_of(Bandwidth::ForbiddenRequest) - end - end - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/spec/models/participant_subscription_spec.rb b/spec/models/participant_subscription_spec.rb deleted file mode 100644 index f6613345..00000000 --- a/spec/models/participant_subscription_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Bandwidth::ParticipantSubscription -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ParticipantSubscription do - let(:instance) { Bandwidth::ParticipantSubscription.new } - - describe 'test an instance of ParticipantSubscription' do - it 'should create an instance of ParticipantSubscription' do - expect(instance).to be_instance_of(Bandwidth::ParticipantSubscription) - end - end - describe 'test attribute "participant_id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "stream_aliases"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/spec/models/publish_permissions_enum_spec.rb b/spec/models/publish_permissions_enum_spec.rb deleted file mode 100644 index f368ce13..00000000 --- a/spec/models/publish_permissions_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Bandwidth::PublishPermissionsEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::PublishPermissionsEnum do - let(:instance) { Bandwidth::PublishPermissionsEnum.new } - - describe 'test an instance of PublishPermissionsEnum' do - it 'should create an instance of PublishPermissionsEnum' do - expect(instance).to be_instance_of(Bandwidth::PublishPermissionsEnum) - end - end -end diff --git a/spec/models/request_error_spec.rb b/spec/models/request_error_spec.rb deleted file mode 100644 index ae7a29dd..00000000 --- a/spec/models/request_error_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Bandwidth::RequestError -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::RequestError do - let(:instance) { Bandwidth::RequestError.new } - - describe 'test an instance of RequestError' do - it 'should create an instance of RequestError' do - expect(instance).to be_instance_of(Bandwidth::RequestError) - end - end - describe 'test attribute "error"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "request_id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/spec/models/session_spec.rb b/spec/models/session_spec.rb deleted file mode 100644 index e935320d..00000000 --- a/spec/models/session_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Bandwidth::Session -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::Session do - let(:instance) { Bandwidth::Session.new } - - describe 'test an instance of Session' do - it 'should create an instance of Session' do - expect(instance).to be_instance_of(Bandwidth::Session) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/spec/models/subscriptions_spec.rb b/spec/models/subscriptions_spec.rb deleted file mode 100644 index a0627602..00000000 --- a/spec/models/subscriptions_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Bandwidth::Subscriptions -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::Subscriptions do - let(:instance) { Bandwidth::Subscriptions.new } - - describe 'test an instance of Subscriptions' do - it 'should create an instance of Subscriptions' do - expect(instance).to be_instance_of(Bandwidth::Subscriptions) - end - end - describe 'test attribute "session_id"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "participants"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/spec/models/unauthorized_request_spec.rb b/spec/models/unauthorized_request_spec.rb deleted file mode 100644 index f0192761..00000000 --- a/spec/models/unauthorized_request_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Bandwidth::UnauthorizedRequest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::UnauthorizedRequest do - let(:instance) { Bandwidth::UnauthorizedRequest.new } - - describe 'test an instance of UnauthorizedRequest' do - it 'should create an instance of UnauthorizedRequest' do - expect(instance).to be_instance_of(Bandwidth::UnauthorizedRequest) - end - end - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1b482845..bf55ddf3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -32,6 +32,25 @@ # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| + config.before(:suite) { + begin + BW_USERNAME = ENV.fetch("BW_USERNAME") + BW_PASSWORD = ENV.fetch("BW_PASSWORD") + BW_ACCOUNT_ID = ENV.fetch("BW_ACCOUNT_ID") + BW_VOICE_APPLICATION_ID = ENV.fetch("BW_VOICE_APPLICATION_ID") + BW_MESSAGING_APPLICATION_ID = ENV.fetch("BW_MESSAGING_APPLICATION_ID") + BASE_CALLBACK_URL = ENV.fetch("BASE_CALLBACK_URL") + BW_NUMBER = ENV.fetch("BW_NUMBER") + USER_NUMBER = ENV.fetch("USER_NUMBER") + rescue + puts "Environmental variables not found" + exit(-1) + end + + DATA = 0 # index for response array related to the response data + CODE = 1 # index for response array related to the status code + } + # rspec-expectations config goes here. You can use an alternate # assertion/expectation library such as wrong or the stdlib/minitest # assertions if you prefer. diff --git a/spec/test.rb b/spec/test.rb index f6834bad..d5afd8ad 100644 --- a/spec/test.rb +++ b/spec/test.rb @@ -1,11 +1,8 @@ require 'test/unit' -require_relative '../lib/openapi_ruby_sdk.rb' +require_relative '../lib/bandwidth-sdk.rb' require 'securerandom' require 'set' -include RubySdk - -DATA = 0 # index for response array related to the response data -CODE = 1 # index for response array related to the status code +include Bandwidth begin BW_USERNAME = ENV.fetch("BW_USERNAME") @@ -22,85 +19,6 @@ end class ValidationTest < Test::Unit::TestCase - RubySdk.configure do |config| - # Configure HTTP basic authorization: httpBasic - config.username = BW_USERNAME - config.password = BW_PASSWORD - #config.ssl_verify = false # remove for testing on push - end - - #-----------Messaging and Media Tests----------- - $api_instance_msg = RubySdk::MessagesApi.new() - $api_instance_media = RubySdk::MediaApi.new() - - def test_create_message_sms # Test sending an SMS message - message_text = "ruby sdk test SMS" - body = RubySdk::MessageRequest.new( - application_id: BW_MESSAGING_APPLICATION_ID, - to: [USER_NUMBER], - from: BW_NUMBER, - text: message_text - ) - response = $api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) - assert_equal(202, response[CODE], "incorrect response code") - assert_equal(29, response[DATA].id.length, "id not set") - assert_equal(BW_NUMBER, response[DATA].owner, "message owner not correct") - assert_equal(BW_NUMBER, response[DATA].from, "from number does not match") - assert_equal([USER_NUMBER], response[DATA].to, "to number does not match") - assert_equal(body.tag, response[DATA].tag, "tags do not match") - assert_equal(body.media,response[DATA].media, "media does not match") - assert_equal(message_text, response[DATA].text, "message text does not match") - end - - def test_create_message_mms # Test sending an MMS message - message_text = "ruby sdk test MMS" - body = RubySdk::MessageRequest.new( - application_id: BW_MESSAGING_APPLICATION_ID, - to: [USER_NUMBER], - from: BW_NUMBER, - text: message_text, - media: ["https://cdn2.thecatapi.com/images/MTY3ODIyMQ.jpg"] - ) - response = $api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) - assert_equal(202, response[CODE], "incorrect response code") - assert_equal(29, response[DATA].id.length, "id not set") - assert_equal(BW_NUMBER, response[DATA].owner, "message owner not correct") - assert_equal(BW_NUMBER, response[DATA].from, "from number does not match") - assert_equal([USER_NUMBER], response[DATA].to, "to number does not match") - assert_equal(body.tag, response[DATA].tag, "tags do not match") - assert_equal(body.media,response[DATA].media, "media does not match") - assert_equal(message_text, response[DATA].text, "message text does not match") - end - - def test_get_message # Test to get most recent message from the BW_NUMBER - get_opts = { - :source_tn => BW_NUMBER, - :message_direction => "OUTBOUND" - } - response = $api_instance_msg.get_messages_with_http_info(BW_ACCOUNT_ID, get_opts) - assert_equal(200, response[CODE], "incorrect response code") - assert_equal(BW_ACCOUNT_ID, response[DATA].messages[0].account_id, "account ids do not match") - assert_equal("OUTBOUND", response[DATA].messages[0].message_direction, "message directions do not match") - assert_equal(BW_NUMBER, response[DATA].messages[0].source_tn, "failed to get message from BW_NUMBER") - end - - def test_create_message_invalid_phone_number # Test to make sure correct errors are thrown when trying to send a text to an invalid number - body = RubySdk::MessageRequest.new( - application_id: BW_MESSAGING_APPLICATION_ID, - to: ["+1invalid"], - from: BW_NUMBER, - text: "ruby sdk test" - ) - e = assert_raise(RubySdk::ApiError, "expected exception not raised") do - $response = $api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) - - end - resp_body = JSON.parse(e.response_body) - expected_desc = "\'+1invalid\' must be replaced with a valid E164 formatted telephone number" - assert_equal(400, e.code, "incorrect response code") - assert_equal("request-validation", resp_body['type'], "response type does not match") - assert_equal(expected_desc, resp_body['fieldErrors'][0]['description'], "error description does not match expected") - end def test_valid_media # Test Media Upload, List, Download, and Delete media_name = 'ruby_media' + SecureRandom.uuid @@ -128,7 +46,7 @@ def test_valid_media # Test Media Upload, List, Download, and Delete def test_get_delete_invalid_media # Test to make sure correct errors are thrown when trying to list and get media that does not exist media_name = "invalid_media" # get media - e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do $api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, media_name, debug_return_type: 'String') end assert_equal(404, e.code, "incorrect response code") @@ -141,10 +59,10 @@ def test_get_delete_invalid_media # Test to make sure correct errors are th #-----------Voice Tests----------- - $api_instance_voice = RubySdk::CallsApi.new() + $api_instance_voice = Bandwidth::CallsApi.new() def test_create_call_and_get_call_state # Test to create an outbound call and get its state - amd_config = RubySdk::MachineDetectionConfiguration.new( + amd_config = Bandwidth::MachineDetectionConfiguration.new( mode: "async", detection_timeout: 5.0, silence_timeout: 5.0, @@ -154,7 +72,7 @@ def test_create_call_and_get_call_state # Test to create an outbound call an callback_url: BASE_CALLBACK_URL + "/machineDetection", callback_method: "POST" ) - call_body = RubySdk::CreateCallRequest.new( + call_body = Bandwidth::CreateCallRequest.new( application_id: BW_VOICE_APPLICATION_ID, to: USER_NUMBER, from: BW_NUMBER, @@ -204,7 +122,7 @@ def test_create_call_and_get_call_state # Test to create an outbound call an end def test_create_get_failed_call # Test to make sure correct errors are thrown when trying to create a call incorrectly and get a call that does not exist - call_body = RubySdk::CreateCallRequest.new( + call_body = Bandwidth::CreateCallRequest.new( application_id: BW_VOICE_APPLICATION_ID, to: "+1invalid", from: BW_NUMBER, @@ -216,10 +134,10 @@ def test_create_get_failed_call # Test to make sure correct errors are throw dne_id = "does-not-exist" - call_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + call_e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do $api_instance_voice.create_call_with_http_info(BW_ACCOUNT_ID, call_body) end - get_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + get_e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do $api_instance_voice.get_call_with_http_info(BW_ACCOUNT_ID, dne_id) end @@ -235,10 +153,10 @@ def test_create_get_failed_call # Test to make sure correct errors are throw end #-----------MFA Tests----------- - $api_instance_mfa = RubySdk::MFAApi.new() + $api_instance_mfa = Bandwidth::MFAApi.new() def test_mfa_messaging # Test to send a messaging mfa code - req_schema = RubySdk::TwoFactorCodeRequestSchema.new( + req_schema = Bandwidth::TwoFactorCodeRequestSchema.new( to: USER_NUMBER, from: BW_NUMBER, application_id: BW_MESSAGING_APPLICATION_ID, @@ -251,14 +169,14 @@ def test_mfa_messaging # Test to send a messaging mfa code end def test_failed_mfa_messaging # Test to make sure correct errors are thrown when trying to send a messaging mfa code incorrectly - req_schema = RubySdk::TwoFactorCodeRequestSchema.new( + req_schema = Bandwidth::TwoFactorCodeRequestSchema.new( to: USER_NUMBER, from: BW_NUMBER, application_id: BW_MESSAGING_APPLICATION_ID, message: "Your temporary {NAME} {SCOPE} code is: ", digits: 6 ) - e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do $api_instance_mfa.messaging_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) end assert_equal(400, e.code, "incorrect response code") @@ -266,7 +184,7 @@ def test_failed_mfa_messaging # Test to make sure correct errors are thrown end def test_mfa_voice # Test to send a voice mfa code - req_schema = RubySdk::TwoFactorCodeRequestSchema.new( + req_schema = Bandwidth::TwoFactorCodeRequestSchema.new( to: USER_NUMBER, from: BW_NUMBER, application_id: BW_VOICE_APPLICATION_ID, @@ -279,14 +197,14 @@ def test_mfa_voice # Test to send a voice mfa code end def test_failed_mfa_voice # Test to make sure correct errors are thrown when trying to send a voice mfa code incorrectly - req_schema = RubySdk::TwoFactorCodeRequestSchema.new( + req_schema = Bandwidth::TwoFactorCodeRequestSchema.new( to: USER_NUMBER, from: BW_NUMBER, application_id: BW_VOICE_APPLICATION_ID, message: "Your temporary {NAME} {SCOPE} code is: ", digits: 6 ) - e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do $api_instance_mfa.voice_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) end assert_equal(400, e.code, "incorrect response code") @@ -295,7 +213,7 @@ def test_failed_mfa_voice # Test to make sure correct errors are thrown whe def test_mfa_verify # Test to verify a correct received mfa code omit("Currently no way to do this without receiving callbacks") - req_schema = RubySdk::TwoFactorVerifyRequestSchema.new( + req_schema = Bandwidth::TwoFactorVerifyRequestSchema.new( to: "+1000" + rand(1...10000000).to_s, application_id: BW_VOICE_APPLICATION_ID, expiration_time_in_minutes: 3, @@ -307,7 +225,7 @@ def test_mfa_verify # Test to verify a correct received mfa code end def test_failed_mfa_verify # Test to verify an incorrect received mfa code - req_schema = RubySdk::TwoFactorVerifyRequestSchema.new( + req_schema = Bandwidth::TwoFactorVerifyRequestSchema.new( to: "+1000" + rand(1...10000000).to_s, application_id: BW_VOICE_APPLICATION_ID, expiration_time_in_minutes: 3, @@ -318,102 +236,11 @@ def test_failed_mfa_verify # Test to verify an incorrect received mfa code assert(mfa_response[DATA].valid.is_a?(FalseClass), "incorrect valid data type") end - #-----------WebRTC Tests----------- - $api_instance_webrtc = RubySdk::SessionsApi.new() - $api_instance_participants = RubySdk::ParticipantsApi.new() - - def test_webrtc_create_get_delete_session # Test to create, get, and delete a webrtc session - session_body = RubySdk::Session.new( - tag: "ruby sdk test" - ) - create_response = $api_instance_webrtc.create_session_with_http_info(BW_ACCOUNT_ID, session: session_body) - assert_equal(200, create_response[CODE], "incorrect response code") - assert_equal(36, create_response[DATA].id.length, "session id not set") - assert_equal(session_body.tag.to_s, create_response[DATA].tag, "created session tag does not match expected") - - get_response = $api_instance_webrtc.get_session_with_http_info(BW_ACCOUNT_ID, create_response[DATA].id) - assert_equal(200, get_response[CODE], "incorrect response code") - assert_equal(create_response[DATA].id, get_response[DATA].id, "session id does not match") - assert_equal(session_body.tag.to_s, get_response[DATA].tag, "gotten session tag does not match expected") - - del_response = $api_instance_webrtc.delete_session_with_http_info(BW_ACCOUNT_ID, create_response[DATA].id) - assert_equal(204, del_response[CODE], "incorrect response code") - end - - def test_failed_get_session # Test to make sure correct errors are thrown when improperly trying to get session details - malf_id = "invalid" - dne_id = "11111111-2222-3333-4444-555555555555" - expected_error = "Could not find session for id " + dne_id - malf_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do - $api_instance_webrtc.get_session_with_http_info(BW_ACCOUNT_ID, malf_id) - end - assert_equal(400, malf_e.code, "incorrect response code") - assert_equal("Malformed session id", JSON.parse(malf_e.response_body)['error'], "response error does not match") - - dne_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do - $api_instance_webrtc.get_session_with_http_info(BW_ACCOUNT_ID, dne_id) - end - assert_equal(404, dne_e.code, "incorrect response code") - assert_equal(expected_error, JSON.parse(dne_e.response_body)['error'], "response error does not match") - end - - def test_create_get_delete_participant # Test to successfully create, get, and delete a webrtc participant - part_body = RubySdk::Participant.new( - publish_permissions: ["VIDEO", "AUDIO"], - device_api_version: "V3", - tag: "ruby sdk test" - ) - create_response = $api_instance_participants.create_participant_with_http_info(BW_ACCOUNT_ID, participant: part_body) - part_id = create_response[DATA].participant.id - assert_equal(200, create_response[CODE], "incorrect response code") - assert_equal(36, create_response[DATA].participant.id.length, "participant id not set") - assert_equal(part_body.publish_permissions.to_set, create_response[DATA].participant.publish_permissions.to_set, "participant permissions do not match") - assert_equal(part_body.device_api_version, create_response[DATA].participant.device_api_version, "participant api version does not match") - assert_equal(part_body.tag, create_response[DATA].participant.tag, "participant tag does not match") - - get_response = $api_instance_participants.get_participant_with_http_info(BW_ACCOUNT_ID, part_id) - assert_equal(200, get_response[CODE], "incorrect response code") - assert_equal(part_id, get_response[DATA].id, "participant id does not match") - assert_equal(part_body.publish_permissions.to_set, get_response[DATA].publish_permissions.to_set, "participant permissions do not match") - assert_equal(part_body.device_api_version, get_response[DATA].device_api_version, "participant api version does not match") - assert_equal(part_body.tag, get_response[DATA].tag, "participant tag does not match") - - del_response = $api_instance_participants.delete_participant_with_http_info(BW_ACCOUNT_ID, part_id) - assert_equal(204, del_response[CODE], "incorrect response code") - end - - def test_failed_create_get_delete_participant # Test to make sure correct errors are thrown when using invalid participant info - part_body_bad = RubySdk::Participant.new( - publish_permissions: ["AUDIO", "VIDEO", "INVALID"], - device_api_version: "V3", - tag: "ruby sdk test invalid" - ) - dne_id = "11111111-2222-3333-4444-555555555555" - expected_error = "Could not find participant for id " + dne_id - - create_e = assert_raise(RubySdk::ApiError, "expected ecpetion not raised") do - $api_instance_participants.create_participant_with_http_info(BW_ACCOUNT_ID, participant: part_body_bad) - end - assert_equal(400, create_e.code, "incorrect response code") - - get_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do - $api_instance_participants.get_participant_with_http_info(BW_ACCOUNT_ID, dne_id) - end - assert_equal(404, get_e.code, "incorrect response code") - assert_equal(expected_error, JSON.parse(get_e.response_body)['error'], "response error does not match") - - del_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do - $api_instance_participants.delete_participant_with_http_info(BW_ACCOUNT_ID, dne_id) - end - assert_equal(404, del_e.code, "incorrect response code") - assert_equal(expected_error, JSON.parse(del_e.response_body)['error'], "response error does not match") - end - #-----------TN Lookup Tests----------- - $api_instance_tnlookup = RubySdk::PhoneNumberLookupApi.new() + $api_instance_tnlookup = Bandwidth::PhoneNumberLookupApi.new() def test_create_get_tn_lookup # Test to create and get the status of a TN Lookup Request - tn_body = RubySdk::OrderRequest.new( + tn_body = Bandwidth::OrderRequest.new( tns: [BW_NUMBER] ) create_response = $api_instance_tnlookup.lookup_request_with_http_info(BW_ACCOUNT_ID, tn_body) @@ -433,19 +260,19 @@ def test_create_get_tn_lookup # Test to create and get the status of a TN Look end def test_failed_create_get_tn_lookup # Test to make sure correct errors are thrown when trying to improperly create and get a TN Lookup Request - tn_body_bad = RubySdk::OrderRequest.new( + tn_body_bad = Bandwidth::OrderRequest.new( tns: ["+1invalid"] ) req_id_dne = "invalid" expected_error = "Some tns do not match e164 format: " + tn_body_bad.tns[0] #req_id_dne = "11111111-2222-3333-4444-555555555555" - create_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + create_e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do $api_instance_tnlookup.lookup_request_with_http_info(BW_ACCOUNT_ID, tn_body_bad) end assert_equal(400, create_e.code, "incorrect response type") assert_equal(expected_error, JSON.parse(create_e.response_body)['message'], "response error does not match") - get_e = assert_raise(RubySdk::ApiError, "expected exception not raised") do + get_e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do $api_instance_tnlookup.lookup_request_status_with_http_info(BW_ACCOUNT_ID, req_id_dne) end assert_equal(404, get_e.code, "incorrect response type") diff --git a/spec/api/calls_api_spec.rb b/spec/unit/api/calls_api_spec.rb similarity index 99% rename from spec/api/calls_api_spec.rb rename to spec/unit/api/calls_api_spec.rb index 72b7df75..bc8b4a01 100644 --- a/spec/api/calls_api_spec.rb +++ b/spec/unit/api/calls_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/api/conferences_api_spec.rb b/spec/unit/api/conferences_api_spec.rb similarity index 99% rename from spec/api/conferences_api_spec.rb rename to spec/unit/api/conferences_api_spec.rb index 1f7353cf..1cdb9a3f 100644 --- a/spec/api/conferences_api_spec.rb +++ b/spec/unit/api/conferences_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/api/media_api_spec.rb b/spec/unit/api/media_api_spec.rb similarity index 89% rename from spec/api/media_api_spec.rb rename to spec/unit/api/media_api_spec.rb index 829887ff..4fdb3c45 100644 --- a/spec/api/media_api_spec.rb +++ b/spec/unit/api/media_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -73,7 +73,7 @@ # unit tests for upload_media # Upload Media - # Upload a file. You may add headers to the request in order to provide some control to your media file. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). + # Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). # @param account_id Your Bandwidth Account ID. # @param media_id Media ID to retrieve. # @param body diff --git a/spec/api/messages_api_spec.rb b/spec/unit/api/messages_api_spec.rb similarity index 94% rename from spec/api/messages_api_spec.rb rename to spec/unit/api/messages_api_spec.rb index 266d42e0..6ada2bb9 100644 --- a/spec/api/messages_api_spec.rb +++ b/spec/unit/api/messages_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -17,9 +17,8 @@ # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'MessagesApi' do - before do - # run before each test - @api_instance = Bandwidth::MessagesApi.new + before(:all) do + @api_instance_msg = Bandwidth::MessagesApi.new() end after do @@ -28,7 +27,7 @@ describe 'test an instance of MessagesApi' do it 'should create an instance of MessagesApi' do - expect(@api_instance).to be_instance_of(Bandwidth::MessagesApi) + expect(@api_instance_msg).to be_instance_of(Bandwidth::MessagesApi) end end @@ -40,7 +39,7 @@ # @param [Hash] opts the optional parameters # @return [Message] describe 'create_message test' do - it 'should work' do + it 'create a message' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/api/mfa_api_spec.rb b/spec/unit/api/mfa_api_spec.rb similarity index 98% rename from spec/api/mfa_api_spec.rb rename to spec/unit/api/mfa_api_spec.rb index 7865d905..f65ea056 100644 --- a/spec/api/mfa_api_spec.rb +++ b/spec/unit/api/mfa_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/api/phone_number_lookup_api_spec.rb b/spec/unit/api/phone_number_lookup_api_spec.rb similarity index 98% rename from spec/api/phone_number_lookup_api_spec.rb rename to spec/unit/api/phone_number_lookup_api_spec.rb index 7ebb5b72..23a47b5a 100644 --- a/spec/api/phone_number_lookup_api_spec.rb +++ b/spec/unit/api/phone_number_lookup_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/api/recordings_api_spec.rb b/spec/unit/api/recordings_api_spec.rb similarity index 99% rename from spec/api/recordings_api_spec.rb rename to spec/unit/api/recordings_api_spec.rb index 658c55f0..4f52bd89 100644 --- a/spec/api/recordings_api_spec.rb +++ b/spec/unit/api/recordings_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/api/statistics_api_spec.rb b/spec/unit/api/statistics_api_spec.rb similarity index 97% rename from spec/api/statistics_api_spec.rb rename to spec/unit/api/statistics_api_spec.rb index bbeb8c9c..e24d44bd 100644 --- a/spec/api/statistics_api_spec.rb +++ b/spec/unit/api/statistics_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/api_client_spec.rb b/spec/unit/api_client_spec.rb similarity index 99% rename from spec/api_client_spec.rb rename to spec/unit/api_client_spec.rb index c712477f..a5177d4e 100644 --- a/spec/api_client_spec.rb +++ b/spec/unit/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/configuration_spec.rb b/spec/unit/configuration_spec.rb similarity index 96% rename from spec/configuration_spec.rb rename to spec/unit/configuration_spec.rb index e75eac3d..490eb306 100644 --- a/spec/configuration_spec.rb +++ b/spec/unit/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/account_statistics_spec.rb b/spec/unit/models/account_statistics_spec.rb similarity index 97% rename from spec/models/account_statistics_spec.rb rename to spec/unit/models/account_statistics_spec.rb index 851f5ade..a16987e0 100644 --- a/spec/models/account_statistics_spec.rb +++ b/spec/unit/models/account_statistics_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/answer_callback_spec.rb b/spec/unit/models/answer_callback_spec.rb similarity index 99% rename from spec/models/answer_callback_spec.rb rename to spec/unit/models/answer_callback_spec.rb index b509abe8..7ea9e15c 100644 --- a/spec/models/answer_callback_spec.rb +++ b/spec/unit/models/answer_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/bridge_complete_callback_spec.rb b/spec/unit/models/bridge_complete_callback_spec.rb similarity index 99% rename from spec/models/bridge_complete_callback_spec.rb rename to spec/unit/models/bridge_complete_callback_spec.rb index 7f7dd7b2..3e39209a 100644 --- a/spec/models/bridge_complete_callback_spec.rb +++ b/spec/unit/models/bridge_complete_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/bridge_target_complete_callback_spec.rb b/spec/unit/models/bridge_target_complete_callback_spec.rb similarity index 98% rename from spec/models/bridge_target_complete_callback_spec.rb rename to spec/unit/models/bridge_target_complete_callback_spec.rb index 941df01e..bee95057 100644 --- a/spec/models/bridge_target_complete_callback_spec.rb +++ b/spec/unit/models/bridge_target_complete_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/call_direction_enum_spec.rb b/spec/unit/models/call_direction_enum_spec.rb similarity index 95% rename from spec/models/call_direction_enum_spec.rb rename to spec/unit/models/call_direction_enum_spec.rb index 01899927..c924bc2e 100644 --- a/spec/models/call_direction_enum_spec.rb +++ b/spec/unit/models/call_direction_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/call_recording_metadata_spec.rb b/spec/unit/models/call_recording_metadata_spec.rb similarity index 99% rename from spec/models/call_recording_metadata_spec.rb rename to spec/unit/models/call_recording_metadata_spec.rb index 8894b7ce..baae48fb 100644 --- a/spec/models/call_recording_metadata_spec.rb +++ b/spec/unit/models/call_recording_metadata_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/call_state_enum_spec.rb b/spec/unit/models/call_state_enum_spec.rb similarity index 95% rename from spec/models/call_state_enum_spec.rb rename to spec/unit/models/call_state_enum_spec.rb index 4c340713..31f4f843 100644 --- a/spec/models/call_state_enum_spec.rb +++ b/spec/unit/models/call_state_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/call_state_spec.rb b/spec/unit/models/call_state_spec.rb similarity index 99% rename from spec/models/call_state_spec.rb rename to spec/unit/models/call_state_spec.rb index fb758eb8..277dced0 100644 --- a/spec/models/call_state_spec.rb +++ b/spec/unit/models/call_state_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/callback_method_enum_spec.rb b/spec/unit/models/callback_method_enum_spec.rb similarity index 95% rename from spec/models/callback_method_enum_spec.rb rename to spec/unit/models/callback_method_enum_spec.rb index abe6c97f..3dc07d14 100644 --- a/spec/models/callback_method_enum_spec.rb +++ b/spec/unit/models/callback_method_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/code_request_spec.rb b/spec/unit/models/code_request_spec.rb similarity index 98% rename from spec/models/code_request_spec.rb rename to spec/unit/models/code_request_spec.rb index a2a8754f..43a2bfa0 100644 --- a/spec/models/code_request_spec.rb +++ b/spec/unit/models/code_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/conference_completed_callback_spec.rb b/spec/unit/models/conference_completed_callback_spec.rb similarity index 98% rename from spec/models/conference_completed_callback_spec.rb rename to spec/unit/models/conference_completed_callback_spec.rb index 4818af21..419796e3 100644 --- a/spec/models/conference_completed_callback_spec.rb +++ b/spec/unit/models/conference_completed_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/conference_created_callback_spec.rb b/spec/unit/models/conference_created_callback_spec.rb similarity index 98% rename from spec/models/conference_created_callback_spec.rb rename to spec/unit/models/conference_created_callback_spec.rb index 91de0613..ee2396fa 100644 --- a/spec/models/conference_created_callback_spec.rb +++ b/spec/unit/models/conference_created_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/conference_member_exit_callback_spec.rb b/spec/unit/models/conference_member_exit_callback_spec.rb similarity index 98% rename from spec/models/conference_member_exit_callback_spec.rb rename to spec/unit/models/conference_member_exit_callback_spec.rb index 74b8b58e..ddec30c6 100644 --- a/spec/models/conference_member_exit_callback_spec.rb +++ b/spec/unit/models/conference_member_exit_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/conference_member_join_callback_spec.rb b/spec/unit/models/conference_member_join_callback_spec.rb similarity index 98% rename from spec/models/conference_member_join_callback_spec.rb rename to spec/unit/models/conference_member_join_callback_spec.rb index 70cfe293..f4fb1853 100644 --- a/spec/models/conference_member_join_callback_spec.rb +++ b/spec/unit/models/conference_member_join_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/conference_member_spec.rb b/spec/unit/models/conference_member_spec.rb similarity index 98% rename from spec/models/conference_member_spec.rb rename to spec/unit/models/conference_member_spec.rb index 45ecbddc..7bd159be 100644 --- a/spec/models/conference_member_spec.rb +++ b/spec/unit/models/conference_member_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/conference_recording_available_callback_spec.rb b/spec/unit/models/conference_recording_available_callback_spec.rb similarity index 99% rename from spec/models/conference_recording_available_callback_spec.rb rename to spec/unit/models/conference_recording_available_callback_spec.rb index d2815d66..d8378e7f 100644 --- a/spec/models/conference_recording_available_callback_spec.rb +++ b/spec/unit/models/conference_recording_available_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/conference_recording_metadata_spec.rb b/spec/unit/models/conference_recording_metadata_spec.rb similarity index 98% rename from spec/models/conference_recording_metadata_spec.rb rename to spec/unit/models/conference_recording_metadata_spec.rb index a8f1f83d..ebcbed8e 100644 --- a/spec/models/conference_recording_metadata_spec.rb +++ b/spec/unit/models/conference_recording_metadata_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/conference_redirect_callback_spec.rb b/spec/unit/models/conference_redirect_callback_spec.rb similarity index 98% rename from spec/models/conference_redirect_callback_spec.rb rename to spec/unit/models/conference_redirect_callback_spec.rb index 48d6f44a..d60d9e7d 100644 --- a/spec/models/conference_redirect_callback_spec.rb +++ b/spec/unit/models/conference_redirect_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/conference_spec.rb b/spec/unit/models/conference_spec.rb similarity index 98% rename from spec/models/conference_spec.rb rename to spec/unit/models/conference_spec.rb index ab02d8b2..fbf3db96 100644 --- a/spec/models/conference_spec.rb +++ b/spec/unit/models/conference_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/conference_state_enum_spec.rb b/spec/unit/models/conference_state_enum_spec.rb similarity index 95% rename from spec/models/conference_state_enum_spec.rb rename to spec/unit/models/conference_state_enum_spec.rb index 02e84d21..ee7eb622 100644 --- a/spec/models/conference_state_enum_spec.rb +++ b/spec/unit/models/conference_state_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/create_call_response_spec.rb b/spec/unit/models/create_call_response_spec.rb similarity index 99% rename from spec/models/create_call_response_spec.rb rename to spec/unit/models/create_call_response_spec.rb index d58c0087..f3e0f103 100644 --- a/spec/models/create_call_response_spec.rb +++ b/spec/unit/models/create_call_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/create_call_spec.rb b/spec/unit/models/create_call_spec.rb similarity index 99% rename from spec/models/create_call_spec.rb rename to spec/unit/models/create_call_spec.rb index 831416b1..685a69cb 100644 --- a/spec/models/create_call_spec.rb +++ b/spec/unit/models/create_call_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/create_lookup_response_spec.rb b/spec/unit/models/create_lookup_response_spec.rb similarity index 97% rename from spec/models/create_lookup_response_spec.rb rename to spec/unit/models/create_lookup_response_spec.rb index d9fab670..6d51134f 100644 --- a/spec/models/create_lookup_response_spec.rb +++ b/spec/unit/models/create_lookup_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/create_message_request_error_spec.rb b/spec/unit/models/create_message_request_error_spec.rb similarity index 97% rename from spec/models/create_message_request_error_spec.rb rename to spec/unit/models/create_message_request_error_spec.rb index 8da9af6f..a04b7d0a 100644 --- a/spec/models/create_message_request_error_spec.rb +++ b/spec/unit/models/create_message_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/deferred_result_spec.rb b/spec/unit/models/deferred_result_spec.rb similarity index 96% rename from spec/models/deferred_result_spec.rb rename to spec/unit/models/deferred_result_spec.rb index c5b53816..3229edfa 100644 --- a/spec/models/deferred_result_spec.rb +++ b/spec/unit/models/deferred_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/disconenct_callback_spec.rb b/spec/unit/models/disconenct_callback_spec.rb similarity index 99% rename from spec/models/disconenct_callback_spec.rb rename to spec/unit/models/disconenct_callback_spec.rb index 14b75b51..d70a0c47 100644 --- a/spec/models/disconenct_callback_spec.rb +++ b/spec/unit/models/disconenct_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/diversion_spec.rb b/spec/unit/models/diversion_spec.rb similarity index 98% rename from spec/models/diversion_spec.rb rename to spec/unit/models/diversion_spec.rb index f6b60d2d..131a5459 100644 --- a/spec/models/diversion_spec.rb +++ b/spec/unit/models/diversion_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/dtmf_callback_spec.rb b/spec/unit/models/dtmf_callback_spec.rb similarity index 99% rename from spec/models/dtmf_callback_spec.rb rename to spec/unit/models/dtmf_callback_spec.rb index 17526ad7..5e54eb5e 100644 --- a/spec/models/dtmf_callback_spec.rb +++ b/spec/unit/models/dtmf_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/field_error_spec.rb b/spec/unit/models/field_error_spec.rb similarity index 96% rename from spec/models/field_error_spec.rb rename to spec/unit/models/field_error_spec.rb index 8398d090..11f19be5 100644 --- a/spec/models/field_error_spec.rb +++ b/spec/unit/models/field_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/file_format_enum_spec.rb b/spec/unit/models/file_format_enum_spec.rb similarity index 95% rename from spec/models/file_format_enum_spec.rb rename to spec/unit/models/file_format_enum_spec.rb index f2660e38..a8e65461 100644 --- a/spec/models/file_format_enum_spec.rb +++ b/spec/unit/models/file_format_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/gather_callback_spec.rb b/spec/unit/models/gather_callback_spec.rb similarity index 99% rename from spec/models/gather_callback_spec.rb rename to spec/unit/models/gather_callback_spec.rb index a1cfa3f5..b69a6250 100644 --- a/spec/models/gather_callback_spec.rb +++ b/spec/unit/models/gather_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/unit/models/inbound_message_callback_message_spec.rb b/spec/unit/models/inbound_message_callback_message_spec.rb new file mode 100644 index 00000000..ce9adf1a --- /dev/null +++ b/spec/unit/models/inbound_message_callback_message_spec.rb @@ -0,0 +1,100 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::InboundMessageCallbackMessage +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::InboundMessageCallbackMessage do + let(:instance) { Bandwidth::InboundMessageCallbackMessage.new } + + describe 'test an instance of InboundMessageCallbackMessage' do + it 'should create an instance of InboundMessageCallbackMessage' do + expect(instance).to be_instance_of(Bandwidth::InboundMessageCallbackMessage) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "owner"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "segment_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "text"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/create_participant_request_spec.rb b/spec/unit/models/inbound_message_callback_spec.rb similarity index 56% rename from spec/models/create_participant_request_spec.rb rename to spec/unit/models/inbound_message_callback_spec.rb index c1a8963d..47a37a84 100644 --- a/spec/models/create_participant_request_spec.rb +++ b/spec/unit/models/inbound_message_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -14,36 +14,42 @@ require 'json' require 'date' -# Unit tests for Bandwidth::CreateParticipantRequest +# Unit tests for Bandwidth::InboundMessageCallback # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe Bandwidth::CreateParticipantRequest do - let(:instance) { Bandwidth::CreateParticipantRequest.new } +describe Bandwidth::InboundMessageCallback do + let(:instance) { Bandwidth::InboundMessageCallback.new } - describe 'test an instance of CreateParticipantRequest' do - it 'should create an instance of CreateParticipantRequest' do - expect(instance).to be_instance_of(Bandwidth::CreateParticipantRequest) + describe 'test an instance of InboundMessageCallback' do + it 'should create an instance of InboundMessageCallback' do + expect(instance).to be_instance_of(Bandwidth::InboundMessageCallback) end end - describe 'test attribute "callback_url"' do + describe 'test attribute "time"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "publish_permissions"' do + describe 'test attribute "type"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "tag"' do + describe 'test attribute "to"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "device_api_version"' do + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/spec/models/initiate_callback_spec.rb b/spec/unit/models/initiate_callback_spec.rb similarity index 98% rename from spec/models/initiate_callback_spec.rb rename to spec/unit/models/initiate_callback_spec.rb index b02bff81..d0258da9 100644 --- a/spec/models/initiate_callback_spec.rb +++ b/spec/unit/models/initiate_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/list_message_direction_enum_spec.rb b/spec/unit/models/list_message_direction_enum_spec.rb similarity index 95% rename from spec/models/list_message_direction_enum_spec.rb rename to spec/unit/models/list_message_direction_enum_spec.rb index 247a0db5..c023c584 100644 --- a/spec/models/list_message_direction_enum_spec.rb +++ b/spec/unit/models/list_message_direction_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/list_message_item_spec.rb b/spec/unit/models/list_message_item_spec.rb similarity index 99% rename from spec/models/list_message_item_spec.rb rename to spec/unit/models/list_message_item_spec.rb index f8a96026..ad247c40 100644 --- a/spec/models/list_message_item_spec.rb +++ b/spec/unit/models/list_message_item_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/lookup_request_spec.rb b/spec/unit/models/lookup_request_spec.rb similarity index 96% rename from spec/models/lookup_request_spec.rb rename to spec/unit/models/lookup_request_spec.rb index 1abfe2dd..5189da3b 100644 --- a/spec/models/lookup_request_spec.rb +++ b/spec/unit/models/lookup_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/lookup_result_spec.rb b/spec/unit/models/lookup_result_spec.rb similarity index 98% rename from spec/models/lookup_result_spec.rb rename to spec/unit/models/lookup_result_spec.rb index 6d1a6c2f..cece9c74 100644 --- a/spec/models/lookup_result_spec.rb +++ b/spec/unit/models/lookup_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/lookup_status_enum_spec.rb b/spec/unit/models/lookup_status_enum_spec.rb similarity index 95% rename from spec/models/lookup_status_enum_spec.rb rename to spec/unit/models/lookup_status_enum_spec.rb index 3aa47050..76111308 100644 --- a/spec/models/lookup_status_enum_spec.rb +++ b/spec/unit/models/lookup_status_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/lookup_status_spec.rb b/spec/unit/models/lookup_status_spec.rb similarity index 97% rename from spec/models/lookup_status_spec.rb rename to spec/unit/models/lookup_status_spec.rb index cae09792..46536725 100644 --- a/spec/models/lookup_status_spec.rb +++ b/spec/unit/models/lookup_status_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/machine_detection_complete_callback_spec.rb b/spec/unit/models/machine_detection_complete_callback_spec.rb similarity index 99% rename from spec/models/machine_detection_complete_callback_spec.rb rename to spec/unit/models/machine_detection_complete_callback_spec.rb index ce7b1713..ed667f7b 100644 --- a/spec/models/machine_detection_complete_callback_spec.rb +++ b/spec/unit/models/machine_detection_complete_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/machine_detection_configuration_spec.rb b/spec/unit/models/machine_detection_configuration_spec.rb similarity index 99% rename from spec/models/machine_detection_configuration_spec.rb rename to spec/unit/models/machine_detection_configuration_spec.rb index 5b43a656..0dddbb1b 100644 --- a/spec/models/machine_detection_configuration_spec.rb +++ b/spec/unit/models/machine_detection_configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/machine_detection_mode_enum_spec.rb b/spec/unit/models/machine_detection_mode_enum_spec.rb similarity index 95% rename from spec/models/machine_detection_mode_enum_spec.rb rename to spec/unit/models/machine_detection_mode_enum_spec.rb index 95be97a1..5388d6f9 100644 --- a/spec/models/machine_detection_mode_enum_spec.rb +++ b/spec/unit/models/machine_detection_mode_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/media_spec.rb b/spec/unit/models/media_spec.rb similarity index 97% rename from spec/models/media_spec.rb rename to spec/unit/models/media_spec.rb index 2c7de4fc..42f055d6 100644 --- a/spec/models/media_spec.rb +++ b/spec/unit/models/media_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/unit/models/message_delivered_callback_message_spec.rb b/spec/unit/models/message_delivered_callback_message_spec.rb new file mode 100644 index 00000000..5a1242fe --- /dev/null +++ b/spec/unit/models/message_delivered_callback_message_spec.rb @@ -0,0 +1,100 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessageDeliveredCallbackMessage +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessageDeliveredCallbackMessage do + let(:instance) { Bandwidth::MessageDeliveredCallbackMessage.new } + + describe 'test an instance of MessageDeliveredCallbackMessage' do + it 'should create an instance of MessageDeliveredCallbackMessage' do + expect(instance).to be_instance_of(Bandwidth::MessageDeliveredCallbackMessage) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "owner"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "segment_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "text"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/unit/models/message_delivered_callback_spec.rb b/spec/unit/models/message_delivered_callback_spec.rb new file mode 100644 index 00000000..3420e389 --- /dev/null +++ b/spec/unit/models/message_delivered_callback_spec.rb @@ -0,0 +1,58 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessageDeliveredCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessageDeliveredCallback do + let(:instance) { Bandwidth::MessageDeliveredCallback.new } + + describe 'test an instance of MessageDeliveredCallback' do + it 'should create an instance of MessageDeliveredCallback' do + expect(instance).to be_instance_of(Bandwidth::MessageDeliveredCallback) + end + end + describe 'test attribute "time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/message_direction_enum_spec.rb b/spec/unit/models/message_direction_enum_spec.rb similarity index 95% rename from spec/models/message_direction_enum_spec.rb rename to spec/unit/models/message_direction_enum_spec.rb index b30c5d47..7bf048b1 100644 --- a/spec/models/message_direction_enum_spec.rb +++ b/spec/unit/models/message_direction_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/unit/models/message_failed_callback_message_spec.rb b/spec/unit/models/message_failed_callback_message_spec.rb new file mode 100644 index 00000000..271ef18a --- /dev/null +++ b/spec/unit/models/message_failed_callback_message_spec.rb @@ -0,0 +1,100 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessageFailedCallbackMessage +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessageFailedCallbackMessage do + let(:instance) { Bandwidth::MessageFailedCallbackMessage.new } + + describe 'test an instance of MessageFailedCallbackMessage' do + it 'should create an instance of MessageFailedCallbackMessage' do + expect(instance).to be_instance_of(Bandwidth::MessageFailedCallbackMessage) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "owner"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "segment_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "text"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/participant_spec.rb b/spec/unit/models/message_failed_callback_spec.rb similarity index 61% rename from spec/models/participant_spec.rb rename to spec/unit/models/message_failed_callback_spec.rb index 8daaa249..c2399438 100644 --- a/spec/models/participant_spec.rb +++ b/spec/unit/models/message_failed_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end @@ -14,54 +14,48 @@ require 'json' require 'date' -# Unit tests for Bandwidth::Participant +# Unit tests for Bandwidth::MessageFailedCallback # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe Bandwidth::Participant do - let(:instance) { Bandwidth::Participant.new } +describe Bandwidth::MessageFailedCallback do + let(:instance) { Bandwidth::MessageFailedCallback.new } - describe 'test an instance of Participant' do - it 'should create an instance of Participant' do - expect(instance).to be_instance_of(Bandwidth::Participant) + describe 'test an instance of MessageFailedCallback' do + it 'should create an instance of MessageFailedCallback' do + expect(instance).to be_instance_of(Bandwidth::MessageFailedCallback) end end - describe 'test attribute "id"' do + describe 'test attribute "time"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "callback_url"' do + describe 'test attribute "type"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "publish_permissions"' do + describe 'test attribute "to"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "sessions"' do + describe 'test attribute "description"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "subscriptions"' do + describe 'test attribute "message"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "device_api_version"' do + describe 'test attribute "error_code"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/spec/models/message_request_spec.rb b/spec/unit/models/message_request_spec.rb similarity index 98% rename from spec/models/message_request_spec.rb rename to spec/unit/models/message_request_spec.rb index 44398b71..2c6d1a39 100644 --- a/spec/models/message_request_spec.rb +++ b/spec/unit/models/message_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/unit/models/message_sending_callback_message_spec.rb b/spec/unit/models/message_sending_callback_message_spec.rb new file mode 100644 index 00000000..880be4e2 --- /dev/null +++ b/spec/unit/models/message_sending_callback_message_spec.rb @@ -0,0 +1,100 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessageSendingCallbackMessage +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessageSendingCallbackMessage do + let(:instance) { Bandwidth::MessageSendingCallbackMessage.new } + + describe 'test an instance of MessageSendingCallbackMessage' do + it 'should create an instance of MessageSendingCallbackMessage' do + expect(instance).to be_instance_of(Bandwidth::MessageSendingCallbackMessage) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "owner"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "segment_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "direction"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "text"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "media"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/unit/models/message_sending_callback_spec.rb b/spec/unit/models/message_sending_callback_spec.rb new file mode 100644 index 00000000..4d76a97b --- /dev/null +++ b/spec/unit/models/message_sending_callback_spec.rb @@ -0,0 +1,58 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.3.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Bandwidth::MessageSendingCallback +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MessageSendingCallback do + let(:instance) { Bandwidth::MessageSendingCallback.new } + + describe 'test an instance of MessageSendingCallback' do + it 'should create an instance of MessageSendingCallback' do + expect(instance).to be_instance_of(Bandwidth::MessageSendingCallback) + end + end + describe 'test attribute "time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/message_spec.rb b/spec/unit/models/message_spec.rb similarity index 98% rename from spec/models/message_spec.rb rename to spec/unit/models/message_spec.rb index 28d2d72c..497b1fed 100644 --- a/spec/models/message_spec.rb +++ b/spec/unit/models/message_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/message_status_enum_spec.rb b/spec/unit/models/message_status_enum_spec.rb similarity index 95% rename from spec/models/message_status_enum_spec.rb rename to spec/unit/models/message_status_enum_spec.rb index 4c7d46df..0e0ea4fd 100644 --- a/spec/models/message_status_enum_spec.rb +++ b/spec/unit/models/message_status_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/message_type_enum_spec.rb b/spec/unit/models/message_type_enum_spec.rb similarity index 95% rename from spec/models/message_type_enum_spec.rb rename to spec/unit/models/message_type_enum_spec.rb index 9bcd42b0..d87e03cc 100644 --- a/spec/models/message_type_enum_spec.rb +++ b/spec/unit/models/message_type_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/messages_list_spec.rb b/spec/unit/models/messages_list_spec.rb similarity index 97% rename from spec/models/messages_list_spec.rb rename to spec/unit/models/messages_list_spec.rb index feb08023..6f7f7c61 100644 --- a/spec/models/messages_list_spec.rb +++ b/spec/unit/models/messages_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/messaging_code_response_spec.rb b/spec/unit/models/messaging_code_response_spec.rb similarity index 96% rename from spec/models/messaging_code_response_spec.rb rename to spec/unit/models/messaging_code_response_spec.rb index 418ca83f..7fbf9572 100644 --- a/spec/models/messaging_code_response_spec.rb +++ b/spec/unit/models/messaging_code_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/messaging_request_error_spec.rb b/spec/unit/models/messaging_request_error_spec.rb similarity index 97% rename from spec/models/messaging_request_error_spec.rb rename to spec/unit/models/messaging_request_error_spec.rb index 3ac66e4c..848525c2 100644 --- a/spec/models/messaging_request_error_spec.rb +++ b/spec/unit/models/messaging_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/mfa_forbidden_request_error_spec.rb b/spec/unit/models/mfa_forbidden_request_error_spec.rb similarity index 96% rename from spec/models/mfa_forbidden_request_error_spec.rb rename to spec/unit/models/mfa_forbidden_request_error_spec.rb index d984520d..a03446b0 100644 --- a/spec/models/mfa_forbidden_request_error_spec.rb +++ b/spec/unit/models/mfa_forbidden_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/mfa_request_error_spec.rb b/spec/unit/models/mfa_request_error_spec.rb similarity index 96% rename from spec/models/mfa_request_error_spec.rb rename to spec/unit/models/mfa_request_error_spec.rb index 6be0f529..c3921a08 100644 --- a/spec/models/mfa_request_error_spec.rb +++ b/spec/unit/models/mfa_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/mfa_unauthorized_request_error_spec.rb b/spec/unit/models/mfa_unauthorized_request_error_spec.rb similarity index 96% rename from spec/models/mfa_unauthorized_request_error_spec.rb rename to spec/unit/models/mfa_unauthorized_request_error_spec.rb index a8ace718..04359c51 100644 --- a/spec/models/mfa_unauthorized_request_error_spec.rb +++ b/spec/unit/models/mfa_unauthorized_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/page_info_spec.rb b/spec/unit/models/page_info_spec.rb similarity index 97% rename from spec/models/page_info_spec.rb rename to spec/unit/models/page_info_spec.rb index 1c6c52fe..418de320 100644 --- a/spec/models/page_info_spec.rb +++ b/spec/unit/models/page_info_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/priority_enum_spec.rb b/spec/unit/models/priority_enum_spec.rb similarity index 95% rename from spec/models/priority_enum_spec.rb rename to spec/unit/models/priority_enum_spec.rb index f7782332..a65be862 100644 --- a/spec/models/priority_enum_spec.rb +++ b/spec/unit/models/priority_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/recording_available_callback_spec.rb b/spec/unit/models/recording_available_callback_spec.rb similarity index 99% rename from spec/models/recording_available_callback_spec.rb rename to spec/unit/models/recording_available_callback_spec.rb index f2f01978..77259023 100644 --- a/spec/models/recording_available_callback_spec.rb +++ b/spec/unit/models/recording_available_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/recording_complete_callback_spec.rb b/spec/unit/models/recording_complete_callback_spec.rb similarity index 99% rename from spec/models/recording_complete_callback_spec.rb rename to spec/unit/models/recording_complete_callback_spec.rb index f8fde485..c31a86c5 100644 --- a/spec/models/recording_complete_callback_spec.rb +++ b/spec/unit/models/recording_complete_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/recording_state_enum_spec.rb b/spec/unit/models/recording_state_enum_spec.rb similarity index 95% rename from spec/models/recording_state_enum_spec.rb rename to spec/unit/models/recording_state_enum_spec.rb index 946f1c9b..22dc0030 100644 --- a/spec/models/recording_state_enum_spec.rb +++ b/spec/unit/models/recording_state_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/redirect_callback_spec.rb b/spec/unit/models/redirect_callback_spec.rb similarity index 99% rename from spec/models/redirect_callback_spec.rb rename to spec/unit/models/redirect_callback_spec.rb index f1a5e498..48fa0d82 100644 --- a/spec/models/redirect_callback_spec.rb +++ b/spec/unit/models/redirect_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/redirect_method_enum_spec.rb b/spec/unit/models/redirect_method_enum_spec.rb similarity index 95% rename from spec/models/redirect_method_enum_spec.rb rename to spec/unit/models/redirect_method_enum_spec.rb index 97b673b5..0511c0b2 100644 --- a/spec/models/redirect_method_enum_spec.rb +++ b/spec/unit/models/redirect_method_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/stir_shaken_spec.rb b/spec/unit/models/stir_shaken_spec.rb similarity index 97% rename from spec/models/stir_shaken_spec.rb rename to spec/unit/models/stir_shaken_spec.rb index b005cc6f..22b58f4e 100644 --- a/spec/models/stir_shaken_spec.rb +++ b/spec/unit/models/stir_shaken_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/tag_spec.rb b/spec/unit/models/tag_spec.rb similarity index 96% rename from spec/models/tag_spec.rb rename to spec/unit/models/tag_spec.rb index 4822b89f..0708f495 100644 --- a/spec/models/tag_spec.rb +++ b/spec/unit/models/tag_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/tn_lookup_request_error_spec.rb b/spec/unit/models/tn_lookup_request_error_spec.rb similarity index 96% rename from spec/models/tn_lookup_request_error_spec.rb rename to spec/unit/models/tn_lookup_request_error_spec.rb index c543069b..c4960729 100644 --- a/spec/models/tn_lookup_request_error_spec.rb +++ b/spec/unit/models/tn_lookup_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/transcribe_recording_spec.rb b/spec/unit/models/transcribe_recording_spec.rb similarity index 98% rename from spec/models/transcribe_recording_spec.rb rename to spec/unit/models/transcribe_recording_spec.rb index ee409d1a..4cd9b618 100644 --- a/spec/models/transcribe_recording_spec.rb +++ b/spec/unit/models/transcribe_recording_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/transcription_available_callback_spec.rb b/spec/unit/models/transcription_available_callback_spec.rb similarity index 99% rename from spec/models/transcription_available_callback_spec.rb rename to spec/unit/models/transcription_available_callback_spec.rb index ddc7dad1..3a144ceb 100644 --- a/spec/models/transcription_available_callback_spec.rb +++ b/spec/unit/models/transcription_available_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/transcription_list_spec.rb b/spec/unit/models/transcription_list_spec.rb similarity index 96% rename from spec/models/transcription_list_spec.rb rename to spec/unit/models/transcription_list_spec.rb index 8e8e8e3a..14322ced 100644 --- a/spec/models/transcription_list_spec.rb +++ b/spec/unit/models/transcription_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/transcription_metadata_spec.rb b/spec/unit/models/transcription_metadata_spec.rb similarity index 97% rename from spec/models/transcription_metadata_spec.rb rename to spec/unit/models/transcription_metadata_spec.rb index 56f68251..2b19edc0 100644 --- a/spec/models/transcription_metadata_spec.rb +++ b/spec/unit/models/transcription_metadata_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/transcription_spec.rb b/spec/unit/models/transcription_spec.rb similarity index 96% rename from spec/models/transcription_spec.rb rename to spec/unit/models/transcription_spec.rb index 30b9f819..76be9882 100644 --- a/spec/models/transcription_spec.rb +++ b/spec/unit/models/transcription_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/transfer_answer_callback_spec.rb b/spec/unit/models/transfer_answer_callback_spec.rb similarity index 99% rename from spec/models/transfer_answer_callback_spec.rb rename to spec/unit/models/transfer_answer_callback_spec.rb index 98adc4ba..bfcd8acc 100644 --- a/spec/models/transfer_answer_callback_spec.rb +++ b/spec/unit/models/transfer_answer_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/transfer_complete_callback_spec.rb b/spec/unit/models/transfer_complete_callback_spec.rb similarity index 99% rename from spec/models/transfer_complete_callback_spec.rb rename to spec/unit/models/transfer_complete_callback_spec.rb index bd399abd..1b91e04f 100644 --- a/spec/models/transfer_complete_callback_spec.rb +++ b/spec/unit/models/transfer_complete_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/transfer_disconnect_callback_spec.rb b/spec/unit/models/transfer_disconnect_callback_spec.rb similarity index 99% rename from spec/models/transfer_disconnect_callback_spec.rb rename to spec/unit/models/transfer_disconnect_callback_spec.rb index 39f21d8d..7f973b86 100644 --- a/spec/models/transfer_disconnect_callback_spec.rb +++ b/spec/unit/models/transfer_disconnect_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/update_call_recording_spec.rb b/spec/unit/models/update_call_recording_spec.rb similarity index 96% rename from spec/models/update_call_recording_spec.rb rename to spec/unit/models/update_call_recording_spec.rb index 92b4ef09..4c03a0b4 100644 --- a/spec/models/update_call_recording_spec.rb +++ b/spec/unit/models/update_call_recording_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/update_call_spec.rb b/spec/unit/models/update_call_spec.rb similarity index 98% rename from spec/models/update_call_spec.rb rename to spec/unit/models/update_call_spec.rb index 38dd1a80..94629b4b 100644 --- a/spec/models/update_call_spec.rb +++ b/spec/unit/models/update_call_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/update_conference_member_spec.rb b/spec/unit/models/update_conference_member_spec.rb similarity index 97% rename from spec/models/update_conference_member_spec.rb rename to spec/unit/models/update_conference_member_spec.rb index 791e586b..555b4c66 100644 --- a/spec/models/update_conference_member_spec.rb +++ b/spec/unit/models/update_conference_member_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/update_conference_spec.rb b/spec/unit/models/update_conference_spec.rb similarity index 98% rename from spec/models/update_conference_spec.rb rename to spec/unit/models/update_conference_spec.rb index 13f7c61e..337cbece 100644 --- a/spec/models/update_conference_spec.rb +++ b/spec/unit/models/update_conference_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/verify_code_request_spec.rb b/spec/unit/models/verify_code_request_spec.rb similarity index 97% rename from spec/models/verify_code_request_spec.rb rename to spec/unit/models/verify_code_request_spec.rb index 88cb3ac3..21801a22 100644 --- a/spec/models/verify_code_request_spec.rb +++ b/spec/unit/models/verify_code_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/verify_code_response_spec.rb b/spec/unit/models/verify_code_response_spec.rb similarity index 96% rename from spec/models/verify_code_response_spec.rb rename to spec/unit/models/verify_code_response_spec.rb index 34eec213..61b45bf3 100644 --- a/spec/models/verify_code_response_spec.rb +++ b/spec/unit/models/verify_code_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/voice_api_error_spec.rb b/spec/unit/models/voice_api_error_spec.rb similarity index 97% rename from spec/models/voice_api_error_spec.rb rename to spec/unit/models/voice_api_error_spec.rb index c8b1b010..9c37761b 100644 --- a/spec/models/voice_api_error_spec.rb +++ b/spec/unit/models/voice_api_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end diff --git a/spec/models/voice_code_response_spec.rb b/spec/unit/models/voice_code_response_spec.rb similarity index 96% rename from spec/models/voice_code_response_spec.rb rename to spec/unit/models/voice_code_response_spec.rb index 41be139d..27140409 100644 --- a/spec/models/voice_code_response_spec.rb +++ b/spec/unit/models/voice_code_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 +OpenAPI Generator version: 6.3.0 =end From c204953d04454c6a3b4cce318df864d74c52a6a1 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Tue, 21 Feb 2023 10:22:02 -0500 Subject: [PATCH 04/30] update bw spec and use v6.4.0 of the generator (#72) --- .openapi-generator-ignore | 23 +- .openapi-generator/FILES | 99 ++++- .openapi-generator/VERSION | 2 +- README.md | 4 +- bandwidth-sdk.gemspec | 2 +- bandwidth.yml | 2 +- docs/DisconnectCallback.md | 50 +++ lib/bandwidth-sdk.rb | 4 +- lib/bandwidth-sdk/api/calls_api.rb | 2 +- lib/bandwidth-sdk/api/conferences_api.rb | 2 +- lib/bandwidth-sdk/api/media_api.rb | 2 +- lib/bandwidth-sdk/api/messages_api.rb | 2 +- lib/bandwidth-sdk/api/mfa_api.rb | 2 +- .../api/phone_number_lookup_api.rb | 2 +- lib/bandwidth-sdk/api/recordings_api.rb | 2 +- lib/bandwidth-sdk/api/statistics_api.rb | 2 +- lib/bandwidth-sdk/api_client.rb | 5 +- lib/bandwidth-sdk/api_error.rb | 2 +- lib/bandwidth-sdk/configuration.rb | 29 +- .../models/account_statistics.rb | 2 +- lib/bandwidth-sdk/models/answer_callback.rb | 2 +- .../models/bridge_complete_callback.rb | 2 +- .../models/bridge_target_complete_callback.rb | 2 +- .../models/call_direction_enum.rb | 2 +- .../models/call_recording_metadata.rb | 2 +- lib/bandwidth-sdk/models/call_state.rb | 2 +- lib/bandwidth-sdk/models/call_state_enum.rb | 2 +- .../models/callback_method_enum.rb | 2 +- lib/bandwidth-sdk/models/code_request.rb | 2 +- lib/bandwidth-sdk/models/conference.rb | 2 +- .../models/conference_completed_callback.rb | 2 +- .../models/conference_created_callback.rb | 2 +- lib/bandwidth-sdk/models/conference_member.rb | 2 +- .../models/conference_member_exit_callback.rb | 2 +- .../models/conference_member_join_callback.rb | 2 +- ...conference_recording_available_callback.rb | 2 +- .../models/conference_recording_metadata.rb | 2 +- .../models/conference_redirect_callback.rb | 2 +- .../models/conference_state_enum.rb | 2 +- lib/bandwidth-sdk/models/create_call.rb | 2 +- .../models/create_call_response.rb | 2 +- .../models/create_lookup_response.rb | 2 +- .../models/create_message_request_error.rb | 2 +- lib/bandwidth-sdk/models/deferred_result.rb | 2 +- .../models/disconnect_callback.rb | 407 ++++++++++++++++++ lib/bandwidth-sdk/models/diversion.rb | 2 +- lib/bandwidth-sdk/models/dtmf_callback.rb | 2 +- lib/bandwidth-sdk/models/field_error.rb | 2 +- lib/bandwidth-sdk/models/file_format_enum.rb | 2 +- lib/bandwidth-sdk/models/gather_callback.rb | 2 +- .../models/inbound_message_callback.rb | 2 +- .../inbound_message_callback_message.rb | 2 +- lib/bandwidth-sdk/models/initiate_callback.rb | 2 +- .../models/list_message_direction_enum.rb | 2 +- lib/bandwidth-sdk/models/list_message_item.rb | 2 +- lib/bandwidth-sdk/models/lookup_request.rb | 2 +- lib/bandwidth-sdk/models/lookup_result.rb | 2 +- lib/bandwidth-sdk/models/lookup_status.rb | 2 +- .../models/lookup_status_enum.rb | 2 +- .../machine_detection_complete_callback.rb | 2 +- .../models/machine_detection_configuration.rb | 2 +- .../models/machine_detection_mode_enum.rb | 2 +- lib/bandwidth-sdk/models/media.rb | 2 +- lib/bandwidth-sdk/models/message.rb | 2 +- .../models/message_delivered_callback.rb | 2 +- .../message_delivered_callback_message.rb | 2 +- .../models/message_direction_enum.rb | 2 +- .../models/message_failed_callback.rb | 2 +- .../models/message_failed_callback_message.rb | 2 +- lib/bandwidth-sdk/models/message_request.rb | 2 +- .../models/message_sending_callback.rb | 2 +- .../message_sending_callback_message.rb | 2 +- .../models/message_status_enum.rb | 2 +- lib/bandwidth-sdk/models/message_type_enum.rb | 2 +- lib/bandwidth-sdk/models/messages_list.rb | 2 +- .../models/messaging_code_response.rb | 2 +- .../models/messaging_request_error.rb | 2 +- .../models/mfa_forbidden_request_error.rb | 2 +- lib/bandwidth-sdk/models/mfa_request_error.rb | 2 +- .../models/mfa_unauthorized_request_error.rb | 2 +- lib/bandwidth-sdk/models/page_info.rb | 2 +- lib/bandwidth-sdk/models/priority_enum.rb | 2 +- .../models/recording_available_callback.rb | 2 +- .../models/recording_complete_callback.rb | 2 +- .../models/recording_state_enum.rb | 2 +- lib/bandwidth-sdk/models/redirect_callback.rb | 2 +- .../models/redirect_method_enum.rb | 2 +- lib/bandwidth-sdk/models/stir_shaken.rb | 2 +- lib/bandwidth-sdk/models/tag.rb | 2 +- .../models/tn_lookup_request_error.rb | 2 +- .../models/transcribe_recording.rb | 2 +- lib/bandwidth-sdk/models/transcription.rb | 2 +- .../transcription_available_callback.rb | 2 +- .../models/transcription_list.rb | 2 +- .../models/transcription_metadata.rb | 2 +- .../models/transfer_answer_callback.rb | 2 +- .../models/transfer_complete_callback.rb | 2 +- .../models/transfer_disconnect_callback.rb | 2 +- lib/bandwidth-sdk/models/update_call.rb | 2 +- .../models/update_call_recording.rb | 2 +- lib/bandwidth-sdk/models/update_conference.rb | 2 +- .../models/update_conference_member.rb | 2 +- .../models/verify_code_request.rb | 2 +- .../models/verify_code_response.rb | 2 +- lib/bandwidth-sdk/models/voice_api_error.rb | 2 +- .../models/voice_code_response.rb | 2 +- lib/bandwidth-sdk/version.rb | 2 +- spec/spec_helper.rb | 2 +- spec/unit/api/calls_api_spec.rb | 2 +- spec/unit/api/conferences_api_spec.rb | 2 +- spec/unit/api/media_api_spec.rb | 2 +- spec/unit/api/messages_api_spec.rb | 11 +- spec/unit/api/mfa_api_spec.rb | 2 +- spec/unit/api/phone_number_lookup_api_spec.rb | 2 +- spec/unit/api/recordings_api_spec.rb | 2 +- spec/unit/api/statistics_api_spec.rb | 2 +- spec/unit/models/account_statistics_spec.rb | 2 +- spec/unit/models/answer_callback_spec.rb | 2 +- .../models/bridge_complete_callback_spec.rb | 2 +- .../bridge_target_complete_callback_spec.rb | 2 +- spec/unit/models/call_direction_enum_spec.rb | 2 +- .../models/call_recording_metadata_spec.rb | 2 +- spec/unit/models/call_state_enum_spec.rb | 2 +- spec/unit/models/call_state_spec.rb | 2 +- spec/unit/models/callback_method_enum_spec.rb | 2 +- spec/unit/models/code_request_spec.rb | 2 +- .../conference_completed_callback_spec.rb | 2 +- .../conference_created_callback_spec.rb | 2 +- .../conference_member_exit_callback_spec.rb | 2 +- .../conference_member_join_callback_spec.rb | 2 +- spec/unit/models/conference_member_spec.rb | 2 +- ...rence_recording_available_callback_spec.rb | 2 +- .../conference_recording_metadata_spec.rb | 2 +- .../conference_redirect_callback_spec.rb | 2 +- spec/unit/models/conference_spec.rb | 2 +- .../unit/models/conference_state_enum_spec.rb | 2 +- spec/unit/models/create_call_response_spec.rb | 2 +- spec/unit/models/create_call_spec.rb | 2 +- .../models/create_lookup_response_spec.rb | 2 +- .../create_message_request_error_spec.rb | 2 +- spec/unit/models/deferred_result_spec.rb | 2 +- ...ck_spec.rb => disconnect_callback_spec.rb} | 14 +- spec/unit/models/diversion_spec.rb | 2 +- spec/unit/models/dtmf_callback_spec.rb | 2 +- spec/unit/models/field_error_spec.rb | 2 +- spec/unit/models/file_format_enum_spec.rb | 2 +- spec/unit/models/gather_callback_spec.rb | 2 +- .../inbound_message_callback_message_spec.rb | 2 +- .../models/inbound_message_callback_spec.rb | 2 +- spec/unit/models/initiate_callback_spec.rb | 2 +- .../list_message_direction_enum_spec.rb | 2 +- spec/unit/models/list_message_item_spec.rb | 2 +- spec/unit/models/lookup_request_spec.rb | 2 +- spec/unit/models/lookup_result_spec.rb | 2 +- spec/unit/models/lookup_status_enum_spec.rb | 2 +- spec/unit/models/lookup_status_spec.rb | 2 +- ...achine_detection_complete_callback_spec.rb | 2 +- .../machine_detection_configuration_spec.rb | 2 +- .../machine_detection_mode_enum_spec.rb | 2 +- spec/unit/models/media_spec.rb | 2 +- ...message_delivered_callback_message_spec.rb | 2 +- .../models/message_delivered_callback_spec.rb | 2 +- .../models/message_direction_enum_spec.rb | 2 +- .../message_failed_callback_message_spec.rb | 2 +- .../models/message_failed_callback_spec.rb | 2 +- spec/unit/models/message_request_spec.rb | 2 +- .../message_sending_callback_message_spec.rb | 2 +- .../models/message_sending_callback_spec.rb | 2 +- spec/unit/models/message_spec.rb | 2 +- spec/unit/models/message_status_enum_spec.rb | 2 +- spec/unit/models/message_type_enum_spec.rb | 2 +- spec/unit/models/messages_list_spec.rb | 2 +- .../models/messaging_code_response_spec.rb | 2 +- .../models/messaging_request_error_spec.rb | 2 +- .../mfa_forbidden_request_error_spec.rb | 2 +- spec/unit/models/mfa_request_error_spec.rb | 2 +- .../mfa_unauthorized_request_error_spec.rb | 2 +- spec/unit/models/page_info_spec.rb | 2 +- spec/unit/models/priority_enum_spec.rb | 2 +- .../recording_available_callback_spec.rb | 2 +- .../recording_complete_callback_spec.rb | 2 +- spec/unit/models/recording_state_enum_spec.rb | 2 +- spec/unit/models/redirect_callback_spec.rb | 2 +- spec/unit/models/redirect_method_enum_spec.rb | 2 +- spec/unit/models/stir_shaken_spec.rb | 2 +- spec/unit/models/tag_spec.rb | 2 +- .../models/tn_lookup_request_error_spec.rb | 2 +- spec/unit/models/transcribe_recording_spec.rb | 2 +- .../transcription_available_callback_spec.rb | 2 +- spec/unit/models/transcription_list_spec.rb | 2 +- .../models/transcription_metadata_spec.rb | 2 +- spec/unit/models/transcription_spec.rb | 2 +- .../models/transfer_answer_callback_spec.rb | 2 +- .../models/transfer_complete_callback_spec.rb | 2 +- .../transfer_disconnect_callback_spec.rb | 2 +- .../unit/models/update_call_recording_spec.rb | 2 +- spec/unit/models/update_call_spec.rb | 2 +- .../models/update_conference_member_spec.rb | 2 +- spec/unit/models/update_conference_spec.rb | 2 +- spec/unit/models/verify_code_request_spec.rb | 2 +- spec/unit/models/verify_code_response_spec.rb | 2 +- spec/unit/models/voice_api_error_spec.rb | 2 +- spec/unit/models/voice_code_response_spec.rb | 2 +- 203 files changed, 799 insertions(+), 233 deletions(-) create mode 100644 docs/DisconnectCallback.md create mode 100644 lib/bandwidth-sdk/models/disconnect_callback.rb rename spec/unit/models/{disconenct_callback_spec.rb => disconnect_callback_spec.rb} (90%) diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 7484ee59..77119879 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -1,23 +1,6 @@ # OpenAPI Generator Ignore # Generated by openapi-generator https://github.com/openapitools/openapi-generator -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md +/spec/spec_helper.rb +Rakefile +.gitignore diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 860006dc..80e32147 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -34,7 +34,7 @@ docs/CreateCallResponse.md docs/CreateLookupResponse.md docs/CreateMessageRequestError.md docs/DeferredResult.md -docs/DisconenctCallback.md +docs/DisconnectCallback.md docs/Diversion.md docs/DtmfCallback.md docs/FieldError.md @@ -140,7 +140,7 @@ lib/bandwidth-sdk/models/create_call_response.rb lib/bandwidth-sdk/models/create_lookup_response.rb lib/bandwidth-sdk/models/create_message_request_error.rb lib/bandwidth-sdk/models/deferred_result.rb -lib/bandwidth-sdk/models/disconenct_callback.rb +lib/bandwidth-sdk/models/disconnect_callback.rb lib/bandwidth-sdk/models/diversion.rb lib/bandwidth-sdk/models/dtmf_callback.rb lib/bandwidth-sdk/models/field_error.rb @@ -203,6 +203,101 @@ lib/bandwidth-sdk/models/verify_code_response.rb lib/bandwidth-sdk/models/voice_api_error.rb lib/bandwidth-sdk/models/voice_code_response.rb lib/bandwidth-sdk/version.rb +spec/api/calls_api_spec.rb +spec/api/conferences_api_spec.rb +spec/api/media_api_spec.rb +spec/api/messages_api_spec.rb +spec/api/mfa_api_spec.rb +spec/api/phone_number_lookup_api_spec.rb +spec/api/recordings_api_spec.rb +spec/api/statistics_api_spec.rb spec/api_client_spec.rb spec/configuration_spec.rb +spec/models/account_statistics_spec.rb +spec/models/answer_callback_spec.rb +spec/models/bridge_complete_callback_spec.rb +spec/models/bridge_target_complete_callback_spec.rb +spec/models/call_direction_enum_spec.rb +spec/models/call_recording_metadata_spec.rb +spec/models/call_state_enum_spec.rb +spec/models/call_state_spec.rb +spec/models/callback_method_enum_spec.rb +spec/models/code_request_spec.rb +spec/models/conference_completed_callback_spec.rb +spec/models/conference_created_callback_spec.rb +spec/models/conference_member_exit_callback_spec.rb +spec/models/conference_member_join_callback_spec.rb +spec/models/conference_member_spec.rb +spec/models/conference_recording_available_callback_spec.rb +spec/models/conference_recording_metadata_spec.rb +spec/models/conference_redirect_callback_spec.rb +spec/models/conference_spec.rb +spec/models/conference_state_enum_spec.rb +spec/models/create_call_response_spec.rb +spec/models/create_call_spec.rb +spec/models/create_lookup_response_spec.rb +spec/models/create_message_request_error_spec.rb +spec/models/deferred_result_spec.rb +spec/models/disconnect_callback_spec.rb +spec/models/diversion_spec.rb +spec/models/dtmf_callback_spec.rb +spec/models/field_error_spec.rb +spec/models/file_format_enum_spec.rb +spec/models/gather_callback_spec.rb +spec/models/inbound_message_callback_message_spec.rb +spec/models/inbound_message_callback_spec.rb +spec/models/initiate_callback_spec.rb +spec/models/list_message_direction_enum_spec.rb +spec/models/list_message_item_spec.rb +spec/models/lookup_request_spec.rb +spec/models/lookup_result_spec.rb +spec/models/lookup_status_enum_spec.rb +spec/models/lookup_status_spec.rb +spec/models/machine_detection_complete_callback_spec.rb +spec/models/machine_detection_configuration_spec.rb +spec/models/machine_detection_mode_enum_spec.rb +spec/models/media_spec.rb +spec/models/message_delivered_callback_message_spec.rb +spec/models/message_delivered_callback_spec.rb +spec/models/message_direction_enum_spec.rb +spec/models/message_failed_callback_message_spec.rb +spec/models/message_failed_callback_spec.rb +spec/models/message_request_spec.rb +spec/models/message_sending_callback_message_spec.rb +spec/models/message_sending_callback_spec.rb +spec/models/message_spec.rb +spec/models/message_status_enum_spec.rb +spec/models/message_type_enum_spec.rb +spec/models/messages_list_spec.rb +spec/models/messaging_code_response_spec.rb +spec/models/messaging_request_error_spec.rb +spec/models/mfa_forbidden_request_error_spec.rb +spec/models/mfa_request_error_spec.rb +spec/models/mfa_unauthorized_request_error_spec.rb +spec/models/page_info_spec.rb +spec/models/priority_enum_spec.rb +spec/models/recording_available_callback_spec.rb +spec/models/recording_complete_callback_spec.rb +spec/models/recording_state_enum_spec.rb +spec/models/redirect_callback_spec.rb +spec/models/redirect_method_enum_spec.rb +spec/models/stir_shaken_spec.rb +spec/models/tag_spec.rb +spec/models/tn_lookup_request_error_spec.rb +spec/models/transcribe_recording_spec.rb +spec/models/transcription_available_callback_spec.rb +spec/models/transcription_list_spec.rb +spec/models/transcription_metadata_spec.rb +spec/models/transcription_spec.rb +spec/models/transfer_answer_callback_spec.rb +spec/models/transfer_complete_callback_spec.rb +spec/models/transfer_disconnect_callback_spec.rb +spec/models/update_call_recording_spec.rb +spec/models/update_call_spec.rb +spec/models/update_conference_member_spec.rb +spec/models/update_conference_spec.rb +spec/models/verify_code_request_spec.rb +spec/models/verify_code_response_spec.rb +spec/models/voice_api_error_spec.rb +spec/models/voice_code_response_spec.rb spec/spec_helper.rb diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index e7e42a4b..c0be8a79 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.3.0 \ No newline at end of file +6.4.0 \ No newline at end of file diff --git a/README.md b/README.md index 7bf4a24e..dfa39759 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,8 @@ Bandwidth.configure do |config| # Configure HTTP basic authorization: Basic config.username = 'YOUR_USERNAME' config.password = 'YOUR_PASSWORD' + # Configure faraday connection + config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' } end api_instance = Bandwidth::CallsApi.new @@ -158,7 +160,7 @@ Class | Method | HTTP request | Description - [Bandwidth::CreateLookupResponse](docs/CreateLookupResponse.md) - [Bandwidth::CreateMessageRequestError](docs/CreateMessageRequestError.md) - [Bandwidth::DeferredResult](docs/DeferredResult.md) - - [Bandwidth::DisconenctCallback](docs/DisconenctCallback.md) + - [Bandwidth::DisconnectCallback](docs/DisconnectCallback.md) - [Bandwidth::Diversion](docs/Diversion.md) - [Bandwidth::DtmfCallback](docs/DtmfCallback.md) - [Bandwidth::FieldError](docs/FieldError.md) diff --git a/bandwidth-sdk.gemspec b/bandwidth-sdk.gemspec index 11e7edb9..e6212665 100644 --- a/bandwidth-sdk.gemspec +++ b/bandwidth-sdk.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/bandwidth.yml b/bandwidth.yml index 2b1997e4..5904b442 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -3282,7 +3282,7 @@ components: $ref: '#/components/schemas/tag1' status: $ref: '#/components/schemas/status' - disconenctCallback: + disconnectCallback: type: object description: The Disconnect event is fired when a call ends, for any reason. properties: diff --git a/docs/DisconnectCallback.md b/docs/DisconnectCallback.md new file mode 100644 index 00000000..73b99c64 --- /dev/null +++ b/docs/DisconnectCallback.md @@ -0,0 +1,50 @@ +# Bandwidth::DisconnectCallback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | +| **event_time** | **String** | 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** | **String** | The user account associated with the call. | [optional] | +| **application_id** | **String** | The id of the application associated with the call. | [optional] | +| **from** | **String** | 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] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] | +| **call_id** | **String** | The call id associated with the event. | [optional] | +| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | +| **call_url** | **String** | The URL of the call associated with the event. | [optional] | +| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] | +| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | +| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | +| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] | +| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] | +| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] | +| **error_id** | **String** | Bandwidth's internal id that references the error event. | [optional] | +| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::DisconnectCallback.new( + event_type: bridgeComplete, + event_time: null, + account_id: 920012, + application_id: 04e88489-df02-4e34-a0ee-27a91849555f, + from: +15555555555, + to: +15555555555, + call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + direction: null, + 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 +) +``` + diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index abe20b63..1e2f2c49 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end @@ -42,7 +42,7 @@ require 'bandwidth-sdk/models/create_lookup_response' require 'bandwidth-sdk/models/create_message_request_error' require 'bandwidth-sdk/models/deferred_result' -require 'bandwidth-sdk/models/disconenct_callback' +require 'bandwidth-sdk/models/disconnect_callback' require 'bandwidth-sdk/models/diversion' require 'bandwidth-sdk/models/dtmf_callback' require 'bandwidth-sdk/models/field_error' diff --git a/lib/bandwidth-sdk/api/calls_api.rb b/lib/bandwidth-sdk/api/calls_api.rb index 2c7c2e5b..afa882ca 100644 --- a/lib/bandwidth-sdk/api/calls_api.rb +++ b/lib/bandwidth-sdk/api/calls_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/api/conferences_api.rb b/lib/bandwidth-sdk/api/conferences_api.rb index 53e2688d..fcb16920 100644 --- a/lib/bandwidth-sdk/api/conferences_api.rb +++ b/lib/bandwidth-sdk/api/conferences_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/api/media_api.rb b/lib/bandwidth-sdk/api/media_api.rb index 179e09ea..0acc1bd1 100644 --- a/lib/bandwidth-sdk/api/media_api.rb +++ b/lib/bandwidth-sdk/api/media_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb index 77f3fef0..88c36a4a 100644 --- a/lib/bandwidth-sdk/api/messages_api.rb +++ b/lib/bandwidth-sdk/api/messages_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/api/mfa_api.rb b/lib/bandwidth-sdk/api/mfa_api.rb index ed4d159f..dbca5a9f 100644 --- a/lib/bandwidth-sdk/api/mfa_api.rb +++ b/lib/bandwidth-sdk/api/mfa_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb index 778e9fe2..32600c02 100644 --- a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +++ b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/api/recordings_api.rb b/lib/bandwidth-sdk/api/recordings_api.rb index 9e296b51..c1d8797d 100644 --- a/lib/bandwidth-sdk/api/recordings_api.rb +++ b/lib/bandwidth-sdk/api/recordings_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/api/statistics_api.rb b/lib/bandwidth-sdk/api/statistics_api.rb index f0d80b14..57adf8d2 100644 --- a/lib/bandwidth-sdk/api/statistics_api.rb +++ b/lib/bandwidth-sdk/api/statistics_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/api_client.rb b/lib/bandwidth-sdk/api_client.rb index b1881fe1..55feb181 100644 --- a/lib/bandwidth-sdk/api_client.rb +++ b/lib/bandwidth-sdk/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end @@ -178,11 +178,12 @@ def connection_regular end def build_connection - Faraday.new(url: config.base_url, ssl: ssl_options) do |conn| + Faraday.new(url: config.base_url, ssl: ssl_options, proxy: config.proxy) do |conn| basic_auth(conn) config.configure_middleware(conn) yield(conn) if block_given? conn.adapter(Faraday.default_adapter) + config.configure_connection(conn) end end diff --git a/lib/bandwidth-sdk/api_error.rb b/lib/bandwidth-sdk/api_error.rb index eeb0a28d..c57fdc9a 100644 --- a/lib/bandwidth-sdk/api_error.rb +++ b/lib/bandwidth-sdk/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/configuration.rb b/lib/bandwidth-sdk/configuration.rb index ac60502b..df58957b 100644 --- a/lib/bandwidth-sdk/configuration.rb +++ b/lib/bandwidth-sdk/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end @@ -159,6 +159,7 @@ def initialize @ssl_client_cert = nil @ssl_client_key = nil @middlewares = Hash.new { |h, k| h[k] = [] } + @configure_connection_blocks = [] @timeout = 60 # return data as binary instead of file @return_binary_data = false @@ -499,6 +500,32 @@ def server_url(index, variables = {}, servers = nil) url end + # Configure Faraday connection directly. + # + # ``` + # c.configure_faraday_connection do |conn| + # conn.use Faraday::HttpCache, shared_cache: false, logger: logger + # conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger| + # logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]') + # end + # end + # + # c.configure_faraday_connection do |conn| + # conn.adapter :typhoeus + # end + # ``` + # + # @param block [Proc] `#call`able object that takes one arg, the connection + def configure_faraday_connection(&block) + @configure_connection_blocks << block + end + + def configure_connection(conn) + @configure_connection_blocks.each do |block| + block.call(conn) + end + end + # Adds middleware to the stack def use(*middleware) set_faraday_middleware(:use, *middleware) diff --git a/lib/bandwidth-sdk/models/account_statistics.rb b/lib/bandwidth-sdk/models/account_statistics.rb index 88af713e..f911ed11 100644 --- a/lib/bandwidth-sdk/models/account_statistics.rb +++ b/lib/bandwidth-sdk/models/account_statistics.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/answer_callback.rb b/lib/bandwidth-sdk/models/answer_callback.rb index 5f71a948..1cd02565 100644 --- a/lib/bandwidth-sdk/models/answer_callback.rb +++ b/lib/bandwidth-sdk/models/answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/bridge_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_complete_callback.rb index aa13003b..331540e6 100644 --- a/lib/bandwidth-sdk/models/bridge_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb index ba2b3334..e33ee139 100644 --- a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/call_direction_enum.rb b/lib/bandwidth-sdk/models/call_direction_enum.rb index d55e5b23..99e202e1 100644 --- a/lib/bandwidth-sdk/models/call_direction_enum.rb +++ b/lib/bandwidth-sdk/models/call_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/call_recording_metadata.rb b/lib/bandwidth-sdk/models/call_recording_metadata.rb index f8d9863d..f57f3961 100644 --- a/lib/bandwidth-sdk/models/call_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/call_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/call_state.rb b/lib/bandwidth-sdk/models/call_state.rb index 30400b48..a8bb28db 100644 --- a/lib/bandwidth-sdk/models/call_state.rb +++ b/lib/bandwidth-sdk/models/call_state.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/call_state_enum.rb b/lib/bandwidth-sdk/models/call_state_enum.rb index d5bc7404..7a2bc37d 100644 --- a/lib/bandwidth-sdk/models/call_state_enum.rb +++ b/lib/bandwidth-sdk/models/call_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/callback_method_enum.rb b/lib/bandwidth-sdk/models/callback_method_enum.rb index d717459c..a020b306 100644 --- a/lib/bandwidth-sdk/models/callback_method_enum.rb +++ b/lib/bandwidth-sdk/models/callback_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/code_request.rb b/lib/bandwidth-sdk/models/code_request.rb index 3c6369e4..bb640dcd 100644 --- a/lib/bandwidth-sdk/models/code_request.rb +++ b/lib/bandwidth-sdk/models/code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/conference.rb b/lib/bandwidth-sdk/models/conference.rb index f47c11b8..aed5bc33 100644 --- a/lib/bandwidth-sdk/models/conference.rb +++ b/lib/bandwidth-sdk/models/conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/conference_completed_callback.rb b/lib/bandwidth-sdk/models/conference_completed_callback.rb index 82f27389..5d7dfab8 100644 --- a/lib/bandwidth-sdk/models/conference_completed_callback.rb +++ b/lib/bandwidth-sdk/models/conference_completed_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/conference_created_callback.rb b/lib/bandwidth-sdk/models/conference_created_callback.rb index 656433a4..5c571956 100644 --- a/lib/bandwidth-sdk/models/conference_created_callback.rb +++ b/lib/bandwidth-sdk/models/conference_created_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/conference_member.rb b/lib/bandwidth-sdk/models/conference_member.rb index ca1c3248..7d3c9fea 100644 --- a/lib/bandwidth-sdk/models/conference_member.rb +++ b/lib/bandwidth-sdk/models/conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb index c4e0436a..d3e8aa76 100644 --- a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/conference_member_join_callback.rb b/lib/bandwidth-sdk/models/conference_member_join_callback.rb index 09ae2fd5..68e9e036 100644 --- a/lib/bandwidth-sdk/models/conference_member_join_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_join_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb index 44cee423..67187040 100644 --- a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/conference_recording_metadata.rb b/lib/bandwidth-sdk/models/conference_recording_metadata.rb index 43e5ab8d..bbd037cb 100644 --- a/lib/bandwidth-sdk/models/conference_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/conference_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/conference_redirect_callback.rb b/lib/bandwidth-sdk/models/conference_redirect_callback.rb index 3909e9ad..a88d5f45 100644 --- a/lib/bandwidth-sdk/models/conference_redirect_callback.rb +++ b/lib/bandwidth-sdk/models/conference_redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/conference_state_enum.rb b/lib/bandwidth-sdk/models/conference_state_enum.rb index 0d6845b2..75b2e8f8 100644 --- a/lib/bandwidth-sdk/models/conference_state_enum.rb +++ b/lib/bandwidth-sdk/models/conference_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/create_call.rb b/lib/bandwidth-sdk/models/create_call.rb index 28f24a45..61b698d6 100644 --- a/lib/bandwidth-sdk/models/create_call.rb +++ b/lib/bandwidth-sdk/models/create_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/create_call_response.rb b/lib/bandwidth-sdk/models/create_call_response.rb index d766cecb..1606f372 100644 --- a/lib/bandwidth-sdk/models/create_call_response.rb +++ b/lib/bandwidth-sdk/models/create_call_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/create_lookup_response.rb b/lib/bandwidth-sdk/models/create_lookup_response.rb index 136645b7..c01d7399 100644 --- a/lib/bandwidth-sdk/models/create_lookup_response.rb +++ b/lib/bandwidth-sdk/models/create_lookup_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/create_message_request_error.rb b/lib/bandwidth-sdk/models/create_message_request_error.rb index 233223be..97a555b4 100644 --- a/lib/bandwidth-sdk/models/create_message_request_error.rb +++ b/lib/bandwidth-sdk/models/create_message_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/deferred_result.rb b/lib/bandwidth-sdk/models/deferred_result.rb index bbdce958..34eb3b44 100644 --- a/lib/bandwidth-sdk/models/deferred_result.rb +++ b/lib/bandwidth-sdk/models/deferred_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/disconnect_callback.rb b/lib/bandwidth-sdk/models/disconnect_callback.rb new file mode 100644 index 00000000..709d5e07 --- /dev/null +++ b/lib/bandwidth-sdk/models/disconnect_callback.rb @@ -0,0 +1,407 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.4.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # The Disconnect event is fired when a call ends, for any reason. + class DisconnectCallback + # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. + attr_accessor :event_type + + # 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. + attr_accessor :event_time + + # The user account associated with the call. + attr_accessor :account_id + + # The id of the application associated with the call. + attr_accessor :application_id + + # 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. + attr_accessor :from + + # The phone number that received the call, in E.164 format (e.g. +15555555555). + attr_accessor :to + + # The call id associated with the event. + attr_accessor :call_id + + attr_accessor :direction + + # The URL of the call associated with the event. + attr_accessor :call_url + + # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. + attr_accessor :enqueued_time + + # Time the call was started, in ISO 8601 format. + attr_accessor :start_time + + # Time the call was answered, in ISO 8601 format. + attr_accessor :answer_time + + # The time that the recording ended in ISO-8601 format + attr_accessor :end_time + + # Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. + attr_accessor :cause + + # Text explaining the reason that caused the call to fail in case of errors. + attr_accessor :error_message + + # Bandwidth's internal id that references the error event. + attr_accessor :error_id + + # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. + attr_accessor :tag + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_type' => :'eventType', + :'event_time' => :'eventTime', + :'account_id' => :'accountId', + :'application_id' => :'applicationId', + :'from' => :'from', + :'to' => :'to', + :'call_id' => :'callId', + :'direction' => :'direction', + :'call_url' => :'callUrl', + :'enqueued_time' => :'enqueuedTime', + :'start_time' => :'startTime', + :'answer_time' => :'answerTime', + :'end_time' => :'endTime', + :'cause' => :'cause', + :'error_message' => :'errorMessage', + :'error_id' => :'errorId', + :'tag' => :'tag' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event_type' => :'String', + :'event_time' => :'String', + :'account_id' => :'String', + :'application_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_id' => :'String', + :'direction' => :'CallDirectionEnum', + :'call_url' => :'String', + :'enqueued_time' => :'Time', + :'start_time' => :'Time', + :'answer_time' => :'Time', + :'end_time' => :'Time', + :'cause' => :'String', + :'error_message' => :'String', + :'error_id' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'enqueued_time', + :'answer_time', + :'error_message', + :'error_id', + :'tag' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::DisconnectCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DisconnectCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'call_url') + self.call_url = attributes[:'call_url'] + end + + if attributes.key?(:'enqueued_time') + self.enqueued_time = attributes[:'enqueued_time'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'answer_time') + self.answer_time = attributes[:'answer_time'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'cause') + self.cause = attributes[:'cause'] + end + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'error_id') + self.error_id = attributes[:'error_id'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_type == o.event_type && + event_time == o.event_time && + account_id == o.account_id && + application_id == o.application_id && + from == o.from && + to == o.to && + call_id == o.call_id && + direction == o.direction && + call_url == o.call_url && + enqueued_time == o.enqueued_time && + start_time == o.start_time && + answer_time == o.answer_time && + end_time == o.end_time && + cause == o.cause && + error_message == o.error_message && + error_id == o.error_id && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event_type, event_time, account_id, application_id, from, to, call_id, direction, call_url, enqueued_time, start_time, answer_time, end_time, cause, error_message, error_id, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/bandwidth-sdk/models/diversion.rb b/lib/bandwidth-sdk/models/diversion.rb index e4030b1f..c9a9c1a1 100644 --- a/lib/bandwidth-sdk/models/diversion.rb +++ b/lib/bandwidth-sdk/models/diversion.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/dtmf_callback.rb b/lib/bandwidth-sdk/models/dtmf_callback.rb index 8cd77962..d219ba28 100644 --- a/lib/bandwidth-sdk/models/dtmf_callback.rb +++ b/lib/bandwidth-sdk/models/dtmf_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/field_error.rb b/lib/bandwidth-sdk/models/field_error.rb index b32d8164..876d2fd1 100644 --- a/lib/bandwidth-sdk/models/field_error.rb +++ b/lib/bandwidth-sdk/models/field_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/file_format_enum.rb b/lib/bandwidth-sdk/models/file_format_enum.rb index 4e426f67..6a03c2a8 100644 --- a/lib/bandwidth-sdk/models/file_format_enum.rb +++ b/lib/bandwidth-sdk/models/file_format_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/gather_callback.rb b/lib/bandwidth-sdk/models/gather_callback.rb index 9fa91994..629e0c5b 100644 --- a/lib/bandwidth-sdk/models/gather_callback.rb +++ b/lib/bandwidth-sdk/models/gather_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/inbound_message_callback.rb b/lib/bandwidth-sdk/models/inbound_message_callback.rb index 9880727a..8e6d7e26 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb index b917968f..6cb22057 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/initiate_callback.rb b/lib/bandwidth-sdk/models/initiate_callback.rb index f009a7f4..917d552f 100644 --- a/lib/bandwidth-sdk/models/initiate_callback.rb +++ b/lib/bandwidth-sdk/models/initiate_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/list_message_direction_enum.rb b/lib/bandwidth-sdk/models/list_message_direction_enum.rb index 255f7531..af6c902d 100644 --- a/lib/bandwidth-sdk/models/list_message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/list_message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/list_message_item.rb b/lib/bandwidth-sdk/models/list_message_item.rb index 4bbb8a2e..19d17c4a 100644 --- a/lib/bandwidth-sdk/models/list_message_item.rb +++ b/lib/bandwidth-sdk/models/list_message_item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/lookup_request.rb b/lib/bandwidth-sdk/models/lookup_request.rb index e5003e82..ae53d6e6 100644 --- a/lib/bandwidth-sdk/models/lookup_request.rb +++ b/lib/bandwidth-sdk/models/lookup_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/lookup_result.rb b/lib/bandwidth-sdk/models/lookup_result.rb index 4d2583ed..8a48c789 100644 --- a/lib/bandwidth-sdk/models/lookup_result.rb +++ b/lib/bandwidth-sdk/models/lookup_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/lookup_status.rb b/lib/bandwidth-sdk/models/lookup_status.rb index a41ea924..f28cc929 100644 --- a/lib/bandwidth-sdk/models/lookup_status.rb +++ b/lib/bandwidth-sdk/models/lookup_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/lookup_status_enum.rb b/lib/bandwidth-sdk/models/lookup_status_enum.rb index 0f013462..f072637f 100644 --- a/lib/bandwidth-sdk/models/lookup_status_enum.rb +++ b/lib/bandwidth-sdk/models/lookup_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb index aacb5b4a..ccfa56dd 100644 --- a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +++ b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/machine_detection_configuration.rb b/lib/bandwidth-sdk/models/machine_detection_configuration.rb index 57f324d9..132c538b 100644 --- a/lib/bandwidth-sdk/models/machine_detection_configuration.rb +++ b/lib/bandwidth-sdk/models/machine_detection_configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb index 755fc9b7..802fe3cd 100644 --- a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +++ b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/media.rb b/lib/bandwidth-sdk/models/media.rb index 7b4d5d38..9aa24732 100644 --- a/lib/bandwidth-sdk/models/media.rb +++ b/lib/bandwidth-sdk/models/media.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/message.rb b/lib/bandwidth-sdk/models/message.rb index 568cc016..91df8c6c 100644 --- a/lib/bandwidth-sdk/models/message.rb +++ b/lib/bandwidth-sdk/models/message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/message_delivered_callback.rb b/lib/bandwidth-sdk/models/message_delivered_callback.rb index 47d84c5f..752fb90e 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb index 25aff946..4b06606c 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/message_direction_enum.rb b/lib/bandwidth-sdk/models/message_direction_enum.rb index 83fad806..965101fb 100644 --- a/lib/bandwidth-sdk/models/message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/message_failed_callback.rb b/lib/bandwidth-sdk/models/message_failed_callback.rb index 23372198..6a625401 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/message_failed_callback_message.rb b/lib/bandwidth-sdk/models/message_failed_callback_message.rb index 22c265fd..d4a02732 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/message_request.rb b/lib/bandwidth-sdk/models/message_request.rb index f3104854..d15d7c1d 100644 --- a/lib/bandwidth-sdk/models/message_request.rb +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/message_sending_callback.rb b/lib/bandwidth-sdk/models/message_sending_callback.rb index b312d70e..9ae222b8 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/message_sending_callback_message.rb b/lib/bandwidth-sdk/models/message_sending_callback_message.rb index 3cbbab6a..a0dd2f68 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/message_status_enum.rb b/lib/bandwidth-sdk/models/message_status_enum.rb index 1f653a26..6d28b8d4 100644 --- a/lib/bandwidth-sdk/models/message_status_enum.rb +++ b/lib/bandwidth-sdk/models/message_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/message_type_enum.rb b/lib/bandwidth-sdk/models/message_type_enum.rb index 37f3219f..7275033b 100644 --- a/lib/bandwidth-sdk/models/message_type_enum.rb +++ b/lib/bandwidth-sdk/models/message_type_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/messages_list.rb b/lib/bandwidth-sdk/models/messages_list.rb index 09436ce5..7f296a0e 100644 --- a/lib/bandwidth-sdk/models/messages_list.rb +++ b/lib/bandwidth-sdk/models/messages_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/messaging_code_response.rb b/lib/bandwidth-sdk/models/messaging_code_response.rb index 7e86e9e9..5d3c6a0b 100644 --- a/lib/bandwidth-sdk/models/messaging_code_response.rb +++ b/lib/bandwidth-sdk/models/messaging_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/messaging_request_error.rb b/lib/bandwidth-sdk/models/messaging_request_error.rb index 08c18005..ea01bf8b 100644 --- a/lib/bandwidth-sdk/models/messaging_request_error.rb +++ b/lib/bandwidth-sdk/models/messaging_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb index af8ebc9d..e5ee3b65 100644 --- a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/mfa_request_error.rb b/lib/bandwidth-sdk/models/mfa_request_error.rb index c9a7842a..d04bc73d 100644 --- a/lib/bandwidth-sdk/models/mfa_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb index d3db724a..17cde720 100644 --- a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/page_info.rb b/lib/bandwidth-sdk/models/page_info.rb index 1ea3fd2b..794dbbe5 100644 --- a/lib/bandwidth-sdk/models/page_info.rb +++ b/lib/bandwidth-sdk/models/page_info.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/priority_enum.rb b/lib/bandwidth-sdk/models/priority_enum.rb index ba42d784..2e7f81a8 100644 --- a/lib/bandwidth-sdk/models/priority_enum.rb +++ b/lib/bandwidth-sdk/models/priority_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/recording_available_callback.rb b/lib/bandwidth-sdk/models/recording_available_callback.rb index 19eb5746..c6e3209b 100644 --- a/lib/bandwidth-sdk/models/recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/recording_complete_callback.rb b/lib/bandwidth-sdk/models/recording_complete_callback.rb index f3add876..2a02da71 100644 --- a/lib/bandwidth-sdk/models/recording_complete_callback.rb +++ b/lib/bandwidth-sdk/models/recording_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/recording_state_enum.rb b/lib/bandwidth-sdk/models/recording_state_enum.rb index 40ca7c72..f55244d0 100644 --- a/lib/bandwidth-sdk/models/recording_state_enum.rb +++ b/lib/bandwidth-sdk/models/recording_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/redirect_callback.rb b/lib/bandwidth-sdk/models/redirect_callback.rb index 874e4ea5..894710b1 100644 --- a/lib/bandwidth-sdk/models/redirect_callback.rb +++ b/lib/bandwidth-sdk/models/redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/redirect_method_enum.rb b/lib/bandwidth-sdk/models/redirect_method_enum.rb index 5f4d63b2..1ba4176c 100644 --- a/lib/bandwidth-sdk/models/redirect_method_enum.rb +++ b/lib/bandwidth-sdk/models/redirect_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/stir_shaken.rb b/lib/bandwidth-sdk/models/stir_shaken.rb index 21f1535d..1ec06f5c 100644 --- a/lib/bandwidth-sdk/models/stir_shaken.rb +++ b/lib/bandwidth-sdk/models/stir_shaken.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/tag.rb b/lib/bandwidth-sdk/models/tag.rb index 46791f6f..fec73411 100644 --- a/lib/bandwidth-sdk/models/tag.rb +++ b/lib/bandwidth-sdk/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb index 866acaa4..b43d53e2 100644 --- a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +++ b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/transcribe_recording.rb b/lib/bandwidth-sdk/models/transcribe_recording.rb index a8594b36..93dd4228 100644 --- a/lib/bandwidth-sdk/models/transcribe_recording.rb +++ b/lib/bandwidth-sdk/models/transcribe_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/transcription.rb b/lib/bandwidth-sdk/models/transcription.rb index d0f077fd..31c8eef2 100644 --- a/lib/bandwidth-sdk/models/transcription.rb +++ b/lib/bandwidth-sdk/models/transcription.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/transcription_available_callback.rb b/lib/bandwidth-sdk/models/transcription_available_callback.rb index 89ff4613..600175f0 100644 --- a/lib/bandwidth-sdk/models/transcription_available_callback.rb +++ b/lib/bandwidth-sdk/models/transcription_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/transcription_list.rb b/lib/bandwidth-sdk/models/transcription_list.rb index d52d0e37..4c5d28a1 100644 --- a/lib/bandwidth-sdk/models/transcription_list.rb +++ b/lib/bandwidth-sdk/models/transcription_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/transcription_metadata.rb b/lib/bandwidth-sdk/models/transcription_metadata.rb index f4a50e38..97ccd20c 100644 --- a/lib/bandwidth-sdk/models/transcription_metadata.rb +++ b/lib/bandwidth-sdk/models/transcription_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/transfer_answer_callback.rb b/lib/bandwidth-sdk/models/transfer_answer_callback.rb index 1b914f82..cb86dde4 100644 --- a/lib/bandwidth-sdk/models/transfer_answer_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/transfer_complete_callback.rb b/lib/bandwidth-sdk/models/transfer_complete_callback.rb index 0f5f2390..9ddc2bba 100644 --- a/lib/bandwidth-sdk/models/transfer_complete_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb index 2f12aebe..b1227953 100644 --- a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/update_call.rb b/lib/bandwidth-sdk/models/update_call.rb index 8a62a400..85b0f7e7 100644 --- a/lib/bandwidth-sdk/models/update_call.rb +++ b/lib/bandwidth-sdk/models/update_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/update_call_recording.rb b/lib/bandwidth-sdk/models/update_call_recording.rb index b239a250..b7303af5 100644 --- a/lib/bandwidth-sdk/models/update_call_recording.rb +++ b/lib/bandwidth-sdk/models/update_call_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/update_conference.rb b/lib/bandwidth-sdk/models/update_conference.rb index eb5465ae..170efb70 100644 --- a/lib/bandwidth-sdk/models/update_conference.rb +++ b/lib/bandwidth-sdk/models/update_conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/update_conference_member.rb b/lib/bandwidth-sdk/models/update_conference_member.rb index 128d887c..641e18de 100644 --- a/lib/bandwidth-sdk/models/update_conference_member.rb +++ b/lib/bandwidth-sdk/models/update_conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/verify_code_request.rb b/lib/bandwidth-sdk/models/verify_code_request.rb index a859f0fa..eace3f2b 100644 --- a/lib/bandwidth-sdk/models/verify_code_request.rb +++ b/lib/bandwidth-sdk/models/verify_code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/verify_code_response.rb b/lib/bandwidth-sdk/models/verify_code_response.rb index a80477f6..5d53c3f5 100644 --- a/lib/bandwidth-sdk/models/verify_code_response.rb +++ b/lib/bandwidth-sdk/models/verify_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/voice_api_error.rb b/lib/bandwidth-sdk/models/voice_api_error.rb index b7d149de..c30cbc77 100644 --- a/lib/bandwidth-sdk/models/voice_api_error.rb +++ b/lib/bandwidth-sdk/models/voice_api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/models/voice_code_response.rb b/lib/bandwidth-sdk/models/voice_code_response.rb index 6876518a..d19aba3f 100644 --- a/lib/bandwidth-sdk/models/voice_code_response.rb +++ b/lib/bandwidth-sdk/models/voice_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/lib/bandwidth-sdk/version.rb b/lib/bandwidth-sdk/version.rb index f1abbcc0..abbfff68 100644 --- a/lib/bandwidth-sdk/version.rb +++ b/lib/bandwidth-sdk/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bf55ddf3..a532fecb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/api/calls_api_spec.rb b/spec/unit/api/calls_api_spec.rb index bc8b4a01..65a8247d 100644 --- a/spec/unit/api/calls_api_spec.rb +++ b/spec/unit/api/calls_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/api/conferences_api_spec.rb b/spec/unit/api/conferences_api_spec.rb index 1cdb9a3f..8c2704b4 100644 --- a/spec/unit/api/conferences_api_spec.rb +++ b/spec/unit/api/conferences_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/api/media_api_spec.rb b/spec/unit/api/media_api_spec.rb index 4fdb3c45..bcce6825 100644 --- a/spec/unit/api/media_api_spec.rb +++ b/spec/unit/api/media_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/api/messages_api_spec.rb b/spec/unit/api/messages_api_spec.rb index 6ada2bb9..cfab1b53 100644 --- a/spec/unit/api/messages_api_spec.rb +++ b/spec/unit/api/messages_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end @@ -17,8 +17,9 @@ # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'MessagesApi' do - before(:all) do - @api_instance_msg = Bandwidth::MessagesApi.new() + before do + # run before each test + @api_instance = Bandwidth::MessagesApi.new end after do @@ -27,7 +28,7 @@ describe 'test an instance of MessagesApi' do it 'should create an instance of MessagesApi' do - expect(@api_instance_msg).to be_instance_of(Bandwidth::MessagesApi) + expect(@api_instance).to be_instance_of(Bandwidth::MessagesApi) end end @@ -39,7 +40,7 @@ # @param [Hash] opts the optional parameters # @return [Message] describe 'create_message test' do - it 'create a message' do + it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end diff --git a/spec/unit/api/mfa_api_spec.rb b/spec/unit/api/mfa_api_spec.rb index f65ea056..8a91d522 100644 --- a/spec/unit/api/mfa_api_spec.rb +++ b/spec/unit/api/mfa_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/api/phone_number_lookup_api_spec.rb b/spec/unit/api/phone_number_lookup_api_spec.rb index 23a47b5a..3c65d73f 100644 --- a/spec/unit/api/phone_number_lookup_api_spec.rb +++ b/spec/unit/api/phone_number_lookup_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/api/recordings_api_spec.rb b/spec/unit/api/recordings_api_spec.rb index 4f52bd89..8b3158c8 100644 --- a/spec/unit/api/recordings_api_spec.rb +++ b/spec/unit/api/recordings_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/api/statistics_api_spec.rb b/spec/unit/api/statistics_api_spec.rb index e24d44bd..65f2e793 100644 --- a/spec/unit/api/statistics_api_spec.rb +++ b/spec/unit/api/statistics_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/account_statistics_spec.rb b/spec/unit/models/account_statistics_spec.rb index a16987e0..d671f6d8 100644 --- a/spec/unit/models/account_statistics_spec.rb +++ b/spec/unit/models/account_statistics_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/answer_callback_spec.rb b/spec/unit/models/answer_callback_spec.rb index 7ea9e15c..3446baf1 100644 --- a/spec/unit/models/answer_callback_spec.rb +++ b/spec/unit/models/answer_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/bridge_complete_callback_spec.rb b/spec/unit/models/bridge_complete_callback_spec.rb index 3e39209a..8987132d 100644 --- a/spec/unit/models/bridge_complete_callback_spec.rb +++ b/spec/unit/models/bridge_complete_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/bridge_target_complete_callback_spec.rb b/spec/unit/models/bridge_target_complete_callback_spec.rb index bee95057..5e94bb88 100644 --- a/spec/unit/models/bridge_target_complete_callback_spec.rb +++ b/spec/unit/models/bridge_target_complete_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/call_direction_enum_spec.rb b/spec/unit/models/call_direction_enum_spec.rb index c924bc2e..92052a06 100644 --- a/spec/unit/models/call_direction_enum_spec.rb +++ b/spec/unit/models/call_direction_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/call_recording_metadata_spec.rb b/spec/unit/models/call_recording_metadata_spec.rb index baae48fb..a5840e80 100644 --- a/spec/unit/models/call_recording_metadata_spec.rb +++ b/spec/unit/models/call_recording_metadata_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/call_state_enum_spec.rb b/spec/unit/models/call_state_enum_spec.rb index 31f4f843..03710fd9 100644 --- a/spec/unit/models/call_state_enum_spec.rb +++ b/spec/unit/models/call_state_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/call_state_spec.rb b/spec/unit/models/call_state_spec.rb index 277dced0..3b2774a1 100644 --- a/spec/unit/models/call_state_spec.rb +++ b/spec/unit/models/call_state_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/callback_method_enum_spec.rb b/spec/unit/models/callback_method_enum_spec.rb index 3dc07d14..394980d7 100644 --- a/spec/unit/models/callback_method_enum_spec.rb +++ b/spec/unit/models/callback_method_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/code_request_spec.rb b/spec/unit/models/code_request_spec.rb index 43a2bfa0..39712279 100644 --- a/spec/unit/models/code_request_spec.rb +++ b/spec/unit/models/code_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/conference_completed_callback_spec.rb b/spec/unit/models/conference_completed_callback_spec.rb index 419796e3..b202ce8e 100644 --- a/spec/unit/models/conference_completed_callback_spec.rb +++ b/spec/unit/models/conference_completed_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/conference_created_callback_spec.rb b/spec/unit/models/conference_created_callback_spec.rb index ee2396fa..16d03179 100644 --- a/spec/unit/models/conference_created_callback_spec.rb +++ b/spec/unit/models/conference_created_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/conference_member_exit_callback_spec.rb b/spec/unit/models/conference_member_exit_callback_spec.rb index ddec30c6..4bb244d6 100644 --- a/spec/unit/models/conference_member_exit_callback_spec.rb +++ b/spec/unit/models/conference_member_exit_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/conference_member_join_callback_spec.rb b/spec/unit/models/conference_member_join_callback_spec.rb index f4fb1853..b07a3abe 100644 --- a/spec/unit/models/conference_member_join_callback_spec.rb +++ b/spec/unit/models/conference_member_join_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/conference_member_spec.rb b/spec/unit/models/conference_member_spec.rb index 7bd159be..62d2178e 100644 --- a/spec/unit/models/conference_member_spec.rb +++ b/spec/unit/models/conference_member_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/conference_recording_available_callback_spec.rb b/spec/unit/models/conference_recording_available_callback_spec.rb index d8378e7f..92ca4030 100644 --- a/spec/unit/models/conference_recording_available_callback_spec.rb +++ b/spec/unit/models/conference_recording_available_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/conference_recording_metadata_spec.rb b/spec/unit/models/conference_recording_metadata_spec.rb index ebcbed8e..6f86e28e 100644 --- a/spec/unit/models/conference_recording_metadata_spec.rb +++ b/spec/unit/models/conference_recording_metadata_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/conference_redirect_callback_spec.rb b/spec/unit/models/conference_redirect_callback_spec.rb index d60d9e7d..253f066b 100644 --- a/spec/unit/models/conference_redirect_callback_spec.rb +++ b/spec/unit/models/conference_redirect_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/conference_spec.rb b/spec/unit/models/conference_spec.rb index fbf3db96..e7f3018e 100644 --- a/spec/unit/models/conference_spec.rb +++ b/spec/unit/models/conference_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/conference_state_enum_spec.rb b/spec/unit/models/conference_state_enum_spec.rb index ee7eb622..6cfbb7de 100644 --- a/spec/unit/models/conference_state_enum_spec.rb +++ b/spec/unit/models/conference_state_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/create_call_response_spec.rb b/spec/unit/models/create_call_response_spec.rb index f3e0f103..6dce6a19 100644 --- a/spec/unit/models/create_call_response_spec.rb +++ b/spec/unit/models/create_call_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/create_call_spec.rb b/spec/unit/models/create_call_spec.rb index 685a69cb..1e374804 100644 --- a/spec/unit/models/create_call_spec.rb +++ b/spec/unit/models/create_call_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/create_lookup_response_spec.rb b/spec/unit/models/create_lookup_response_spec.rb index 6d51134f..238dad02 100644 --- a/spec/unit/models/create_lookup_response_spec.rb +++ b/spec/unit/models/create_lookup_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/create_message_request_error_spec.rb b/spec/unit/models/create_message_request_error_spec.rb index a04b7d0a..592d5972 100644 --- a/spec/unit/models/create_message_request_error_spec.rb +++ b/spec/unit/models/create_message_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/deferred_result_spec.rb b/spec/unit/models/deferred_result_spec.rb index 3229edfa..b1f4b607 100644 --- a/spec/unit/models/deferred_result_spec.rb +++ b/spec/unit/models/deferred_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/disconenct_callback_spec.rb b/spec/unit/models/disconnect_callback_spec.rb similarity index 90% rename from spec/unit/models/disconenct_callback_spec.rb rename to spec/unit/models/disconnect_callback_spec.rb index d70a0c47..42219ed2 100644 --- a/spec/unit/models/disconenct_callback_spec.rb +++ b/spec/unit/models/disconnect_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end @@ -14,15 +14,15 @@ require 'json' require 'date' -# Unit tests for Bandwidth::DisconenctCallback +# Unit tests for Bandwidth::DisconnectCallback # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe Bandwidth::DisconenctCallback do - let(:instance) { Bandwidth::DisconenctCallback.new } +describe Bandwidth::DisconnectCallback do + let(:instance) { Bandwidth::DisconnectCallback.new } - describe 'test an instance of DisconenctCallback' do - it 'should create an instance of DisconenctCallback' do - expect(instance).to be_instance_of(Bandwidth::DisconenctCallback) + describe 'test an instance of DisconnectCallback' do + it 'should create an instance of DisconnectCallback' do + expect(instance).to be_instance_of(Bandwidth::DisconnectCallback) end end describe 'test attribute "event_type"' do diff --git a/spec/unit/models/diversion_spec.rb b/spec/unit/models/diversion_spec.rb index 131a5459..6f8b9a8a 100644 --- a/spec/unit/models/diversion_spec.rb +++ b/spec/unit/models/diversion_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/dtmf_callback_spec.rb b/spec/unit/models/dtmf_callback_spec.rb index 5e54eb5e..a0b9de36 100644 --- a/spec/unit/models/dtmf_callback_spec.rb +++ b/spec/unit/models/dtmf_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/field_error_spec.rb b/spec/unit/models/field_error_spec.rb index 11f19be5..e33c58cd 100644 --- a/spec/unit/models/field_error_spec.rb +++ b/spec/unit/models/field_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/file_format_enum_spec.rb b/spec/unit/models/file_format_enum_spec.rb index a8e65461..9c6417d2 100644 --- a/spec/unit/models/file_format_enum_spec.rb +++ b/spec/unit/models/file_format_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/gather_callback_spec.rb b/spec/unit/models/gather_callback_spec.rb index b69a6250..8e567015 100644 --- a/spec/unit/models/gather_callback_spec.rb +++ b/spec/unit/models/gather_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/inbound_message_callback_message_spec.rb b/spec/unit/models/inbound_message_callback_message_spec.rb index ce9adf1a..86ff19e2 100644 --- a/spec/unit/models/inbound_message_callback_message_spec.rb +++ b/spec/unit/models/inbound_message_callback_message_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/inbound_message_callback_spec.rb b/spec/unit/models/inbound_message_callback_spec.rb index 47a37a84..6e8d9393 100644 --- a/spec/unit/models/inbound_message_callback_spec.rb +++ b/spec/unit/models/inbound_message_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/initiate_callback_spec.rb b/spec/unit/models/initiate_callback_spec.rb index d0258da9..c97f96fe 100644 --- a/spec/unit/models/initiate_callback_spec.rb +++ b/spec/unit/models/initiate_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/list_message_direction_enum_spec.rb b/spec/unit/models/list_message_direction_enum_spec.rb index c023c584..d196706a 100644 --- a/spec/unit/models/list_message_direction_enum_spec.rb +++ b/spec/unit/models/list_message_direction_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/list_message_item_spec.rb b/spec/unit/models/list_message_item_spec.rb index ad247c40..ae223c8a 100644 --- a/spec/unit/models/list_message_item_spec.rb +++ b/spec/unit/models/list_message_item_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/lookup_request_spec.rb b/spec/unit/models/lookup_request_spec.rb index 5189da3b..2fd1a337 100644 --- a/spec/unit/models/lookup_request_spec.rb +++ b/spec/unit/models/lookup_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/lookup_result_spec.rb b/spec/unit/models/lookup_result_spec.rb index cece9c74..17df4ea5 100644 --- a/spec/unit/models/lookup_result_spec.rb +++ b/spec/unit/models/lookup_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/lookup_status_enum_spec.rb b/spec/unit/models/lookup_status_enum_spec.rb index 76111308..a9bf5502 100644 --- a/spec/unit/models/lookup_status_enum_spec.rb +++ b/spec/unit/models/lookup_status_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/lookup_status_spec.rb b/spec/unit/models/lookup_status_spec.rb index 46536725..4e22b40b 100644 --- a/spec/unit/models/lookup_status_spec.rb +++ b/spec/unit/models/lookup_status_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/machine_detection_complete_callback_spec.rb b/spec/unit/models/machine_detection_complete_callback_spec.rb index ed667f7b..64deabc2 100644 --- a/spec/unit/models/machine_detection_complete_callback_spec.rb +++ b/spec/unit/models/machine_detection_complete_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/machine_detection_configuration_spec.rb b/spec/unit/models/machine_detection_configuration_spec.rb index 0dddbb1b..d456fbe7 100644 --- a/spec/unit/models/machine_detection_configuration_spec.rb +++ b/spec/unit/models/machine_detection_configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/machine_detection_mode_enum_spec.rb b/spec/unit/models/machine_detection_mode_enum_spec.rb index 5388d6f9..942c8dde 100644 --- a/spec/unit/models/machine_detection_mode_enum_spec.rb +++ b/spec/unit/models/machine_detection_mode_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/media_spec.rb b/spec/unit/models/media_spec.rb index 42f055d6..7d363910 100644 --- a/spec/unit/models/media_spec.rb +++ b/spec/unit/models/media_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/message_delivered_callback_message_spec.rb b/spec/unit/models/message_delivered_callback_message_spec.rb index 5a1242fe..0c57b32c 100644 --- a/spec/unit/models/message_delivered_callback_message_spec.rb +++ b/spec/unit/models/message_delivered_callback_message_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/message_delivered_callback_spec.rb b/spec/unit/models/message_delivered_callback_spec.rb index 3420e389..c865c349 100644 --- a/spec/unit/models/message_delivered_callback_spec.rb +++ b/spec/unit/models/message_delivered_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/message_direction_enum_spec.rb b/spec/unit/models/message_direction_enum_spec.rb index 7bf048b1..642b9d7b 100644 --- a/spec/unit/models/message_direction_enum_spec.rb +++ b/spec/unit/models/message_direction_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/message_failed_callback_message_spec.rb b/spec/unit/models/message_failed_callback_message_spec.rb index 271ef18a..20dc9a82 100644 --- a/spec/unit/models/message_failed_callback_message_spec.rb +++ b/spec/unit/models/message_failed_callback_message_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/message_failed_callback_spec.rb b/spec/unit/models/message_failed_callback_spec.rb index c2399438..f38f19e7 100644 --- a/spec/unit/models/message_failed_callback_spec.rb +++ b/spec/unit/models/message_failed_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/message_request_spec.rb b/spec/unit/models/message_request_spec.rb index 2c6d1a39..48ff1f5c 100644 --- a/spec/unit/models/message_request_spec.rb +++ b/spec/unit/models/message_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/message_sending_callback_message_spec.rb b/spec/unit/models/message_sending_callback_message_spec.rb index 880be4e2..cbbae5b5 100644 --- a/spec/unit/models/message_sending_callback_message_spec.rb +++ b/spec/unit/models/message_sending_callback_message_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/message_sending_callback_spec.rb b/spec/unit/models/message_sending_callback_spec.rb index 4d76a97b..86d18ddc 100644 --- a/spec/unit/models/message_sending_callback_spec.rb +++ b/spec/unit/models/message_sending_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/message_spec.rb b/spec/unit/models/message_spec.rb index 497b1fed..0c4500ab 100644 --- a/spec/unit/models/message_spec.rb +++ b/spec/unit/models/message_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/message_status_enum_spec.rb b/spec/unit/models/message_status_enum_spec.rb index 0e0ea4fd..bda7d8ae 100644 --- a/spec/unit/models/message_status_enum_spec.rb +++ b/spec/unit/models/message_status_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/message_type_enum_spec.rb b/spec/unit/models/message_type_enum_spec.rb index d87e03cc..4098a219 100644 --- a/spec/unit/models/message_type_enum_spec.rb +++ b/spec/unit/models/message_type_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/messages_list_spec.rb b/spec/unit/models/messages_list_spec.rb index 6f7f7c61..77b39926 100644 --- a/spec/unit/models/messages_list_spec.rb +++ b/spec/unit/models/messages_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/messaging_code_response_spec.rb b/spec/unit/models/messaging_code_response_spec.rb index 7fbf9572..14616f5b 100644 --- a/spec/unit/models/messaging_code_response_spec.rb +++ b/spec/unit/models/messaging_code_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/messaging_request_error_spec.rb b/spec/unit/models/messaging_request_error_spec.rb index 848525c2..f1d9e385 100644 --- a/spec/unit/models/messaging_request_error_spec.rb +++ b/spec/unit/models/messaging_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/mfa_forbidden_request_error_spec.rb b/spec/unit/models/mfa_forbidden_request_error_spec.rb index a03446b0..55505b42 100644 --- a/spec/unit/models/mfa_forbidden_request_error_spec.rb +++ b/spec/unit/models/mfa_forbidden_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/mfa_request_error_spec.rb b/spec/unit/models/mfa_request_error_spec.rb index c3921a08..a0f5c357 100644 --- a/spec/unit/models/mfa_request_error_spec.rb +++ b/spec/unit/models/mfa_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/mfa_unauthorized_request_error_spec.rb b/spec/unit/models/mfa_unauthorized_request_error_spec.rb index 04359c51..2bf0dcdc 100644 --- a/spec/unit/models/mfa_unauthorized_request_error_spec.rb +++ b/spec/unit/models/mfa_unauthorized_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/page_info_spec.rb b/spec/unit/models/page_info_spec.rb index 418de320..6e6dd97d 100644 --- a/spec/unit/models/page_info_spec.rb +++ b/spec/unit/models/page_info_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/priority_enum_spec.rb b/spec/unit/models/priority_enum_spec.rb index a65be862..e1c8e6ba 100644 --- a/spec/unit/models/priority_enum_spec.rb +++ b/spec/unit/models/priority_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/recording_available_callback_spec.rb b/spec/unit/models/recording_available_callback_spec.rb index 77259023..1fbf0f0f 100644 --- a/spec/unit/models/recording_available_callback_spec.rb +++ b/spec/unit/models/recording_available_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/recording_complete_callback_spec.rb b/spec/unit/models/recording_complete_callback_spec.rb index c31a86c5..3d70d510 100644 --- a/spec/unit/models/recording_complete_callback_spec.rb +++ b/spec/unit/models/recording_complete_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/recording_state_enum_spec.rb b/spec/unit/models/recording_state_enum_spec.rb index 22dc0030..eb84b19c 100644 --- a/spec/unit/models/recording_state_enum_spec.rb +++ b/spec/unit/models/recording_state_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/redirect_callback_spec.rb b/spec/unit/models/redirect_callback_spec.rb index 48fa0d82..757f0cfc 100644 --- a/spec/unit/models/redirect_callback_spec.rb +++ b/spec/unit/models/redirect_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/redirect_method_enum_spec.rb b/spec/unit/models/redirect_method_enum_spec.rb index 0511c0b2..33cf6632 100644 --- a/spec/unit/models/redirect_method_enum_spec.rb +++ b/spec/unit/models/redirect_method_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/stir_shaken_spec.rb b/spec/unit/models/stir_shaken_spec.rb index 22b58f4e..790625da 100644 --- a/spec/unit/models/stir_shaken_spec.rb +++ b/spec/unit/models/stir_shaken_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/tag_spec.rb b/spec/unit/models/tag_spec.rb index 0708f495..14d4641b 100644 --- a/spec/unit/models/tag_spec.rb +++ b/spec/unit/models/tag_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/tn_lookup_request_error_spec.rb b/spec/unit/models/tn_lookup_request_error_spec.rb index c4960729..edc66fbe 100644 --- a/spec/unit/models/tn_lookup_request_error_spec.rb +++ b/spec/unit/models/tn_lookup_request_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/transcribe_recording_spec.rb b/spec/unit/models/transcribe_recording_spec.rb index 4cd9b618..d8ee6d72 100644 --- a/spec/unit/models/transcribe_recording_spec.rb +++ b/spec/unit/models/transcribe_recording_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/transcription_available_callback_spec.rb b/spec/unit/models/transcription_available_callback_spec.rb index 3a144ceb..15426222 100644 --- a/spec/unit/models/transcription_available_callback_spec.rb +++ b/spec/unit/models/transcription_available_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/transcription_list_spec.rb b/spec/unit/models/transcription_list_spec.rb index 14322ced..a5bb273d 100644 --- a/spec/unit/models/transcription_list_spec.rb +++ b/spec/unit/models/transcription_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/transcription_metadata_spec.rb b/spec/unit/models/transcription_metadata_spec.rb index 2b19edc0..9403dbbb 100644 --- a/spec/unit/models/transcription_metadata_spec.rb +++ b/spec/unit/models/transcription_metadata_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/transcription_spec.rb b/spec/unit/models/transcription_spec.rb index 76be9882..9a15c568 100644 --- a/spec/unit/models/transcription_spec.rb +++ b/spec/unit/models/transcription_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/transfer_answer_callback_spec.rb b/spec/unit/models/transfer_answer_callback_spec.rb index bfcd8acc..a4ec5baf 100644 --- a/spec/unit/models/transfer_answer_callback_spec.rb +++ b/spec/unit/models/transfer_answer_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/transfer_complete_callback_spec.rb b/spec/unit/models/transfer_complete_callback_spec.rb index 1b91e04f..0d248173 100644 --- a/spec/unit/models/transfer_complete_callback_spec.rb +++ b/spec/unit/models/transfer_complete_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/transfer_disconnect_callback_spec.rb b/spec/unit/models/transfer_disconnect_callback_spec.rb index 7f973b86..5eb5dbdb 100644 --- a/spec/unit/models/transfer_disconnect_callback_spec.rb +++ b/spec/unit/models/transfer_disconnect_callback_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/update_call_recording_spec.rb b/spec/unit/models/update_call_recording_spec.rb index 4c03a0b4..89b99d0d 100644 --- a/spec/unit/models/update_call_recording_spec.rb +++ b/spec/unit/models/update_call_recording_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/update_call_spec.rb b/spec/unit/models/update_call_spec.rb index 94629b4b..cfe69e23 100644 --- a/spec/unit/models/update_call_spec.rb +++ b/spec/unit/models/update_call_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/update_conference_member_spec.rb b/spec/unit/models/update_conference_member_spec.rb index 555b4c66..34067bf2 100644 --- a/spec/unit/models/update_conference_member_spec.rb +++ b/spec/unit/models/update_conference_member_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/update_conference_spec.rb b/spec/unit/models/update_conference_spec.rb index 337cbece..189b5722 100644 --- a/spec/unit/models/update_conference_spec.rb +++ b/spec/unit/models/update_conference_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/verify_code_request_spec.rb b/spec/unit/models/verify_code_request_spec.rb index 21801a22..b80d72c1 100644 --- a/spec/unit/models/verify_code_request_spec.rb +++ b/spec/unit/models/verify_code_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/verify_code_response_spec.rb b/spec/unit/models/verify_code_response_spec.rb index 61b45bf3..54914ba1 100644 --- a/spec/unit/models/verify_code_response_spec.rb +++ b/spec/unit/models/verify_code_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/voice_api_error_spec.rb b/spec/unit/models/voice_api_error_spec.rb index 9c37761b..3eb94b36 100644 --- a/spec/unit/models/voice_api_error_spec.rb +++ b/spec/unit/models/voice_api_error_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end diff --git a/spec/unit/models/voice_code_response_spec.rb b/spec/unit/models/voice_code_response_spec.rb index 27140409..fbfc3999 100644 --- a/spec/unit/models/voice_code_response_spec.rb +++ b/spec/unit/models/voice_code_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 +OpenAPI Generator version: 6.4.0 =end From bb15dc5b3ffd3e11df7c82847e587260a3ab8fa6 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Tue, 21 Feb 2023 10:43:09 -0500 Subject: [PATCH 05/30] Remove webrtc (#73) * remove webrtc files * update files --- .openapi-generator/FILES | 3 - lib/bandwidth-sdk/api/participants_api.rb | 230 ------- lib/bandwidth-sdk/api/sessions_api.rb | 613 ------------------ .../models/create_participant_request.rb | 261 -------- .../models/create_participant_response.rb | 230 ------- .../models/device_api_version_enum.rb | 39 -- lib/bandwidth-sdk/models/forbidden_request.rb | 220 ------- lib/bandwidth-sdk/models/participant.rb | 292 --------- .../models/participant_subscription.rb | 243 ------- .../models/publish_permissions_enum.rb | 40 -- lib/bandwidth-sdk/models/request_error.rb | 230 ------- lib/bandwidth-sdk/models/session.rb | 231 ------- lib/bandwidth-sdk/models/subscriptions.rb | 232 ------- .../models/unauthorized_request.rb | 220 ------- 14 files changed, 3084 deletions(-) delete mode 100644 lib/bandwidth-sdk/api/participants_api.rb delete mode 100644 lib/bandwidth-sdk/api/sessions_api.rb delete mode 100644 lib/bandwidth-sdk/models/create_participant_request.rb delete mode 100644 lib/bandwidth-sdk/models/create_participant_response.rb delete mode 100644 lib/bandwidth-sdk/models/device_api_version_enum.rb delete mode 100644 lib/bandwidth-sdk/models/forbidden_request.rb delete mode 100644 lib/bandwidth-sdk/models/participant.rb delete mode 100644 lib/bandwidth-sdk/models/participant_subscription.rb delete mode 100644 lib/bandwidth-sdk/models/publish_permissions_enum.rb delete mode 100644 lib/bandwidth-sdk/models/request_error.rb delete mode 100644 lib/bandwidth-sdk/models/session.rb delete mode 100644 lib/bandwidth-sdk/models/subscriptions.rb delete mode 100644 lib/bandwidth-sdk/models/unauthorized_request.rb diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 80e32147..10807bd7 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,11 +1,9 @@ -.gitignore .gitlab-ci.yml .rspec .rubocop.yml .travis.yml Gemfile README.md -Rakefile bandwidth-sdk.gemspec docs/AccountStatistics.md docs/AnswerCallback.md @@ -300,4 +298,3 @@ spec/models/verify_code_request_spec.rb spec/models/verify_code_response_spec.rb spec/models/voice_api_error_spec.rb spec/models/voice_code_response_spec.rb -spec/spec_helper.rb diff --git a/lib/bandwidth-sdk/api/participants_api.rb b/lib/bandwidth-sdk/api/participants_api.rb deleted file mode 100644 index 797efd87..00000000 --- a/lib/bandwidth-sdk/api/participants_api.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'cgi' - -module Bandwidth - class ParticipantsApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Create Participant - # Create a new participant under this account. Participants are idempotent, so relevant parameters must be set in this function if desired. - # @param account_id [String] Account ID - # @param [Hash] opts the optional parameters - # @option opts [CreateParticipantRequest] :create_participant_request Create participant request body. - # @return [CreateParticipantResponse] - def create_participant(account_id, opts = {}) - data, _status_code, _headers = create_participant_with_http_info(account_id, opts) - data - end - - # Create Participant - # Create a new participant under this account. Participants are idempotent, so relevant parameters must be set in this function if desired. - # @param account_id [String] Account ID - # @param [Hash] opts the optional parameters - # @option opts [CreateParticipantRequest] :create_participant_request Create participant request body. - # @return [Array<(CreateParticipantResponse, Integer, Hash)>] CreateParticipantResponse data, response status code and response headers - def create_participant_with_http_info(account_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ParticipantsApi.create_participant ...' - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling ParticipantsApi.create_participant" - end - # resource path - local_var_path = '/accounts/{accountId}/participants'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_participant_request']) - - # return_type - return_type = opts[:debug_return_type] || 'CreateParticipantResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['Basic'] - - new_options = opts.merge( - :operation => :"ParticipantsApi.create_participant", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ParticipantsApi#create_participant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Delete Participant - # Delete participant by ID. - # @param account_id [String] Account ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_participant(account_id, participant_id, opts = {}) - delete_participant_with_http_info(account_id, participant_id, opts) - nil - end - - # Delete Participant - # Delete participant by ID. - # @param account_id [String] Account ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_participant_with_http_info(account_id, participant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ParticipantsApi.delete_participant ...' - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling ParticipantsApi.delete_participant" - end - # verify the required parameter 'participant_id' is set - if @api_client.config.client_side_validation && participant_id.nil? - fail ArgumentError, "Missing the required parameter 'participant_id' when calling ParticipantsApi.delete_participant" - end - # resource path - local_var_path = '/accounts/{accountId}/participants/{participantId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['Basic'] - - new_options = opts.merge( - :operation => :"ParticipantsApi.delete_participant", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ParticipantsApi#delete_participant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get Participant - # Get participant by ID. - # @param account_id [String] Account ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @return [Participant] - def get_participant(account_id, participant_id, opts = {}) - data, _status_code, _headers = get_participant_with_http_info(account_id, participant_id, opts) - data - end - - # Get Participant - # Get participant by ID. - # @param account_id [String] Account ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @return [Array<(Participant, Integer, Hash)>] Participant data, response status code and response headers - def get_participant_with_http_info(account_id, participant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ParticipantsApi.get_participant ...' - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling ParticipantsApi.get_participant" - end - # verify the required parameter 'participant_id' is set - if @api_client.config.client_side_validation && participant_id.nil? - fail ArgumentError, "Missing the required parameter 'participant_id' when calling ParticipantsApi.get_participant" - end - # resource path - local_var_path = '/accounts/{accountId}/participants/{participantId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Participant' - - # auth_names - auth_names = opts[:debug_auth_names] || ['Basic'] - - new_options = opts.merge( - :operation => :"ParticipantsApi.get_participant", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ParticipantsApi#get_participant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/lib/bandwidth-sdk/api/sessions_api.rb b/lib/bandwidth-sdk/api/sessions_api.rb deleted file mode 100644 index 6cb29610..00000000 --- a/lib/bandwidth-sdk/api/sessions_api.rb +++ /dev/null @@ -1,613 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'cgi' - -module Bandwidth - class SessionsApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Add Participant to Session - # Add a participant to a session. Subscriptions can optionally be provided as part of this call. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @option opts [Subscriptions] :subscriptions The Body describes an optional set of subscriptions to apply to the participant. Calling this endpoint with no/empty body will only add the participant to the session, and will not subscribe the Participant to any media. The request body for this endpoint is OPTIONAL and provided as a convenience to avoid additional calls to the Update Participant Subscriptions endpoint. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created - # @return [nil] - def add_participant_to_session(account_id, session_id, participant_id, opts = {}) - add_participant_to_session_with_http_info(account_id, session_id, participant_id, opts) - nil - end - - # Add Participant to Session - # Add a participant to a session. Subscriptions can optionally be provided as part of this call. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @option opts [Subscriptions] :subscriptions The Body describes an optional set of subscriptions to apply to the participant. Calling this endpoint with no/empty body will only add the participant to the session, and will not subscribe the Participant to any media. The request body for this endpoint is OPTIONAL and provided as a convenience to avoid additional calls to the Update Participant Subscriptions endpoint. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def add_participant_to_session_with_http_info(account_id, session_id, participant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SessionsApi.add_participant_to_session ...' - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.add_participant_to_session" - end - # verify the required parameter 'session_id' is set - if @api_client.config.client_side_validation && session_id.nil? - fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.add_participant_to_session" - end - # verify the required parameter 'participant_id' is set - if @api_client.config.client_side_validation && participant_id.nil? - fail ArgumentError, "Missing the required parameter 'participant_id' when calling SessionsApi.add_participant_to_session" - end - # resource path - local_var_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'subscriptions']) - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['Basic'] - - new_options = opts.merge( - :operation => :"SessionsApi.add_participant_to_session", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SessionsApi#add_participant_to_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create Session - # Create a new session. Sessions are idempotent, so relevant parameters must be set in this function if desired. - # @param account_id [String] Account ID - # @param [Hash] opts the optional parameters - # @option opts [Session] :session Create session request body. - # @return [Session] - def create_session(account_id, opts = {}) - data, _status_code, _headers = create_session_with_http_info(account_id, opts) - data - end - - # Create Session - # Create a new session. Sessions are idempotent, so relevant parameters must be set in this function if desired. - # @param account_id [String] Account ID - # @param [Hash] opts the optional parameters - # @option opts [Session] :session Create session request body. - # @return [Array<(Session, Integer, Hash)>] Session data, response status code and response headers - def create_session_with_http_info(account_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SessionsApi.create_session ...' - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.create_session" - end - # resource path - local_var_path = '/accounts/{accountId}/sessions'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'session']) - - # return_type - return_type = opts[:debug_return_type] || 'Session' - - # auth_names - auth_names = opts[:debug_auth_names] || ['Basic'] - - new_options = opts.merge( - :operation => :"SessionsApi.create_session", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SessionsApi#create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Delete Session - # Delete session by ID. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_session(account_id, session_id, opts = {}) - delete_session_with_http_info(account_id, session_id, opts) - nil - end - - # Delete Session - # Delete session by ID. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_session_with_http_info(account_id, session_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SessionsApi.delete_session ...' - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.delete_session" - end - # verify the required parameter 'session_id' is set - if @api_client.config.client_side_validation && session_id.nil? - fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.delete_session" - end - # resource path - local_var_path = '/accounts/{accountId}/sessions/{sessionId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['Basic'] - - new_options = opts.merge( - :operation => :"SessionsApi.delete_session", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SessionsApi#delete_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get Participant Subscriptions - # Get a participant's subscriptions. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @return [Subscriptions] - def get_participant_subscriptions(account_id, session_id, participant_id, opts = {}) - data, _status_code, _headers = get_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts) - data - end - - # Get Participant Subscriptions - # Get a participant's subscriptions. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @return [Array<(Subscriptions, Integer, Hash)>] Subscriptions data, response status code and response headers - def get_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SessionsApi.get_participant_subscriptions ...' - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.get_participant_subscriptions" - end - # verify the required parameter 'session_id' is set - if @api_client.config.client_side_validation && session_id.nil? - fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.get_participant_subscriptions" - end - # verify the required parameter 'participant_id' is set - if @api_client.config.client_side_validation && participant_id.nil? - fail ArgumentError, "Missing the required parameter 'participant_id' when calling SessionsApi.get_participant_subscriptions" - end - # resource path - local_var_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Subscriptions' - - # auth_names - auth_names = opts[:debug_auth_names] || ['Basic'] - - new_options = opts.merge( - :operation => :"SessionsApi.get_participant_subscriptions", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SessionsApi#get_participant_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get Session - # Get session by ID. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param [Hash] opts the optional parameters - # @return [Session] - def get_session(account_id, session_id, opts = {}) - data, _status_code, _headers = get_session_with_http_info(account_id, session_id, opts) - data - end - - # Get Session - # Get session by ID. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param [Hash] opts the optional parameters - # @return [Array<(Session, Integer, Hash)>] Session data, response status code and response headers - def get_session_with_http_info(account_id, session_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SessionsApi.get_session ...' - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.get_session" - end - # verify the required parameter 'session_id' is set - if @api_client.config.client_side_validation && session_id.nil? - fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.get_session" - end - # resource path - local_var_path = '/accounts/{accountId}/sessions/{sessionId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Session' - - # auth_names - auth_names = opts[:debug_auth_names] || ['Basic'] - - new_options = opts.merge( - :operation => :"SessionsApi.get_session", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SessionsApi#get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List Participants in Session - # List participants in a session. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param [Hash] opts the optional parameters - # @return [Array] - def list_session_participants(account_id, session_id, opts = {}) - data, _status_code, _headers = list_session_participants_with_http_info(account_id, session_id, opts) - data - end - - # List Participants in Session - # List participants in a session. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param [Hash] opts the optional parameters - # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers - def list_session_participants_with_http_info(account_id, session_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SessionsApi.list_session_participants ...' - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.list_session_participants" - end - # verify the required parameter 'session_id' is set - if @api_client.config.client_side_validation && session_id.nil? - fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.list_session_participants" - end - # resource path - local_var_path = '/accounts/{accountId}/sessions/{sessionId}/participants'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Array' - - # auth_names - auth_names = opts[:debug_auth_names] || ['Basic'] - - new_options = opts.merge( - :operation => :"SessionsApi.list_session_participants", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SessionsApi#list_session_participants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Remove Participant from Session - # Remove a participant from a session. This will automatically remove any subscriptions the participant has associated with this session. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @return [nil] - def remove_participant_from_session(account_id, session_id, participant_id, opts = {}) - remove_participant_from_session_with_http_info(account_id, session_id, participant_id, opts) - nil - end - - # Remove Participant from Session - # Remove a participant from a session. This will automatically remove any subscriptions the participant has associated with this session. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def remove_participant_from_session_with_http_info(account_id, session_id, participant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SessionsApi.remove_participant_from_session ...' - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.remove_participant_from_session" - end - # verify the required parameter 'session_id' is set - if @api_client.config.client_side_validation && session_id.nil? - fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.remove_participant_from_session" - end - # verify the required parameter 'participant_id' is set - if @api_client.config.client_side_validation && participant_id.nil? - fail ArgumentError, "Missing the required parameter 'participant_id' when calling SessionsApi.remove_participant_from_session" - end - # resource path - local_var_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['Basic'] - - new_options = opts.merge( - :operation => :"SessionsApi.remove_participant_from_session", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SessionsApi#remove_participant_from_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Update Participant Subscriptions - # Update a participant's subscriptions. This is a full update that will replace the participant's subscriptions. It allows subscription to the entire Session, a subset list of Participants in that Session, or specific media streams on any of the listed Participants. First call `getParticipantSubscriptions` if you need the current subscriptions. Calling this API with no `Subscriptions` object to remove all subscriptions. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @option opts [Subscriptions] :subscriptions The body describes the desired subscriptions for the Participant. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created - # @return [nil] - def update_participant_subscriptions(account_id, session_id, participant_id, opts = {}) - update_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts) - nil - end - - # Update Participant Subscriptions - # Update a participant's subscriptions. This is a full update that will replace the participant's subscriptions. It allows subscription to the entire Session, a subset list of Participants in that Session, or specific media streams on any of the listed Participants. First call `getParticipantSubscriptions` if you need the current subscriptions. Calling this API with no `Subscriptions` object to remove all subscriptions. - # @param account_id [String] Account ID - # @param session_id [String] Session ID - # @param participant_id [String] Participant ID - # @param [Hash] opts the optional parameters - # @option opts [Subscriptions] :subscriptions The body describes the desired subscriptions for the Participant. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SessionsApi.update_participant_subscriptions ...' - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling SessionsApi.update_participant_subscriptions" - end - # verify the required parameter 'session_id' is set - if @api_client.config.client_side_validation && session_id.nil? - fail ArgumentError, "Missing the required parameter 'session_id' when calling SessionsApi.update_participant_subscriptions" - end - # verify the required parameter 'participant_id' is set - if @api_client.config.client_side_validation && participant_id.nil? - fail ArgumentError, "Missing the required parameter 'participant_id' when calling SessionsApi.update_participant_subscriptions" - end - # resource path - local_var_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'participantId' + '}', CGI.escape(participant_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'subscriptions']) - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['Basic'] - - new_options = opts.merge( - :operation => :"SessionsApi.update_participant_subscriptions", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SessionsApi#update_participant_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/lib/bandwidth-sdk/models/create_participant_request.rb b/lib/bandwidth-sdk/models/create_participant_request.rb deleted file mode 100644 index 5a606820..00000000 --- a/lib/bandwidth-sdk/models/create_participant_request.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'date' -require 'time' - -module Bandwidth - # Create a participant request. - class CreateParticipantRequest - # Full callback url to use for notifications about this participant. - attr_accessor :callback_url - - # Defines if this participant can publish audio or video. - attr_accessor :publish_permissions - - # User defined tag to associate with the participant. - attr_accessor :tag - - attr_accessor :device_api_version - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'callback_url' => :'callbackUrl', - :'publish_permissions' => :'publishPermissions', - :'tag' => :'tag', - :'device_api_version' => :'deviceApiVersion' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'callback_url' => :'String', - :'publish_permissions' => :'Array', - :'tag' => :'String', - :'device_api_version' => :'DeviceApiVersionEnum' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'callback_url', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateParticipantRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateParticipantRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'callback_url') - self.callback_url = attributes[:'callback_url'] - end - - if attributes.key?(:'publish_permissions') - if (value = attributes[:'publish_permissions']).is_a?(Array) - self.publish_permissions = value - end - end - - if attributes.key?(:'tag') - self.tag = attributes[:'tag'] - end - - if attributes.key?(:'device_api_version') - self.device_api_version = attributes[:'device_api_version'] - else - self.device_api_version = 'V3' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Custom attribute writer method with validation - # @param [Object] publish_permissions Value to be assigned - def publish_permissions=(publish_permissions) - @publish_permissions = publish_permissions - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - callback_url == o.callback_url && - publish_permissions == o.publish_permissions && - tag == o.tag && - device_api_version == o.device_api_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [callback_url, publish_permissions, tag, device_api_version].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Bandwidth.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/bandwidth-sdk/models/create_participant_response.rb b/lib/bandwidth-sdk/models/create_participant_response.rb deleted file mode 100644 index 1042f6ae..00000000 --- a/lib/bandwidth-sdk/models/create_participant_response.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'date' -require 'time' - -module Bandwidth - # Response generated when a Participant is created. - class CreateParticipantResponse - attr_accessor :participant - - # Auth token for the returned participant. This should be passed to the participant so that they can connect to the platform. - attr_accessor :token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'participant' => :'participant', - :'token' => :'token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'participant' => :'Participant', - :'token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateParticipantResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateParticipantResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'participant') - self.participant = attributes[:'participant'] - end - - if attributes.key?(:'token') - self.token = attributes[:'token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - participant == o.participant && - token == o.token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [participant, token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Bandwidth.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/bandwidth-sdk/models/device_api_version_enum.rb b/lib/bandwidth-sdk/models/device_api_version_enum.rb deleted file mode 100644 index 3cce20a3..00000000 --- a/lib/bandwidth-sdk/models/device_api_version_enum.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'date' -require 'time' - -module Bandwidth - class DeviceApiVersionEnum - V3 = "V3".freeze - - def self.all_vars - @all_vars ||= [V3].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if DeviceApiVersionEnum.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #DeviceApiVersionEnum" - end - end -end diff --git a/lib/bandwidth-sdk/models/forbidden_request.rb b/lib/bandwidth-sdk/models/forbidden_request.rb deleted file mode 100644 index 84cdb631..00000000 --- a/lib/bandwidth-sdk/models/forbidden_request.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'date' -require 'time' - -module Bandwidth - class ForbiddenRequest - # The message containing the reason behind the request being forbidden. - attr_accessor :message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'message' => :'message' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'message' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ForbiddenRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ForbiddenRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - message == o.message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Bandwidth.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/bandwidth-sdk/models/participant.rb b/lib/bandwidth-sdk/models/participant.rb deleted file mode 100644 index b90fdb83..00000000 --- a/lib/bandwidth-sdk/models/participant.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'date' -require 'time' - -module Bandwidth - # Participant object. - class Participant - # Unique id of the participant. - attr_accessor :id - - # Full callback url to use for notifications about this participant. - attr_accessor :callback_url - - # Defines if this participant can publish audio or video. - attr_accessor :publish_permissions - - # List of session ids this participant is associated with Capped to one Upon creation of a Participant, returns as an empty array. - attr_accessor :sessions - - attr_accessor :subscriptions - - # User defined tag to associate with the participant. - attr_accessor :tag - - attr_accessor :device_api_version - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'callback_url' => :'callbackUrl', - :'publish_permissions' => :'publishPermissions', - :'sessions' => :'sessions', - :'subscriptions' => :'subscriptions', - :'tag' => :'tag', - :'device_api_version' => :'deviceApiVersion' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'callback_url' => :'String', - :'publish_permissions' => :'Array', - :'sessions' => :'Array', - :'subscriptions' => :'Subscriptions', - :'tag' => :'String', - :'device_api_version' => :'DeviceApiVersionEnum' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'callback_url', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Participant` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Participant`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'callback_url') - self.callback_url = attributes[:'callback_url'] - end - - if attributes.key?(:'publish_permissions') - if (value = attributes[:'publish_permissions']).is_a?(Array) - self.publish_permissions = value - end - end - - if attributes.key?(:'sessions') - if (value = attributes[:'sessions']).is_a?(Array) - self.sessions = value - end - end - - if attributes.key?(:'subscriptions') - self.subscriptions = attributes[:'subscriptions'] - end - - if attributes.key?(:'tag') - self.tag = attributes[:'tag'] - end - - if attributes.key?(:'device_api_version') - self.device_api_version = attributes[:'device_api_version'] - else - self.device_api_version = 'V3' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Custom attribute writer method with validation - # @param [Object] publish_permissions Value to be assigned - def publish_permissions=(publish_permissions) - @publish_permissions = publish_permissions - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - callback_url == o.callback_url && - publish_permissions == o.publish_permissions && - sessions == o.sessions && - subscriptions == o.subscriptions && - tag == o.tag && - device_api_version == o.device_api_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, callback_url, publish_permissions, sessions, subscriptions, tag, device_api_version].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Bandwidth.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/bandwidth-sdk/models/participant_subscription.rb b/lib/bandwidth-sdk/models/participant_subscription.rb deleted file mode 100644 index 7b80e54d..00000000 --- a/lib/bandwidth-sdk/models/participant_subscription.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'date' -require 'time' - -module Bandwidth - class ParticipantSubscription - # The Participant the subscriber will be subscribed to - attr_accessor :participant_id - - # (optional) An array of specific streamAliases owned by the Participant that the subscriber will be subscribed to. Background: A streamAlias is created by a WebRTC client when it connects and declares a name for the related stream. The client is responsible for informing the application of any created streamAliases to enable the application to subscribe to specific streamAliases. Subscribing to a `streamAlias` that does not exist is undefined. If the array is empty all aliases are assumed. - attr_accessor :stream_aliases - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'participant_id' => :'participantId', - :'stream_aliases' => :'streamAliases' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'participant_id' => :'String', - :'stream_aliases' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ParticipantSubscription` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ParticipantSubscription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'participant_id') - self.participant_id = attributes[:'participant_id'] - end - - if attributes.key?(:'stream_aliases') - if (value = attributes[:'stream_aliases']).is_a?(Array) - self.stream_aliases = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @participant_id.nil? - invalid_properties.push('invalid value for "participant_id", participant_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @participant_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] stream_aliases Value to be assigned - def stream_aliases=(stream_aliases) - @stream_aliases = stream_aliases - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - participant_id == o.participant_id && - stream_aliases == o.stream_aliases - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [participant_id, stream_aliases].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Bandwidth.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/bandwidth-sdk/models/publish_permissions_enum.rb b/lib/bandwidth-sdk/models/publish_permissions_enum.rb deleted file mode 100644 index 4f4b93de..00000000 --- a/lib/bandwidth-sdk/models/publish_permissions_enum.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'date' -require 'time' - -module Bandwidth - class PublishPermissionsEnum - AUDIO = "AUDIO".freeze - VIDEO = "VIDEO".freeze - - def self.all_vars - @all_vars ||= [AUDIO, VIDEO].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if PublishPermissionsEnum.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #PublishPermissionsEnum" - end - end -end diff --git a/lib/bandwidth-sdk/models/request_error.rb b/lib/bandwidth-sdk/models/request_error.rb deleted file mode 100644 index ce341b5d..00000000 --- a/lib/bandwidth-sdk/models/request_error.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'date' -require 'time' - -module Bandwidth - class RequestError - # A message describing the error with your request. - attr_accessor :error - - # The associated requestId from AWS. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error' => :'error', - :'request_id' => :'requestId' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::RequestError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RequestError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error == o.error && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Bandwidth.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/bandwidth-sdk/models/session.rb b/lib/bandwidth-sdk/models/session.rb deleted file mode 100644 index f6c44bfd..00000000 --- a/lib/bandwidth-sdk/models/session.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'date' -require 'time' - -module Bandwidth - # Session object. - class Session - # Unique id of the session. - attr_accessor :id - - # User defined tag to associate with the session. - attr_accessor :tag - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'tag' => :'tag' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'tag' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Session` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Session`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'tag') - self.tag = attributes[:'tag'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - tag == o.tag - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, tag].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Bandwidth.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/bandwidth-sdk/models/subscriptions.rb b/lib/bandwidth-sdk/models/subscriptions.rb deleted file mode 100644 index 21831aa8..00000000 --- a/lib/bandwidth-sdk/models/subscriptions.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'date' -require 'time' - -module Bandwidth - class Subscriptions - # If present, and not overridden by the array of participants, it represents the session the subscriptions are associated with. If this is the only field, the subscriber will be subscribed to all participants in the session (including any participants that are later added to the session). Upon creation of a Participant, returns as an empty object. - attr_accessor :session_id - - # (optional) A list of participants in the session that will be subscribed to. If present and not empty or null, this will override any sessionId specified in the body. Returns empty if used during the creation of a Participant. - attr_accessor :participants - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session_id' => :'sessionId', - :'participants' => :'participants' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session_id' => :'String', - :'participants' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Subscriptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Subscriptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'participants') - if (value = attributes[:'participants']).is_a?(Array) - self.participants = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_id == o.session_id && - participants == o.participants - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session_id, participants].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Bandwidth.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/bandwidth-sdk/models/unauthorized_request.rb b/lib/bandwidth-sdk/models/unauthorized_request.rb deleted file mode 100644 index 563f9f91..00000000 --- a/lib/bandwidth-sdk/models/unauthorized_request.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.2.0 - -=end - -require 'date' -require 'time' - -module Bandwidth - class UnauthorizedRequest - # Unauthorized - attr_accessor :message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'message' => :'message' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'message' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::UnauthorizedRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::UnauthorizedRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - message == o.message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Bandwidth.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end From 2ba210e079c93562a94d33d6ecde771cdc8d805f Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Thu, 23 Feb 2023 09:52:59 -0500 Subject: [PATCH 06/30] Small changes to clean up repo for beta release (#74) --- .gitkeep | 4 ---- LICENSE | 28 ---------------------------- openapitools.json | 7 ------- ruby-notes.md | 7 ------- 4 files changed, 46 deletions(-) delete mode 100644 .gitkeep delete mode 100644 LICENSE delete mode 100644 openapitools.json diff --git a/.gitkeep b/.gitkeep deleted file mode 100644 index 7804e232..00000000 --- a/.gitkeep +++ /dev/null @@ -1,4 +0,0 @@ -README.md -lib/bandwidth/voice_lib/bxml/* -lib/bandwidth/web_rtc_lib/utils/* -test/integration/* diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 749af7fb..00000000 --- a/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -License: -======== -The MIT License (MIT) -http://opensource.org/licenses/MIT - -Copyright (c) 2014 - 2020 APIMATIC Limited - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Trade Mark: -========== -APIMATIC is a trade mark for APIMATIC Limited \ No newline at end of file diff --git a/openapitools.json b/openapitools.json deleted file mode 100644 index 7f8d0939..00000000 --- a/openapitools.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", - "spaces": 2, - "generator-cli": { - "version": "6.2.0" - } -} diff --git a/ruby-notes.md b/ruby-notes.md index 95501dbc..e24fe863 100644 --- a/ruby-notes.md +++ b/ruby-notes.md @@ -52,13 +52,6 @@ messaging_client.create_message(account_id, body) # OpenApiGenerator Quirks -* The Get Messages function defaults its return type to 'File', this downloads a temporary file that must be written to the disk to be accessed. - * Adding `debug_return_type: 'String'` to the function arguments overrides this and saves the file data as a string. -* All of the files in `openapi_client.rb` needed their `require` to be changed to `require_relative`. -* Using the configs default HTTP client, typhoeus, generates libcurl issues on Windows Machines. -* Switching to Farady for the HTTP client fixes the libcurl issue, but the SDK uses a deprecated form of Faraday's `basic_auth`. This looks like its fixed in a PR on their repo, but its not in prod yet. Changing `conn.basic_auth(config.username, config.password)` to `conn.request(:basic_auth, config.username, config.password)` in `api_client.rb` line 59 is the fix. -* The sdk generator writes code in the gemspec file that cannot be run in Windows, resulting in an empty gem if used. - * `s.files = Dir['./**/*']` and `s.test_files = Dir['spec/*']` fixes this * To get a custom url, instead of setting the `environment` parameter in the config, you must make a custom operation in `configuration.rb` ``` ruby "Pipedream": [ From ff948651188a5a85f65ea3790ba78a50fd29170b Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Fri, 24 Feb 2023 11:27:17 -0500 Subject: [PATCH 07/30] DX-2940 Messaging Integration Tests (#67) * DX-2940 Messaging Integration Tests * remove ssl_verify * switch to 1 set of 4xx tests * set config once * assert response objects --- .../messages_api_integration_spec.rb | 83 +++++++++++++++++-- 1 file changed, 76 insertions(+), 7 deletions(-) diff --git a/spec/integration/messages_api_integration_spec.rb b/spec/integration/messages_api_integration_spec.rb index 13243004..f5f9882b 100644 --- a/spec/integration/messages_api_integration_spec.rb +++ b/spec/integration/messages_api_integration_spec.rb @@ -4,25 +4,94 @@ # Integration Tests for Bandwidth::MessagesApi describe 'MessagesApi Integration Tests' do before(:all) do - @api_instance_msg = Bandwidth::MessagesApi.new() - end - - before do Bandwidth.configure do |config| config.username = BW_USERNAME config.password = BW_PASSWORD - #config.ssl_verify = false # remove for testing on push end + @api_instance_msg = Bandwidth::MessagesApi.new() end # Create Message describe 'create_message' do - + it 'creates an mms message' do + message_text = "ruby sdk test MMS" + body = Bandwidth::MessageRequest.new( + application_id: BW_MESSAGING_APPLICATION_ID, + to: [USER_NUMBER], + from: BW_NUMBER, + text: message_text, + media: ["https://cdn2.thecatapi.com/images/MTY3ODIyMQ.jpg"] + ) + response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) + + expect(response[CODE]).to eq(202) + expect(response[DATA]).to be_a(Bandwidth::Message) + expect(response[DATA].id.length).to eq(29) + expect(response[DATA].owner).to eq(BW_NUMBER) + expect(response[DATA].from).to eq(BW_NUMBER) + expect(response[DATA].to).to eq([USER_NUMBER]) + expect(response[DATA].tag).to eq(body.tag) + expect(response[DATA].media).to eq(body.media) + expect(response[DATA].text).to eq(message_text) + end end # List Messages describe 'list_messages' do - + it 'lists messages' do + get_opts = { + :source_tn => BW_NUMBER, + :message_direction => "OUTBOUND" + } + response = @api_instance_msg.list_messages_with_http_info(BW_ACCOUNT_ID, get_opts) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_a(Bandwidth::MessagesList) + expect(response[DATA].messages[0]).to be_a(Bandwidth::ListMessageItem) + expect(response[DATA].messages[0].account_id).to eq(BW_ACCOUNT_ID) + expect(response[DATA].messages[0].message_direction).to eq("OUTBOUND") + expect(response[DATA].messages[0].source_tn).to eq(BW_NUMBER) + end end + # HTTP 4XX Errors + describe 'http error' do + it 'causes a 400 error' do + body = Bandwidth::MessageRequest.new( + application_id: BW_MESSAGING_APPLICATION_ID, + to: ["+1invalid"], + from: BW_NUMBER, + text: "ruby sdk 400 test" + ) + + expect { + $response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) + }.to raise_error { |e| + expect(e).to be_a(Bandwidth::ApiError) + expect(e.code).to eq(400) + } + end + + it 'causes a 401 error' do + Bandwidth.configure do |config| + config.username = 'bad_username' + config.password = 'bad_password' + end + + body = Bandwidth::MessageRequest.new( + application_id: BW_MESSAGING_APPLICATION_ID, + to: [USER_NUMBER], + from: BW_NUMBER, + text: "ruby sdk 401 test" + ) + + expect { + $response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) + }.to raise_error { |e| + expect(e).to be_a(Bandwidth::ApiError) + expect(e.code).to eq(401) + } + end + end + end From dc7761187a970f5ef3bdf68e00d86a8dd4b5c5a4 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Fri, 24 Feb 2023 11:27:31 -0500 Subject: [PATCH 08/30] DX-2941 MFA Integration Tests (#68) * DX-2941 MFA Integration Tests * 4xx * finish mfa tests * undo changes to test.rb * standardize response name * assert response objects --- spec/integration/mfa_api_integration_spec.rb | 105 ++++++++++++++++--- 1 file changed, 89 insertions(+), 16 deletions(-) diff --git a/spec/integration/mfa_api_integration_spec.rb b/spec/integration/mfa_api_integration_spec.rb index ee9af92f..8a0004fd 100644 --- a/spec/integration/mfa_api_integration_spec.rb +++ b/spec/integration/mfa_api_integration_spec.rb @@ -3,33 +3,106 @@ # Integration Tests for Bandwidth::MFAApi describe 'MFAApi Integration Tests' do - before do - # run before each test - @api_instance = Bandwidth::MFAApi.new - end - - after do - # run after each test + before(:all) do + Bandwidth.configure do |config| + config.username = BW_USERNAME + config.password = BW_PASSWORD + end + @api_instance_mfa = Bandwidth::MFAApi.new end # Messaging Authentication Code - describe 'generate_messaging_code test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe 'generate_messaging_code' do + it 'generates messaging mfa code' do + req_schema = Bandwidth::CodeRequest.new( + to: USER_NUMBER, + from: BW_NUMBER, + application_id: BW_MESSAGING_APPLICATION_ID, + message: "Your temporary {NAME} {SCOPE} code is: {CODE}", + digits: 6 + ) + response = @api_instance_mfa.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_a(Bandwidth::MessagingCodeResponse) + expect(response[DATA].message_id.length).to eq(29) end end # Voice Authentication Code - describe 'generate_voice_code test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe 'generate_voice_code' do + it 'generates voice mfa code' do + req_schema = Bandwidth::CodeRequest.new( + to: USER_NUMBER, + from: BW_NUMBER, + application_id: BW_VOICE_APPLICATION_ID, + message: "Your temporary {NAME} {SCOPE} code is: {CODE}", + digits: 6 + ) + response = @api_instance_mfa.generate_voice_code_with_http_info(BW_ACCOUNT_ID, req_schema) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_a(Bandwidth::VoiceCodeResponse) + expect(response[DATA].call_id.length).to eq(47) end end # Verify Authentication Code - describe 'verify_code test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe 'verify_code' do + it 'verifies mfa code' do + req_schema = Bandwidth::VerifyCodeRequest.new( + to: "+1000" + rand(1...10000000).to_s, + scope: "2FA", + expiration_time_in_minutes: 3, + code: "12345" + ) + response = @api_instance_mfa.verify_code_with_http_info(BW_ACCOUNT_ID, req_schema) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_a(Bandwidth::VerifyCodeResponse) + expect(response[DATA].valid).to be_a(FalseClass) + end + end + + # HTTP 4XX Errors + describe 'http error' do + it 'causes a 400 error' do + req_schema = Bandwidth::CodeRequest.new( + to: USER_NUMBER, + from: BW_NUMBER, + application_id: "not_an_application_id", + message: "Your temporary {NAME} {SCOPE} code is: {CODE}", + digits: 6 + ) + + expect { + response = @api_instance_mfa.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) + }.to raise_error { |e| + expect(e).to be_a(Bandwidth::ApiError) + expect(e.code).to eq(400) + } + end + + it 'causes a 403 error' do + Bandwidth.configure do |config| + config.username = 'bad_username' + config.password = 'bad_password' + end + + req_schema = Bandwidth::CodeRequest.new( + to: USER_NUMBER, + from: BW_NUMBER, + application_id: BW_MESSAGING_APPLICATION_ID, + message: "Your temporary {NAME} {SCOPE} code is: {CODE}", + digits: 6 + ) + + expect { + response = @api_instance_mfa.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) + }.to raise_error { |e| + expect(e).to be_a(Bandwidth::ApiError) + expect(e.code).to eq(403) + } end end From f6e4ee8a3e21431c1f27b637f4bd0fd2a5c1d8db Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Fri, 24 Feb 2023 11:33:26 -0500 Subject: [PATCH 09/30] DX-2942 TN Lookup Integration Tests (#69) * DX-2942 TN Lookup Integration Tests * remove unused after block * update comment * remove unused variable * separate tests * assert response objects --- ...hone_number_lookup_api_integration_spec.rb | 89 ++++++++++++++++--- 1 file changed, 76 insertions(+), 13 deletions(-) diff --git a/spec/integration/phone_number_lookup_api_integration_spec.rb b/spec/integration/phone_number_lookup_api_integration_spec.rb index 088c89a0..dc2949de 100644 --- a/spec/integration/phone_number_lookup_api_integration_spec.rb +++ b/spec/integration/phone_number_lookup_api_integration_spec.rb @@ -3,26 +3,89 @@ # Integration Tests for Bandwidth::PhoneNumberLookupApi describe 'PhoneNumberLookupApi Integration Tests' do - before do - # run before each test - @api_instance = Bandwidth::PhoneNumberLookupApi.new + before(:all) do + Bandwidth.configure do |config| + config.username = BW_USERNAME + config.password = BW_PASSWORD + end + @api_instance_tnlookup = Bandwidth::PhoneNumberLookupApi.new + $lookup_request_id = "" end - after do - # run after each test + # Create Lookup + describe 'create_lookup' do + it 'creates a tn lookup request' do + tn_body = Bandwidth::LookupRequest.new( + tns: [BW_NUMBER] + ) + response = @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body) + + expect(response[CODE]).to eq(202) + expect(response[DATA]).to be_a(Bandwidth::CreateLookupResponse) + expect(response[DATA].request_id.length).to eq(36) + expect(response[DATA].status).to be_a(String) + + $lookup_request_id = response[DATA].request_id + sleep(1) + end end - # Create Lookup - describe 'create_lookup test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # Get Lookup Status + describe 'get_lookup_status' do + it 'gets lookup status' do + response = @api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, $lookup_request_id) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_a(Bandwidth::LookupStatus) + expect(response[DATA].request_id).to eq($lookup_request_id) + expect(response[DATA].status).to be_a(String) + expect(response[DATA].result[0].response_code).to be_a(Integer) + expect(response[DATA].result[0].e_164_format).to eq(BW_NUMBER) end end - # Get Lookup Request Status - describe 'get_lookup_status test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # HTTP 4XX Errors + describe 'http error' do + it 'causes a 400 error' do + tn_body_bad = Bandwidth::LookupRequest.new( + tns: ["+1invalid"] + ) + + expect { + @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body_bad) + }.to raise_error { |e| + expect(e).to be_a(Bandwidth::ApiError) + expect(e.code).to eq(400) + } + end + + it 'causes a 404 error' do + req_id_dne = "12345678-abcd-cdef-9876-12345678abcd" + + expect { + @api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, req_id_dne) + }.to raise_error { |e| + expect(e).to be_a(Bandwidth::ApiError) + expect(e.code).to eq(404) + } + end + + it 'causes a 401 error' do + Bandwidth.configure do |config| + config.username = 'bad_username' + config.password = 'bad_password' + end + + tn_body = Bandwidth::LookupRequest.new( + tns: [BW_NUMBER] + ) + + expect { + @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body) + }.to raise_error { |e| + expect(e).to be_a(Bandwidth::ApiError) + expect(e.code).to eq(401) + } end end From c65595b1051956327825cce52e869f450134a48a Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Tue, 28 Feb 2023 13:59:36 -0500 Subject: [PATCH 10/30] DX-2938 Media Integration Tests (#70) * DX-2938 Media Integration Tests * upload and list tests * happy path * add attr_accessor for return_binary_data * add 404 * remove unused after block * update with comment from my parent project PR * remove unused files * assert response object * use stricter asserts --- lib/bandwidth-sdk/configuration.rb | 5 + spec/fixtures/ruby_cat.jpeg | Bin 0 -> 32103 bytes .../integration/media_api_integration_spec.rb | 85 ++++-- spec/test.rb | 280 ------------------ spec/unit/api_client_spec.rb | 188 ------------ spec/unit/configuration_spec.rb | 42 --- 6 files changed, 69 insertions(+), 531 deletions(-) create mode 100644 spec/fixtures/ruby_cat.jpeg delete mode 100644 spec/test.rb delete mode 100644 spec/unit/api_client_spec.rb delete mode 100644 spec/unit/configuration_spec.rb diff --git a/lib/bandwidth-sdk/configuration.rb b/lib/bandwidth-sdk/configuration.rb index df58957b..acd84420 100644 --- a/lib/bandwidth-sdk/configuration.rb +++ b/lib/bandwidth-sdk/configuration.rb @@ -67,6 +67,11 @@ class Configuration # @return [Proc] attr_accessor :access_token_getter + # Set this to return data as binary instead of downloading a temp file. When enabled (set to true) + # HTTP responses with return type `File` will be returned as a stream of binary data. + # Default to false. + attr_accessor :return_binary_data + # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response # details will be logged with `logger.debug` (see the `logger` attribute). # Default to false. diff --git a/spec/fixtures/ruby_cat.jpeg b/spec/fixtures/ruby_cat.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..d08a926ed0f856dafa7a0832d3195c147459aa3d GIT binary patch literal 32103 zcmb5UWmH^G@GUyH1b2eFh6Hzq!QCelg3I9U5=d}&cN^Rt0>Nc)hv4o(5}eELfA4+k zy^pU>f2-4{`_$@HyY{YrU3%RF;3xtWfB-l+008do0lcmPqyY%<@c)fBLwp-Zs7OeN zh)C!tD9ET7=olF9(BHko#KObD#KOgT_YQ{$2N$1!kdP1qo0x=%fCP_#kl??Mz#+WN zK}14BLP8_Je1}Q!|Jz=F0dP^_6ya_V;AjExxNr!#aIgIUG5`P`0q(!;{$GPf0Kg$4 zA)~xG-@^g^^Zmb^066%!A3%Ox0bn4&0pM{EaNg!$Ew9Bg{SLu0u?k8Y#uiF8fm3%4 zxox8mi~3_epGv`@z$;<2UumDbH=9w%$qH4-*!wl@-^u0}uQ*v_CIE{a!@= z;G)k0anCU^jM+3-;TB5f)#cZyX&5;Dqo;`U#{|{cRq&p7@3=(%vr7R%+YwFp)&rNl zg(gio{!)r%K2nf2aurvATzdDBAgHV&89%=r`VOi{Gg7Ij?UF2HW3TfWF>yZB!mUFp zyU)W_{do5sHP8MRK`17zsi1!tS~{L%{VU(c=_Q6YM!-i(=>Bat;9&f8f` z%N79zRu6{5od?cO!Wk8aIW`s^NI`%$JOGmk>T+P-Ok*2ixB|H)k+7lf z?X*hqiNB@$6bQ%awl}}0`gh6?b)1x>_gQ(iMm$w z3JRmRU6F|65y^MF`^(&10Gj3W*!-M)S9a`7rFQzg;cScflwG{jM^*Z_mC!Kd$CBwd zG6GDamv;U5pgFGSplqhxP^M@4teF6s8M^Cc8{O{>xkcY1 zReSo~WF_J_7lo7vJ=4+XLjX3Dm8|;@iZ%G=iOA_X-MV^E&Z|9p-Hqsbi+&bZ=X9+tfnq{^)(LAhE z9qmrjbz=UJcqI}kW%EV=#P<^UhqKxJ{Oq!i4!O~OzTX#4AH1OHZcI$E(6J+s-Td{T zW|c6klp8k}=%00EIh|XZB&}E!t(~GIv{qfp>qb)IHLD0Y|73LN;(eGMpDhB5NKXH< zK)G8HoFI{qr&Nv$8Z32>F_(4CO)TaeGf%tH2bIIWm(JAn`(*tAs`B(4OVLIGmDpq_ z+wIin!*f2~TgEIgXgsj6U2$=v3bLy7rw{`}3)l!KN;#rkUkImRiYk2i4V4 z7uWI)pR>R@Kj~@*82*_#E5<~Fcm5WCK}?}d(#EmZY;z3(t*f}V{?>pDtn_;Q(VMPx z-&d3FH00~5I1xuH+&K4o>i18Jh|P-a+#lKJu>oR4y?f7A5$aA~R$cuif5e8vPO!ZJ zmTIV49~i29tmx!ut9*3z;CZw-ohg@ch-vTa?7ddqhnUzwm!R!hl;uC)8`d5)o$%~L zX<2%6UVQa*F!K=Ow*xEvz>=sQ^`2m%)TmeJ0kn_Pl1jVomwXWTsH6|Li%~Vag?Wi| zk2pV>bahEz+WhPN*c;nAknMT%?_OZzBj31B7SIx*F4p_r2?@P2loTZwa4>jwp? ztI1upk8daI7sF_wr?&Z(bo^XmZ6|>*#4aRzU05_IHXccyU4-bznC~%3>_2EVgt*>X z;$>{#$L7&~9k2Bx`(~L`y~2}Y&SQn@$d(@pbX%Gq_P{^Hf>U_f-#_F=uvD(*L(!M; z66Kqziu&i(@Ri@S^FT}0KbY909%K2a5-DpXPuSDv?vI(FtU*VX{f|YfE7P-A&wTBE0ZhwfXNL#Pb?&0*awI}eYyZl}T`cmnzToZDey(i` zy7E;kyq4RnfU>x#&DI)%JG`8IkGd5mu!3v{D232tg3KK*CLQo+PO76UbI)8Fsw3|o z7lhVAwL9qQ+WaTnW!xGrVU?tQXmi)1Uq9Mp-T#BH1iu0lh9(V>iw`mnf3lgZDNT__ zbr=5d`dQcy5w*V%Y*Fsu{SNK`!4Zz%81wgX>iXEgys~!eqiH9L@OFvL@TOu8PjYi% zN53=w@SfJ-|1$e`Qg|SF^7InIytLT7QsPh@^^3t`tjRzFf-K;|T^l5_oY8H+#sbYS z;!d3XwV_qcG7c=Mu)TKuSy5s;GJqsz9xr|`h!^g*eG>@6a2IZ(4O|J&4|*GtaY;BCrUYYIe{c^1Y3 zo0K}NU|{MHv1$h=7i>nB&gcwY=QIp4KI=zSvCYtM|I85{u^+wQUfD4SKZ%AIyqnT& z*D9rRkD6h$nt*+7%Vv#{!!F#X`>In)cEJ(+G@i{LE|=4s@0OHk5IuX*fh)7mhDcKP5wKGowz+1-^~hooi+J2R@AHAn{iR( z?+n-bnh&JL3Y@Mb-x>J03R$b=RFrDVX>o9m%Bo~woc+R*6GUPm@op-J!phbQkqt>f ze2GO}cze+$qe||_|We^C?SKi)vZ$*ED8Lglgo&at$b!KAT z+^qlJZU!eXjYeQaBO_G~ABkhmj9YT0#j~KU=G*svsj?ua@Ry@)x(P^%)=hy8uhUNz%V1#%c_hCKD$ zX%tb%xRk4k{DTT+QalQ}HCB-pg<`NdA^}1m6Da^VmGBWD%U1~&m`Mw%GE`zDuTY3q zg6K=Bd{KN?QM6k|sEHJ(&sPSj4J@BCN|SCJoai-qz_V-qL7J?%!}6{Kqb`Icuu&%8 zD%y24-|-Nc+(@dZ5OKGSx=i^!I*Y7Qbin_u;s6M5wI9vbf6~e$n!m*VNt%x;3=~FG zCS_oGYc$rAd{-vt3;VSCGd&~XI9~n%4K8V)x_A~gLbZXkk|mZ{`ZcuKr?Y`0SQ$|# zJ61DL5zknOOjh)ed^L&o$16aYNb_9<;#Lz7&ZJ!a=)<)GhiIoXi1-GW?+tf(_EM1F zGu{zC=6+r)ZbCxxV?`H3;HUZDbc{h|)y97GT-Dn4mK2GZPGT~%c|^`-wMiBuY=U$z zbedpG;pck_%~*M;L$b)Xv?e@@psBNe5;&u}g?YBs&Cu>pl&8e3eP{fQuH;kHKT1Kx zs6s3TpMZ+YIqVIMsRdh?zRi`TwG{ou*3@5T86}xJhLe0W4qLeN*0n!1J!9)9^d9ym z!+^QEPg~D8kiKgZpVR|X z-+Lu?Py~(Rm(Fn@K5@H+EVv>#PWS-YMsF42{6xobw#{J9=N;FzWwv4shsNIDU+tmpW=xem$2#vMEnSJv6{hCsb4S z))m4S742NwXMi6+b~HDSEbv>CXprc6S5kbc#K;+9piSBkI0g@q;4jutBE2@&ai!2{ zm%GqGQ#xdO;Mlbrd{EV^i^68FcVzU0mu-mXvr?OV4ik;ZY8Srs`cZcqOT<@7@X@-% z;t?ay?)M{$4_Rjyl64n$Pm1+tlJlJgJ?P)hA-4q|j+8BFeuC@5DnItc^@;P-$1`l0S8ZWtx_N9_AMf_5m+yKQLP~ z?uSJS88lwiYP38$xzx0!!oLDq2c4**m<#V-sDqX77ZCPXbtag9oU%I{g8cMDHAuTK zXXoff%%3EKu1d1+m*Z7=BOLy6u=8qnmKAHBA9Q`+%P(KzF>57IsvKF;6hr5WNnHJf zQ-_=>XJ&s8d{aTm=K~@}8YFbXJOie>k~wbc; zL-oHM^F?Pq-hEF`!k6~Pg4fUJvhO$uHG=#3uK<-!jlhB6Y-dsj&PRD*7;4_t?uEb8 zVAGJ4;}krLyJ_PW{Koj$Z~^de|It(c9Mb>ceQ%5pmj)4!6A6b)5}#IsfR0;A)0p1r z?a-jY!Nb9c17`cPr?TgV!ck+9?;~ATU(%$MU^aDq51_M-&g|A0HsFhrPPQSUl+v}XF2XVHH_&ydfCs-*=B6I5`issw;G-z9GGW3 z<2TzV2uyoL>Gnn9r(x#FLas&UT1RJGu33(1h(x4ySM0*LG3ZJd{xZG_{WZGU-NRL{ zfP$PW$i%oiaM$|xDhpdi0HR#N&hGIT*1#E8>QTYCJdwqNZK4K+{7Xd9#}t-9HH-=@ zkXeRv1G!fnStQ4v7`jHiS&DoOl-}mcWi-!)=ld{$IeKojU3K~V%^%CzdIJepESFXr zbEPYv?FE4%oIpH6f&2l<&2}dS>|-+f^hOQpT8&Hkdd)GsI|T9K9iXg~EGaONNWq|Hw$m4=<47|`O>1aszYQrk{+L28Y9 zSy>CsfMT7$ZBTg!YZgK05%>Ik>#p|!a709^rBsEi70RK7#Vazjtzxv;D;xu~|LE9= zrOQ%CX4Weevy;NvxY!F`0gA(=O3u5<1Su+D+hq3p%=R6`Usi|7nvEF9ZYLdi<7<5teq<`9{$NLne|YK74xM43!oO>>)_$Z@3$gyP&G9V# zXi@t3U6g|JIgHl~b{MUpGhD%UsudALm#6_PE-Jm!VY!8HLrJtFW6n7k+<6jvX7)15 zom>-R>9WJ-)Z!;u3OS;Jt9y)FyS2|ak zqNOSj-$Y=EjtVW0nii~)ajv#+uig8$8`06hc1%-RbgVR8a2zm}G9tC{y|Crmd_!Y> z_{zxog^Lq}FLYo6*>oSeLf}#}&_aO#4PWLL8 zu!;%yXiK`YbPANpwuim%^>f;bQb>hv$-0IYau1sbiSdZq>;HcEqN;!EBA(7Abd)eZ z@3I?HUh_z3qo~B5l-{a25a!YF%>G=@-=?Z6Ho2?HF_KWjf0}IYl1snA?wov&XR4h1 zcXy{*iElVxn07mpJbGNqG_kD%H7Pq>^;cSvL;RJpO8%O1sKWzzx3-N4XZKuTt#y}i zI*8qT+Qq5$_Z^c3*fuR}cegg@TxH>-GuFT(AB(;weg}CdP1vgQ;Iy+KF$cJ{qZ`># zHr}>_R%{Aq1Xa1)M{yz5sG_V*2GSl^Ha9u5%>@l6>0 ze~<JjW~ec{44liiMrgcveb;cvy*e$S5l!zE-EK*t1hQ!cP17%Qi_ zBDbk_qkOr3jm=NN;*huxBK-m->UxB<3tNgieFYff1R&mdFGwY;gLho@vHA z22EW21;x2#9>BXLX*3zHzl!=mukaK~(>N_?Q05z1sMUWO+&zT3hI1!GO#6qo_usbS z5N(X<4Y}AK*Zsta?6l#?1C@xU{bmfk}DNQ%hP6{!|DE4;1S)LZPGtS@kmZJ_xDmM zbMZfeJ&2SV^qhtx8zGx}9H`p~yFpIibi$!v)s2m?8>PaFKJdGeaCf;vCf{VWAiwv? zlSmDAerWy?eECHRi&jGw8Zj%BGBXwzgVAf)i3U^&@zLkJ5xIyYk95Rg3-$~pvQHLmGAf+im}-n1n6_=Aqcm5#a=|aC zUlI;e{h8?euylt>(RXuY9?hxvmzCXx8BCoN(**~`BbgGof21*{$b{|xa98>qAv!!( z(f<(tG%Q^xX0=Cirqs+p(oIUr2%L}!cMe@zj*pSbWn}72>~CjU{XoS2z1TOs$@5aq zbvbik_hK~`S;fCp3pV{zSa(;-E3d-oCzDUxr_Hh4u+imQ$xLi6B0+}XmV8+8D8W4L z=%K-yT!j-+!(VAowtmAeE5C#-{N#F#I@v;OpnN%NxU1?%r?X*4B06?=S=ddqs==|v z-p70s1rnZRUc6;2;?q~aL~2VrUOVHth#$$HNm@}h?&*E4gv~_=9W<(xcZh(QMPZs< zg)i<8s3hE2Qvt8%p1}zy_yUVioQ}jj8x_UPN;NAr9fC~d_tu6YxOa-F|1mf%Fwi{w zm;C-2s9d*-)O)t#Dp1bj9k!Wi=lG^kYz3=>8|Xf_a>522El0CB#=Xo182m_z5*pmD z1X!FE(J((WoAqZ|B|tSfM>QB5-B0$)bUUM3ltr|B6#Q z#KJA_6mgGYgOp+|yBtPXDGH_j0%bM=}t1IS#$^ZD16Xe!){Z ziXj?`X`|%*%Q8mLO*=m@lry+4|74J?$o5U?SVr5d3X^G>xuh(FfxXdmmY+jyyO0q> z)7Mc1|7+NSezp2FIKyhAbuI4V(D^yTwt`?Ty%JUwfmX-lzl6eKtlHzU4aQWq% zD?8hZqRHvDt?k0*KA(W|fdw4SkzVz15LQXkH zT<=|@D{kbJKGs=hy9ba`79Pz8dl|7Pibi}c|GrcROB(A~<8S$HI=XYi(jumMZ?c_M z(j8?D1Gn?yHhiSOnO7tii=Ix@8g|o{mhdiOnC%M1*s?n=|g0qAq>}?PT1WC%<>IPNnW@vyRQuav`5e z!jBwZ0nk`PqdVXzaMl_)le*kYm4C)%7UfyUrRB~}vf(7-dbfBh<7oN{(Dw0Myaf(C zh|!uTj6OX_ga=$cGUq#OD;0hZmqlkCaeLwF_)sw3nQ5z$&nCn=*osGBt6?z{`rh3S zqx_Gu69Hz#8JQfMM3U`_9pAJ}#vhJwg6|PEXn2QFGG$>;b@`sF+tH2moiz8Up<6dx zKL=%G=mlzctxVYZq`;o5d-<<`&^O$X!}*Wlz$5-|gGWR9ucZY*#6_Y(#^d~t;25KD zIejCbi_b?Tl&a&_H0i}5a-OEYB<7Kp2}&r~`h%twTtD+ap!C+@69=TPCX!z0RgQ6c zYYI|4H6i*QD!gR>_`>G7=ZJ;GF^+zwTRlk2t-^*dcUypk{Ml5qp&WPaZ|QQ3wf;F# zBe8L%43{KjvWxI5;6vK(L8|Z~k*ax+IG=B6lMEMsW!9OdAQLa07s^bL@WCoURX39C zIJpBT+~J+eLR7Jt@r4HeCzzq&#+sd)v#w-(Mso)#i9lKDXhh6o+*$6zk4rZ|VlL!Q z=P0tHsEx|?x9sw%z;wzagLbp+r23fB+ah<8$r^8k&xrU^KrwKZTUmOrS=K=vp|?KJ zN|0C%Dp)Z@BTs>LqBogFKLWD}c$l55`lcziRAl0#nad!q=o0d%ZOO{^Lyhf&V`EVP z=0A$^iQP1bktI8=;m>{xH4F~d@8^{W>`n|x-396FgNlbft<6_(b8zb^4vOGMx1(Ey z_{`OtrsdAml#Ih-Az^Ij^~`bRgP4ZNPrBL~zMsy{bU%!DH}<$-+?4v-X%0L3Ica?w zv}S}?{aIyw<>~R~)5+P_2(Bd|tP-)?{;^Cql3u`^9~8?wdw`-BCcjLLo@6O}0p2e# zF>E5`M!l`H_}V3V$hzxA;x+)$y89T!c~i!VKVF#jO}9O855OsQ%kYn7DF`xg+KM9l z3?a|LV^fflSS^-(d4FK4Pd`N;lcc&t5arZ5z|u>3ONJ+;bDR?C`|U&(eyy8J-6bB7sYtJIL^iFeSNBt!UjRT3jq1i1FA|?Y;T{;MulB+UuJ>q zi@Q-}fWxsvmtXPuJJH9SKW7=+Y=L$HGbw+ z&-)L=J!r<6iG$=2$>;mbZSiuNHxQOWR zm091psq!^Be3&b8hhi%pz;}KLxw$ga5*UzL9)fH|c?PxW426VJ&X@9;td}TPKW>+R zFV>sB-TObEgb^U~3W_}Qiyp(;BnBTHGFpvHzZ$D{!m=!?2|5HPKTUpB>>M3`Sx=^4 zn_=YEQr28X6M&XrWAiyhAO7S-S>-kAO_nc8O+=um)0*5P(+hK&DW%kut8yW16n$BZrgJYwx*pj7 zJsL_84#12SCbwt3fj>yI%ZMOZqX=F9iAE~jrDh`7St@K&Q0KV>2SUX90c2B9mA{Ue zYrBU6Jt&y7pv5Q-iozJTMZV8|$1I$y#b9wBddhj{p+6rMYE<`Yu;}dXs;NoaO#eZ( zNTErw-eRrQzBP&m59;Jg1ciutn6@Y9Hb1_O7SF1n$VKE;w9TKeA9V|!W}A_h2na-`gM{5Hb}u)h9D+Aya&6pE z9Q7bkdy>4?ocbX`7M;q0Z>JlL;8@Eq#Ls$vfApZ38dL10iHbQzL?>zE?h|L6Ug=5` zHw+B`C%@~SpWvgFqch}953lB;$>(yko@MGZ6F(_fQ8MbIMKvxwXSYuRefjD=hsI^M zD0)mo=lZ40Gok~Eu+pi!e;p*&WIsBCS$769FCafBO!V2*d+WHY)I`JjUgO=X;U&YK7*vgl`_^7eI^;i?|qIipPL1A$T+jhy-WM&7aNf z(ELIY81B(RB6X1Jd|!vMC^wkZxeVKTR(@~EbwK`mR!mN^P#|_$mAPbW*=gF7eYx3x)d=+)eC(Zak-0P8kA%ytL6U`K2ZF=vdJ&ICak|oRlmNb3WaV9|Xxe&a`A| z1U|GPH;$o}n8R6n+LM|J0PH~BfhoJ>m}Q{$?3Mwr{NIM4QUu{ev=c_hiYU`+2%6w5 zPfZYu2Pw~+lm)<&3xG^g_mbX1^--Np^z6o*rVe=BUD_(D<~H?kUI8a4ix4oSZLD{S z2t~R6RnyjH?xVWO-|8<%z~5}4$QFdZhLTMui>;#oUpaO$PnuaxgBO|{MZ}w&aL^JI zcwN_xk1lk5$_A(|TQ(q`Bc^&nYxebluK@0Y8c3q1UVLXC6QP5Dw6lIKjWyi-`QRoJ znPssIX3``+pPVzRNyuJWGi=s-raFaTh+jJ632bP$2o;=c5`FSV(U@JR`I!6-?i)#Q ztEMVHFTrx6NGnwrn&jSJx(i*dVECvVNVg-6{oVTaU=$SJnfNu!6GQ3=zJk0&)ox9Q zMX%UR2OlIr#PH>oV}{&&hCF_~q$k$9J2~a6{d|ex2x7Tc9mudHY>pct=f29|6+ncB zNKwus6PGVu^~FlcQ>ko(>jQ$^WfZneZq9v7#t4 zkr4KsMShC~ZOLH{yR0~e$Rsm%4^=AD&$Fn?=l|_y-V;a8Kao&;%nm`R$bNh zRS=Phe?AhZwj>c*+W@@+(iwJ-Az!?K$2O`z|HzLy#5CDU+O6_N)lxr~Pe{>x8B)w{ z+ceH?JJMj{4pap?x+uaYE*@J)#7}9fq^#XQCFrW>U6)WG3L?KsowhPEq<3&vMa#Jp zbLLq_v(EI)JUbq?E30(c-3FLHaYfw}x>JZj3~<(>CwvwXDtL@c%hsD#v61eRjNGe` zAA8c^okc~DCp74dcA8iQ=ShZdiqQ$Yr__H%V1be)!ox50mXxAfdQbGc`pD0;e!{@O zHrwYz49>y1JJMG`h?6p33CV@beT9TAcoDsM*r}z-I{Mx;$?Q>UC$&nsFKMB&w-7

WKIdBTyt&aj)V@x6d|C1P@bwuNDNe;3^UexUXr4;h7%wJS9 zO<`(=jV3=@dU&@6YnnF{Wq|5lb!TeuoF`5Ca0qd55APe>pXOKcXa*$)4CG6&QKQ7x zsxFQ+RlVr7nh$IpblJAqOv#to9?r$RTf@+({CBmeFO+^9vKs%G;MOxEe`(}y$*V|5 zFP7gNYXbfTh(64PUOhuz0b`6WO+~7CTQRKa(FYTAjHWE8OO!=A_4_&w(!n5RYL+UK zIR&B}Va-814yP!Gco4&6Gzs8TPI02gr0|eMjTwf#Pwkq&4{eD&0mbzntk;m425U8w zhOf6q(zNjKLo&N4+Ft>^A+q9N^?R6=4>)4W0EHD}yRi?37n9Uu_Kz~zQ3BDVNo9v@ zhp?ZCGjWmE71c$TE*Z$bUI_kWy*TdueAE~gc3fPmrkE)$tJxc>nx{Uqn%kXLP^iWluF=AHyKk%Az9crA+cO{CKp#cNXL$)Qp^@1nWaN~a3268h-QGRpN10DEQcPe@Bh*^T2O`W3J&)^lkxg@Q{2v& zx+Q;mRuzXZ*{7A6viJLq+&~Li=5}m%R;p=j6T!j$gEeTR^qa0lY7=(X>Zd*0p`bKt9RtuZ1+JM_AP@cJr*(-j(c0iftm~OC{yDk^S^loFwU`y6ZBiwG#OeY z^cQ_g@HY9;)sLakI{*SJkuOm%#2L(y>n7yL@PxWtfVGI}ZTmz|Bbw0x^6jdQd>hSMw;Gnofa3Bf7}f7R9Z+YAnvUB{;;(ishofx%r8 zy?G-7JZ5WCKomhTJ0)aEnif!`TKq2iWStO zx1XD33W-jORfFg&7iFPmET=Z#RakxQCo}cll9Dot2TShDj|Mt5%U9#YfsUJFc2Og* z6mqgE(QBVc7ExE5a|ctJCnPvGiax}@R0cri&$-JD6YeR6tNo+o9(5y$w>b}e zN3Sp;$U97S8)uO_R^KyT2sPro+&grVdl4e z3nZOv(mza)^@z{SoN3fwrnz<};3uR?!d*yi_@;<_K+0PuogHmM_aTnE>+5OZbNNxM zaLi!SbsSoeaDtzcrfXHbRn*i`u-Ysn)~U;?|6RnE$1wN|q(RH6k~ov?C^UaWNof<7 z9zlL?quILWK7s&I+S6SwU)4lHg^~541R5C@~o~#;jkHW4@eb$ znC(bxPc+08{z2P`v$RjRIW#T-erDyBK_ves*GG@%$U+^S)Q+9%0p9&~a#IEWg38dh z$#Qg4Ww^btJ?;=ZryGuACpGPio?Zx!m0EfQc-PKEUyxtkOu#9fq!|LqaE1ryAMb5I z!95GSsNt^wtbJ{g8?3(Pav3KcT3<&5#1$jc8L4l1Z8%i1?g*LH3nBG!gIghYRp{5utxV#IIYxh`cR>J{Bo!@y*~`k6mx`ImH(tJj;xN$ksLKZT zs;)}1S)igY)pijlAXHw`0TPFyC=iFC7P7`vI<2ateJ9n}(Fn?KTv<1oD_dn+W$ArI5U|3N1LhQWt4S5B!J7=lW zw!hd^$Mb)X2bHk67S81R*!M!G=LB8>j}dp#_U$US*$DvgccrU6*idthe!rDe`;M4j z>7m79I|K(PkoG>tohAhm1Cn^%?=A?+k}AgtqjxYX7t}=hmnM($@*aS%Y16y1bAEQX z{P*o=-*io}kZA8c@>&5AvVv=x$?!=o7*o>Vj>Hp<8kG~KRD>!Uwms7gUZ1Oou2%qI zg`uGGgQi^*CzAIpKV-ibh7kW2WM^-a#+?zN$3=8L5$^Ry3r2=VE&N)jcGg)$_g5O2 z6YVzN&`N9K0VL6j^F((hZPfv+?Ls8sEDo}ULo7eLEv2qS)KJ&^d8EvL|AP?GK0uL^ zWulLuZqNt2i3h!_eXb5lLL!!_^{d~^XuFO^V3m;CB`2-OT4z4hq?9@~jS55*{Po9f zv^FFz7I!Y-0$r#U;UVxC1#DS8Uj*afsCU_x_RCCTN7T-~z0Qx9`an8snrimtf%Uk|qx0e_J1ir2-AHP^z(%>qRsLtvRN z8~*dqlPcOxK9q&ZrV>2o>oeWd91avd8@1T91A>m=2nh+Y8H$G)4tHLX9#>{KdkvwU4uPr1=R}uGJ1&5eFMix^ESC znBtawnB;mRkdYU0bCzY8dcQ>QVxcC^Q_e)i<|Hj`C$E}Ojr+Y*YFW3frf;JnFil`` zCX$YGVnb5-5FhZbMCZc>Wg{_SOk4F=e( z%(hdh@rL~8W&qY36i1oWK3ejhu#o3NOuS^}u(;e$*5h+f4x%Fj4tqA|gc5##djI|1 zCj_c+Fn#MkQL+nAOwz)Fk_Sd^coSlNJP_T3e5d7aHU3SSDy!lusB=6!BWw%T$7U-cKH)m_q>jR=eg@|pG0x`ib$LM zTRhps+nQ~$se!?`ak%~muo;yxd&SGIqHk3^sM(?Ewo}ZM^~3tFfSZVxFf#RiuOfkw zR{-m+c=g=yKw5n5Ep*cXoeSBk45UQoX{=z{q)<3UABk7Pc|4cJ=EN{sKG+}qpyl}C z#xehrBn1J1u*_Gu^KwoBSJMYq{Yk*}nui{L$|QH|F`ZD^+-VV#7__pWoFvkA%(|*# z12)6W8Eo9&BVht)%b}QNMCEi@>k$+o-L6()#BoaOyb1GgS8oXn({#_F%J5AhkN63e z@1w8*8Cs$8sH(`%b0D}CIGxDGR=ETYrd<=B>6)Pd-?AK~G37I$3O8Jbem`@sN7Rp1 zQ(mwl>&|n(%9SuW^h-tfw|%?voiR2l#qe1EmBM>jPbRTk5N`a1CU7$P2TAQRd^#6D zlpwL&CXw1s<&C3#;KJHZ;bUTTzvZcuKbcBE_VTl~V@k4(ZXHH+hq6=kVAPG!o9=u5 zTWuR~j3Q20&qOU^yDQoa(iGy?)}`7tZ7I2Z1+Y!JIed8TN=n)P9r4>BSvC^ z z(bfT&w-l=9d$bMd1u+{5_`@E69r0?l^;VlZ(6&8o%I`&$WK)sKWhtR7?3Kb7G=ab` zSf1F_y69qEtQ&Vc3$EGn;1LMu6Fl4^EE;A_)q7G@#U6*Jy0%nJ`9jbbDO_YdCyZfc zI`i`eq3=RybSj8T70KpnUv*;nxS~wC4+eV23yIxoE_%0Na(MtoLmzo!C3q7nP`Blh zN;71uC}n;DQSfMPp{s|u`Jd_}LXlBULE+ZpK%0I7BU3AF>1?%~`7Wy@kWd9?!>P^I#w(yS zl+4DMN;61QggvXoKoyljr{^Ljs>_e<$IrkQj4grmrm~PaZsT==$YjF0puX10V*LPA zs&}qqXtc4?+1v4vFD_4^-J(J>0q+7Z8=+?$RgL;H+w*M&ar`$qLn}>GL12b5T1mzq z7^+xwtt|j@*Nsyr5Xxn0Z`Mbsf{!)Bxb8j+ZN_p-bfI0kSegLz1@$rtr0i0eiWj?k zQphvi{P|ai8s6{B-+~e-OS%=8Hs9Sw&d%*oV#yPlW(qfrhU*T_(yssUQuP@U&Keo$ zDYvjY>jDu>4qQNL*p9z*0x*j~h0aC=Wn$pBzJ{=md@>%QI<~etU{WzLEJZl5YBVq* z>%04H8SmXeN6NZR50)U=8yfp~z1QDJRv!k4CV6W+t*#m3P^;>aXm*ufE6Dj=YVT-_#z7G5 z0e#)NP;TH-*+O>a8@;Kfzk?&}AEyZes4Bo$2ZUZ=exhA-dkXEWFWpjB5gYmt-OY_}cc$=**r|qFrY9%UtpbLwk8}NTPHVMMe;>IiP=p`h zwqlZ9PV_`wJk3ULg@`e`g_rHYqlDoz&tNV0oW^q*c}AnHa^XU&PQBJlBf_4>1_?n= zyO}F5^&Z8sISJEB(h0a={XrXQ3N0P3XPKG*k#8)$Qg!GKkD`U z{3b$n*#c~Ctef7NJKr|c@^Our@bP%dRNhn6?<|`C#!H*p5~C5Y5>PXh{I1a1wo#>M z)N|(=i86ZyXjGYQH@?uBd2%+74uqi8RlLZEgl|hPr=dgBt9Ysg*$zP~v zl)+Jz2N^9WtW&p9{WE}N$+Qkd95QoTv(MN3j|eX{6m=b+Q$U%Vkm5QgS8+~r|7C&O zhOWN>eyV~6LzE=yA!93tac;w~t2Tx|=Y0MC zC)nk;xTLUmKUsrw3Y{UUys`ILnslBE34_WpLNrVOD!=2Qh*6uL!EryD(K{0?O|u8o z%3g$ZaEVYgxO!YElgn0DhR9VdWW3w~t`*S)pwB(S%Xs806CTjQ_7LX#m~p4(o9WOn zGlxUSg))6E^@i{KU@8%u8`;fDrhJH$NM!ITfv59|#(tRD+#0bZ^Ex4+)8&a;>sKCX zhc(^&%aTD?TOhJuyB^*XQFxvMCdwjV|4(!dyN0oMxZQWvtXuCoWa84&j9dpG8NMlp zqdQJBO$@BN@u2!dG{hZ4UWZ6X-6uq98-M2aE&Ez1w$2V(Of z3__IohC^GBqyDDE5xP~uhZdZJYyJM7iXPjGB@EoBNN$#qiQV5E-G~?4yaI5D4M@B! zk<#k?jfhJG9sQe(fAI-r$IV}yCyWm2>>arLaC-%4K0LE&ci!1yMB7o8*VQp`qOkYT zm0e`r@CN*vku6g2D}>-eYWtTj=j+`8%&Ykbq7YTOK2IPc@Ls_*ieKY~BHD2-vf4T~ zuw8wOzS6)Puu0KFxtjGB5wv#{s-IWc3Nfyo>7>Q)IP-=+sSA<&wUqc#sm`VNC{QBB zPiIg|(`~*2)b2et&Oj68A4=b+?ssz2XrkXcV=evb(<6A&Cns}Z$fagHS5ApCUc0#_ zcZiw4tW_Iofw#)-YmP#otGl1fqq+dQ^7oc{(KPz?aOFd4bw!$zj|+FOWC~ZW|%&g zRzjRbYG(D&$eP(ue6SnGs-jOB+irmNE_vylfj{<7mK!wnUAW=s@9K!p2Kpw*6$^B$M!XAol4eu;q}||jk9aOmp(0&w zozZ`WE{`C)L|IbAxMCopT#vj`MAV`vo|h{RXT5mMBrZ8OU z_tIost>iAhR?SzDtx*6@fqiu%ZTO!~~=M3I_3&m*FG&v5Fe|ats#DCmES(KeQqUQdQZ2QpNf7$^XJ^ zuC9qFOKMD?`lRTjK0vpw@tkFOM8>f=4N>=@AD%jY z6l!QQG$O!piB;AutdT?xN6NC`30Y_O<}1z&2joI|)Up{iZR05FsYE-K9CA9EX^Npw zk>9%nH&~_-ymV3q&r%jb=9+Adw$Vl=9T<@%*SY$GA8*dNL9$ij8Ofd8ovD(=S4D06 zrm(AvQ*O{gX2p}r&-Uq?RjBRF7tVx*?R_GqfwX|rxSL-=dGXiyUB0q++?P8+Zecgk z9^sl;T{r(CZY{0NZ6>?$OQUtiTt4S) zQ356uz(Ezo9#YzP{rY}Yy?hk^qO3D8uZxq>B{%;M{Nc`?sBbN4*l$-s{F&>!z0P*q ziMUD>6BIDSi*}}hANBgh!&0B9i1KNgi5*u3u>Q)X2f0(@PFV(2S^ex+j_lhus9ZY2 zPMhtwC5_>%&sk4e6Rq~u%2`yOY5YT!PUdOh6EY_6G_7~^717~L;N6dNtXf^+r2>(N z9TF<7TEahC+g&a1opN`0?hD&yO)=4x$lTmaC**33FVv55rTe_iCnJW@Po-UZm=NCw zM^O5-nxyfWlb-_D%EiDwuYmQ&Xw%DAKwJ?Uc$l6UYl(`5sY|UU^Mj(OE+0IlF+t!f zAfW0aVaqj1wt?>Gi#mWQfMcT+G|d}2-CBQ6#yyF&AR@!WpqE)Q)3i#8jc--*qG3&jpS5W(4w||h%SH(?4U|WO!ch0lns0kEN(w*R5Sv)+ zx(~vg#1zeeB^?N(>|Di}$jf1Mrt5{#O)OhE(?K!^ri-*yhM!Hx>HlDJ9!<>;)PtpD zhxJ^Z4U?-cdt0!%KDnK>KxXF*fRalKRTb=(ra!xsyzASTW{YLZG7ZyV($%W{_syjX z%0)$)rCl~_G{sIBcH6+tvoo;Tlfcq(IDNd7Se_n50Hz+_)z7W%y?^gC1F#?B7`#5G zxm_*d`qItu$P2D83jBrg9K=YW$KMhdQSYR5B1n<{E8C*!t>U`)#nydmT5%PHunHlU z7|rC{Sv2jms%y<^wDl$wzZYz?a@Sf z_ie(XwDZ@gti+iU7b`aRCmn!U;?dXt6@NT{!@~y&H^MK6n%23l*vD(DUW67NE(E3` zyu^?4=ce_id{>uHvhhh^0m&@f!{2XCn^z8TOt;q;LPznVam@sSn;0j}li1^@(yw(` zF3j=TG^^0~ZbFcKLHG37)|;o<-09Oi{w=vU5D*D*BGI*Ld5xOfPYaI< zX;gWE1a;^M74Vaebp0b!*0dL6ZWjHotb^=cIS68(^(%7^rYncPhb<=8;|{m+FI&~` zIIoCrCogFw;)RaMNB{*L%8h~T_pjpr0E_J{J{#QWHuF51-loYFv|#2&W3c@?{i}hv zqf?jRZwt?P6pSw5DRAnAf;4N&`wfd60l!StI@)S?31+Z8qzr(puaVDq_u z)$zYVFn?Ot{v59e>Zx(1!v6rv!@CP?a|LonK=$6Qp_l$cx5y>Y`PmrbZ(~;a>$TFC zn6Q@|rJHa8#wrbVcZT6PmR?2jfw5DJjr(m}FT__GrjvJLaN;>YJgVJ~`})zA71Ax9 zVp-z>6^HcX?tfa-byyTF*afBx5tJM;Ro{QTYP#&2mXmnGLE~E7_?Fnob{WfK+ZDvR z%uwk1V?CDD^Up1-|XYKG#*XxaIUGCMZiiP+Z+YQo&xM;d}c;2;?QlhoJ6FNil6 zI<2=3Sj4 z2$w6J$X4_fs$2-BP$KbqDaXpDwd*9lc9z;wl62)eWY-Yt6I)!#6B6Yc1mhKHsRNSP z`_Q}b5FV8!=!70)pK6;@=2BO0P3d*{V!F#o%DpjKcNC+AR&Z)>z-r?%A~8PIb;33d z#p8uH^cBXx4(&BdM~}f=oZ|wxyWmHH@=Fv$z5o@(TorMo&gk(Sx@}Tv!A{CY+J&F0 z(kPX;m=P)Tvn(T-wz8t`TA4Nn7*bDz?uvm;~Hjhca; zQ=0rDWMmOvgkMUU_W%vP)Yo{<%2q)MS(B1$-y?0ipaQ z(k*rFC{(`UDWUPjt-u}?fFmkccYF-{WLLzmibDG8c3I?+<#2$_o>7c}%Dvb9>x8(G zw9P)^INEDq`*R@_*v=^7h(PA=oY$Wn7SpJMQ^6Y?8XRo2bhjwj@kF?Tu;NcRs}9Bq6m?r!l>Uj zC~eL?D^k|1tWDcOOp`m3(q|(h8ON}z{yRpyRBN0^l_5?G05{Ln*Ba_Eapl^}V{&b- zq)`-*6z4}Bj((j*e-B(QbHchU^mp;Cv=Lsrh9L6t^%(RO#au@%g~gSf-Lt-%dHHJW ze8u~KeL(l`T2PK*ab*-zs#(k6H;hSkjgHUuC#_%DJl1n*H!n9L^As^CARO94*Ba-YA>eWuA$6}6wrd`I^-OvAARdh z)h?v8Hg^xr9I=N?Zdq}YzpiS-R++g~ad$NCLk~>gRqnpB>RNT6y+slEq-JlB`wr%~e^j@z(vXK$+#eCoQ|diy zO@?@`?ylsO0VS`lhnhj@8g*~4O5k1);Xj9$HgfR(hVyC`Ymus6 zplMn0j&`hR-UB!t}Mgl`uxjYbJ1V{is4{uXJ6f{}F# zkt|6YK6gZ4u0Ox+S{|!&5J{vl&4NJWJ@JBndegok7!j@5aw!-%JsTZp@suq0zY_O2A+dwb0bEb^;68B#V-0(pK> zk4~pGeWSwq&G!#q-AjKir*_;jS94u zt^GxM`9aP`cI+#U0;aQXHHM%qjDdMA?^Gylhsz+@f%H55YvKnF+v?Vm&2^-h^%Mj$ zN0csm;QDD5ZHe&xyxe+?tF*6Mz$KYxYPMmnAiY(LJo1?+N`go(u{E3D3z5$ zr-pV__dTlK;M|^H6(NveV*vSieSWl&&21myZlH8l{{RM2)9ig}DQ;(Vjf`wm;P{yg z-rnA|@o(XFqohM~soIv7Cy1{qbsh3Y-nbiH)KU#3u?)*?J+KY^EH@eV?_Ucq29v`Q z-K>V)$sy(h4!wW9aQ?S#E~8~{BPugwc#cUdI_E#FXq-4fuo8~9eClxj2 z^d2KCNRKuaHgS(A`I{bCv1p=2deRwE;Np5nOs_Xu9V$K=)7eX4X1I%nt&Bxt$J(_` zI`YEkv|)Ws`)Mow!%;EPQ@ zK*)mvudTco!p9c)z}ls-x}4|3C+%1IWUfjW7_t8VO=`R)blD==j{gAVsd#Q=Y%~p@ z`b|%v$cvL3FR>M<>5QR|C+%9MoggHL*pH=N!oj&nIURPd4Y~123v$;7@CLQVnwQ~p zO9?L6ZzRO>#}M^rI{{oB@VkXL3FB3QE+^t(*b~2=-r2Fy6QeLa%?=v8mE)gN<$ofv zLVi$2-q`Q8K8s;IQbyN?CnKb1ZoP-SYg#vrp-pLNdSz&{B1)T(eq593jsDfATP?Nw zt=63ng(8w0oU?=99lGale`?{*AkwufiLG?)KH?w36XIN6+B7Pp91zYn#(E6qw2#AG zTI9JB4aip54^xchtrfov!P5{fNh&f}_RAgq;#*4deUDn=Z;4W0G*-5fcyTELXO9^h?SuC}rD&Spk8Y&QKMv}^ z6d30xsoeC&D}wlH%U6-^Wz4qx#1{mhogLFCouVlz&kGfO-Nj zMQfi8E&d^J(#@pD___Qt=E6X#@9v$1fPY6u#zqYz>Q)i0js2&KrYrbqDGZsN3i;~epXy0@BO+l9ih2iWd$>sD7jGzLqV zOS+GdlN`f6Fgkr`$dKB2u)4GiaLU6a57xA8b&M}-dv4cO1#!=u6+WQVowSppsklq~ zAaJ)Q0n}q4A3`Z&TZj#{!i&g4o^riNKHu+O5IALc4_{f*2@_79K{QSVz>$JKLtFuM z9nO)gXxB3Hh;9onHq2D+zxJrLxh!w51V5PY0E!E4rG^GQFS*m`F|x}UEpd!sgV=xPJu6d+`o~kZ{4$HU3kKyQ1xOn=rYl0? z4MKP=-WgKqxkzqrT=ma-;;tD^EwN;h&_#N^B)}iqwT&|8MYxg~U~~$^b8?&?p`odm zTbCpZ)cj5@pkhuBKq~i)&T??T_1>&CD_uc>l~)AyHDRXdw?m>GvD&q66ortqAQ6qR zP-yq|%yFNf>rZE@PU-^rPo-!)D|>MuGm@%LOjWlB+N5C3<|Jo&xzn_`GN3Oo?TU*; z)8><#30C|&qs*MFh)L^_S6mCD%X9!p@O`S|;Kq-rrcyZaYWMhevtKg8t~0pBYG1?F znfOws1w)SFxcm5O46h}ee5^mqTu<=RRN=|kO9PnH_2tbbpEC@U{i(HQ@?uMw6b#7Zd!C--(zs88bnQ0S$cfD=FafcUM#p@6)z+LZq+>jx8Cc264!{6L zKXF$Yd@%(@Tq;IKF&QME{EE7f^yyocKP-|KDo#}Asvq|Et!~C0Lg2$ayq7SNB*Fq) zn?By%s@Fogz0=>u1*~9TB0@<7k<^3SdYaSp+3ai?{4_DLfN>$^1JD3E`_yxTZWWZT zKFX&XpI>@K5=gO@mPq+YcWF5}FgMBVjrOR_GsyC&D#1#VoRkB~F`b6lKYF{lwy};f zB@YT9eV3Fr+b%s#aR(EL32WT5u;@1FIz9R5M+J1#}w@^8bB1*~# zETnJB#CP}aMReHa@#D5>r6YB2`1JJ6X!r3Ytg94W4<Y~l#Hsyi(^-d4StNuN+^ZP@$vuziI(ycedp*9LBe+DD;J;yn`I^$AEFvp4_=RR*}bX#*HNMNsgr= z9LGI|d(;}1mwjldcM?j@IYe>*-ACW zX!FdDa6lbRT6`tH*MNIVnBF!S<{<4*d==EKLaZ0C%HQSbpP{dZp93!SI3$--)sn_e zaIwP}&QlpApMHX`z8T49e=2GEgmS?a5v7=Ce09(5_N#A$I>pSY>33@)XKuc)fHvUOD3MW?z{bV_KiZZxOj8kN`Fy8oJ}M?higm>4R20 za_Zn^v)37`4ls5>z8H>x)9cRPnZGw)yVnnKTcyg081nnpi>p~`HtHJ$^7gNY0vk9y zWx(6kwEcby(qoth2d-=4KL==eVGFl6v z;v*5dla8LFrfS!TTHNx)>Wulu4gkpOPsEa>(K@L{40+-tXK*q;`0CUS?g+Kj!Ri2D;e@K1B{%F zv)8UG;pf6A{we%owA1H}TG}=c#}jUd#h9~W=sMRM{0QJ1Z6P$6XSB4}8eak!q-f&t zm>sZvPAlMd5=!Z;@Rj4N@>r4+@ej<(GlGnF`j2YWm@nd$B!zCFlf{e@NM${{^&P6> z{UN#*mocv-k*txroRk}P9S{0_G3j3sRO-@271!onBsqpso@tP5QNPqWf_=qsUlU(w z8su_Ab1k#PSyE6r&M-k%AJl{r3Yv~hJB)N+7fqk=I;+BC5XwVCF#{$h&e=P1G3)Z@ zBDjvvNP}8slEUXky)F5$b}i~b+#heRTDsBfpHCNGglYL-{{VGj;dkyj^y`sUQ%w}| z$%B$Pd`I62osBwQs?gWQNtV8j=YBA46JQ z&9OH3V16L(Xs*4f!$j zshUV*R^=}=dystNu1Gla?V4-BBnzklSH*E5X$j>*xyBd#!_(flM@yH8^;>O2P?V*O zrdd=TRauzipIwDVfBe~G5Xz+;xfWn>ufJYigzePrR`xc=;Kyw_xS2`uqhpXTI)X8u z_pTjAx3!R6ks2}OQzLx4XD8B=i4Knfm7ki~P!P{{g3_tCwiXt<4t!1X6J4~YXABihrL zMv?O$IRpD|TAvY1VR47J1C z-NsnRRZB(LxpRa2n)sRU>p}RBYbzUdw$zHTN#kG(k+=>1)x_V!-m$`VHu{|J9Fg2} zHzZPXcw;B#s~#3DJL{QFC#Q>=}$*+h%5gOjrk!Hv%xXoX2PmglXvuC|< z2giOR;rnFMwToxf^w0vU$Vr+Z+m!bn)uwz+(zTdNTHLG*+X!Y}MqGE_uhOOB@t0Kw zNuuQ(r8g(r`_bY!Qh5x4mQYLhY30esQJ(ex05w{o0?s3MPD2yKs|u(+uQc8EZ2sErmx}RDDvQVYyC@{0CBl2aBBL(OYKVDE2zWVnE7Q{ z4)!=}UL`m^8a`>mtS*$rew^=vuxC@cf#8 z80%WOMnt`5ks>`7H6cgasQXlws<$_C2^pj*(U%H`lz>Kmao;t?H#XA4WjJ93ks+Eh z4nXl0xm`f(f;Y#taka>wPqVoaW=Kvs<0pKb@;^gS59U%Ep|#-u03Ibc48!{I>+6rN zdf`1qbf_+6<~Mc|AzO=Cc6<@PE;#8 zv>Rj|y|8-R*y=ndaTGHFHM!;~I>>V%AJh+TL+OkWR$NUT)X_EFptwvBu5hw{^9`Ht zM^Cbn+%z{L*vYs_6ATZz6$CGD3%p0SB85G@PHOU5F0Izl8dH_SvJ4Sc_M!_mw|Q8M z0iKUsL&djR1;m!oY3(8^g7TIpHK_5s>(Q2qI70O0U_b}zYf1R6r`RLd-V|9Fa*(H) zarLi;oOx-fTt1y60ma*A@LvO^8aA3;&;Dfk3}!BfHnVkSEWBh-Gm_pKuBroFf?d2uj| zy0;`@V?c58{=Mr=)K@{aX$guD5EubG#N=T?2exueKDI7x8g~(xqc{dhNaa4QlY^gH zhgg@3wBNzmOPK&hW^>As_EGgdo|rYKaO(d6%NDk_QmE#P26rIykZ^K;^X*zhn%03l zmp73#zFa?o-3U22T=&P@HD|?opAqX#18J=;mNU;GQWyeo8Aa1)^&|rR+r2i zuX9l8cMTXMHcdCfs~E||E4Q_O$u_|48spOxyfD`I5y;W6pgk&0Ht0BJpT!x@Tx8UW z&B|wr8Au$Ux((OR)`~Q!WFqVsl}Kd)(06cA@u(MG4=HANvT4X zD|Pv4%2*irxr;W~Ben*^9@VU0e>RuGw@)5uH|9Zwez;W~hf|a2MR3Oi8+}F)^T%;M zd83qI#tHe6hiniqJ?n}i(=QYaLI$;+!3*I(GemkEfs099PPKYYudZMj!c1Me>Ib>Vrdug#SMU_@V%3OVYM$3`vD^9wRtmI@b7%UGYm?ksS_cJ4a`o@BSzfbVtVJ>){ddz7nW{$BUbR!p~t_dsC819bITwD z&6YVM*X>QM+*(QFwp7dHMLYh!)vF`wI*hTj?D4u~if&Znde$u(+UVKZWZ6FQNzgB? zS@4Q#_dke+GBo(eUlE1|eMhZnyhr?_R%@Ff;YDuYGo0iK_;K-~E9*EVyop{Q#Yy+| ztz(Pyi?wkCyrM82O7&y@-kGfMMivP|J03EyG;N&RNx%`Inb&QIYGMb`^6Ng4*O0GxY@i&VMOp4utdnkI=ul_6Etvw}$OdICCP zpI?;e(7|B79BIrL5Y7%ZIL^L)c98Z(jgp|7ci7aU4Ta;rdDCpMW(K)3sX(Z6kS) zJpDmWRXgW!2fb)oo`HX-v%9pCH<)t~o?04V~N&hAOeD<4hz`WoTQI_6nnXT)TVW#!zCyMDE<@a&vT9;FO| zPJ1A%?%(@2JweBEDmxpCcLBdFbqm~&Q(CQz(o7qhr9*2XG7!zTY}CeSw6=|Q&+As) z6RA9|--&D!u=K4@;iT7b;_6cBM@Fk}hB|el4o}cBd9@#8y?H=KWffbv4 z`wnI&lmYa{-v0nv)I)AwkQY{0|>xi0zi z9Z1gmclM>zM<8cJSe8twOt&$~Bocr8nqG5teJV*Aolk{tG>0u5U=C~!nI|LIR3zTn zT?l1}+{YkQXtqKMo&B(L_p3b-bZ^GQqn2m21xW|US0v*-vz+~@?(OvZNM%WR8Ekw= z(0~-VKt@ll?fMGWwd;H9n`=A8C1qur+U=JO%2O@OKd2I4FHPE+V}+S{usowJ%f1IfdW>z4O4Yd99w5=AfUhPT zJ58J|y9NLZZ?r&zgE-$Y9LeU4=H5jtJRnO0k%Nq6dUnUqRIaOHvoY}0N6uUv{ZISWv#GqA>}rYOzl+YY$I-`3 z`+5=I6+WSFr}A5Qo->s$haxs7a0jL{u=`e(e=YQ8-ha)#f-ZQOn?H$!bO-%Q+q(^p z;8v}soklBZEahl}9!XT39=(a$tRa^1X4B+v6T)qrY|3+u{cBdy-Xj{p%Q%W5%ok&x z`_vk^yl5r6k(NlZssil2fHf|z_SYBDT*#0k$W%y92*~VfPSLM*Yq=m3yW68=%A^yH zz>f8(-$`L^EuoI#{{Rj=(XKG#9YCvC0;Jbr78`k3DkB0)gX>&BqSVEPs~CQ5!2_tS8;SkY2VD7#x3P_Qh7kQZUk<<0>E zagDub=vOx_0FG6N%DyZ{Oa~+|1zQ~n7{TaH-7D~xSDIzIAPIFKW{GA2d{^jIhBhPr z06l9}y}RMXXrhftR}Ct$B(pI)?b84a$KIggd*o+kl30_Nva6E$$r)4YmOXv3Tr(ZD z^peW=0ykeLixZ(hJyJ2qIqU$@>zQ2dSH&==WJAW5Xo_GIw_Fc6Z0_UBxB8v z&D3MAD~BvU5b#|1c!EL;%FmWyr1HK!!6Ox?T}f@NG_k0H-B_7siykA#+=~{y;Mb}^|SfUPm)Y;>pA%%}j^_o#J=ttUz2lao0MT8mAbL) ze%_ra?kBWZ(pD^^D(^1s$_4-=bnDuq)L#DXbpS7i0CWeUwl-t+z{vEiZXt7T9kIJ8 z5&Ubbi5mu1Cp#0{+;#%3RBAD;#3*62Rxv{)pgNTPrpIBEX;F)923acEuUQW ztGO?&bhCALFF%VcVm?#Kr9%+l_WuAV&rn50r`>TTtsRYoGhR<4za%IQ4=ZeQ*bT;g ztAlt7P|&KjNz zyIvfT)*r*NNMn9=1P-cCdKOb^(z%*uRE}I36yPg%Z@8;(0(fsBm6eJ&F(^kX9CknN zTswZSOfGFDYmdT$&d=;~_WIOU<5|#N>%sg#hS<0sq#Ubn(>?zH`__bxCA!oaF)gHn zlbDWH2RY7rR}pIv>9)ldPEQdWh9_mm^?mB&S4((rt}XE-1yyp}`SF~JyRd#EoIH{U zvOz3HM%8<&!NQh|z5$BmRH&3U&7PHFe-R(z*_o#B%eX%=80=}RMb{1()=%pWGCag* zp{14?t#sF!;|{6;Ezo1ut++f z6KI#$QQ}}yMMM_vQ@u$Vwg^qz`Z>KnhH;~;( z9FrL!V~`(B$L(JY_{ucC7jKBbJg$MdFzKIAYlgVLM!&X>Ni1M89#Za4^>XJp`fNSw zZadK}G?H|_TU21l_;}y)(Q}q0cHcijYl-;hQPk#(!_<-+bv()8Y#bA~IsV?Yrg1fd zR*MvuNYB-|n=DRy)wdAZuv|=@nA)J$qLUnsr1jdPyJx@v5Kc3ifm%WHqT}AJ5m#oG zJ-XzI)YjAki6g-8ky1r%&Ra1ON3~tWZ!}o^qDNtk>9o6INoTju(u%{lWNuJ)r;;vQ zauPn3AYQ2(XT2531P1*oVIujIoQ~M3bwdt(ug&zSc!oq>mGC;`R6J*UWirig%#tqZ zcLumij~9&e7-xx07f^#8#7)HI=$L$Z)WfXu{>B+o$PVV{X%1qhQMkMe+Qh zm@)pJLAC{7YBA}WYQqr`yJc4Zk$`s!2TY$XdY$W9w7J#fjUu}6gfHjt*C!*)aqKo5 z_o%d_(`_C&Vo5HJW*{7@ocXfdz$dSA4mK5iZF06jo>7Z}OLJo2cl)UjjfvYdJf98aie7S~clh+(_9c;r&Vun+0~07xN*JBs2hcUZF4 ztgcdaSQ!!vq6aW|+?E`@xq;tp@G9?!E-hd%T`xS$L?%#qx7?%qj@$3QwR|Y}#cMRi zJwho~3)uWQfgjyzo9&8iS6=AM4lFHGkXS+g=hDV_a6}yG%PEh{8(=?tRjGgEsa7C?T9*i1>fzSra-sSZkGH4Nli}K%R*ptzU5UWJHK+VNx3`I76A1H@%hv$a z$HH4H$nh+`FzPvuNvjWqI%H)V##L+)yAVE=ZSbp2j5~=DS-ht*Y-(SF`b3t>tumaQ z$B0cYz|90?7ER7^ns0-8LLrPvS>j_Cg=xdL5EYGiCKE=YGDpkTJ79gQO4T^_?~9|q zxzb@|c$z5{Z@EIL17+JIarCc^9}Kvgj&;Vly}D~FGJz7>-cnHpa&mj-tp5OpC|X=T zr*eV3p<`@%*A4sug2EOb%(V#vfKF!Vj^9es{s+Tn;kx+X^JIQ!ZsQ(@xTN?gX%ng} z9I-jcPGiga*ZzcTZPZS-@W&@YI_K#}fZ@~S3F1SHZ{enDJ{A#zLnvOvD5lUI23Aau zp`oKpi}QjFCYd^~o0o3>wW`}m$;xnB{XhO{TSnys_=ws5kSa?u>4PMy8*ZECzm>mv z3ZGB>nloAn8!{=!V^ZptDZiAF*dDbmw`f-=q#pPiRo<=|Odvd?t03F!S310dAP4Ex z3c0lft!ft#MH>D z$j^uMW83tuA@Hs)tgWJ7!v$ciEXSLXkIc#IkKCVX)ub1C?X|dIoT{kV0GSlACvtk= z0CCeesjWDA+wk_fgppfE&G@ASc6^bAQa-~qrExb7YqsJUP+HBEidB~*!*CxCKhki! z_TM$c_xe{E!#Ch8=YiS~j{t>>E3QKffxBen5!7T3m7zYl!q&-er|@>EcOzs-#^0Bn zN&f&j+IT(N(fO)h`cQ zgaRlPG5t~&B>l0qSi>fspslr}rInPdv2)}QN2gwg>sI=6Np6a5<3osESlLjvM4<}_7r029+=QED+{fe+}%YJ1gbFhc?V09mWM z?nsEkDrr`EDyp4Qh&{g9I}!;H9@~^z@mtRotS;-M{WT8l?;29>riR-^2l=vh1(c8 z6`}CPp7@emRX_E2`%>uoShircsHYncIvUk@OGLSuB$mb!>ZEfWk6KO_(XJtqGi1II zB)C#QW9ofs*MN9_#(rpY#8wB(+Xo#*Pr_O|2w5xumL~B7Gn0nydiAS~4^B=;{0Ka_ z13UETzqUTfS~e&Zo7Rd*vAP4ZJ=T|2f`bI zF^ZD$?c?RQjy1{*khslhvq>z=;vzc((5`=agfB57IPx~xHl~eSe}x_oP!_y3USJ_Z z)2%t*kzBp zRs1nw){|RMA9{P(mjEkd9jY71b`Ga) z_NJQIG5Kx!)tR?-$qc8`r(1K4n4hIJyfc!!t7mPgba-dLE?5tG94~2bqn=p~2Tp8J z;QIwa128_hulX|AIAxiJ-nIV#Dn=u~x^msyH75x|LmqZ>+|l9q(sFD;2bYs! z?MzsO{Jdhgg%)^OT>z_F1QL9;9h4XWl#Kh-c90{GGuOQvI9c*)_TJnf^rz9S=A4k& z-}R`p2#(=~MK*yM#^RrcV_x+?4@RSR!9KNl!!bDCPtvY9WkCM`6z|fTh65(@XKEZU znB9(QNThaRvK;*>E#_{n$Jc5WQb_o6#Yau?M@>_XWh^}z>-lo1AC=6#2el0_je@5) zxan5fe5)uRMhWy4rs=YT0l9zqYSPL<3Wk1AI|Zm<#C?9=wS8o)yu)IBYCCw+J=by6 z`qYr9ZgC&)Q!&8{9^-NEL`^C$HWz-B*7K4BI+5r_3wH|JjC%^eR8;^UwIoVV^C;YU zR+ftt;PMTJr33kAl~qP+DN#TN8K~MR0mxkX(WC*(QyfmfVr;ic4YuIXE4w@Z`5$%~;tJBIUNt zSzGch4hS9TK=6PEIO{>d<-=9mj}K$Gu2tpS<07tC3$p`6H$M2KjPj5MXvBGd^r+$m zNXB>RK>z?_0+u|+K+Y>qw+2EBV`>(Mk+&ae7Nj>qPJL-Di6;XBzYUo&iZ-5Joho}~ zigqK{y(fyzxE0LV$0+*Kqqp?^#Vjt5oSb)~GotrDK~l{jA1NZFnb!eV6!#LGXE^t$ zWN@P^%t`H0$o#u6=}=ursnF(y+=V;QxsaaUaZ7aLIsK|D_Y6qy+J>ddpcOx@4Or(G z!1b@^KmrYaJyi$Ik8IH50nPJ%wI2{CHsn)r0uk5utDS8a^7W+EqGN-$J?S-AxwD!& zv_;6<>r(2-T#c|h)z+e{-fR$k>O16FFfq5SE%LTE0*%t+u4vqYf;!Zh$#v`2pa;SO z_M;n=7})z#K_=KWb7<_l4bP<;NrK}i?^0S#%d+k7Pj4t-N}58+*n^6e`J>r^1XNm( zQb{?d)j-M4^t!+0eATDx1D|8RP3k>hGISj(O<6-{n>ncO)S(&Qtwnqb^`yBQjn36} z#L4T5SHlbpR&xGq5lV5`QgXLbL?{D#V;SkaO3~~#qY^(%5$RCCr>4i!qqR~7+j~-3 z0D}Yfqi6u@iZ-Jis9WPW88nuyj?~uVXJNfO2hh{NNZcAW+2;1`Pik543COPi^K~N? z;m8kDS8E{2$=Z{}>ItQqQrOAONi?d*CZxQSF#y!Jvv*@jcPU}M^&Q-RWU>7zZ>9Cv z(`piA08KsfuW!9ie(jtSQ(v}r$fdoLl<(Gs^qA{Nq%j<(k`hNlOKx%oDJ}M+3C;k` zMQiFYT67$)HW57U+P)_-!x^Vkv?MbM< zbGWOGRk`}oYJ{E0ujW}h;=h`l?fvOBHYd01PpdXDo|JWV0B=pIGcY2d)bot@t9!6W zAb#})&}7Er>rq?+oqAE6a_x#~K@_t2b3$N8N|N9x#Wmo`+iEvxLCz_zkQ0o1Q(S^h z`6iz3FnUqCPHgryG|Jwa&~yg?3M`<42&W;K)X|dlBu6zBwiq7tmZt;CXxkD7+f!P* z5rx{Ow{ensRJO#f6lSHj-vxK052E7~B5YJ}FFtX-LkhDD3QKh-9J^4nP&1B|C8)?C zVuiQ|<<2U~0Io1`y+(upI*M$7Fh|;liOW(WV|rvD9jW1F+;3CavkyxABNQVWdepjU zVe;)$=|?0e-kVEoZ;!C0(wwhNy@guoMUTsoQE3g!vgVgXEx8z^(MI{jNuvPA7|ltg z6>JXs)!v@TCO4yNAaXH*O#|crEAZ|P;)GIm6)bKWI5@8YKy!_&m5U9jOP~j^t9e`~ zZpNXyV7<@MqrPQMhZJ=Z5NuDlp{SCiC^`3|e#J$9Fd=iD>Gc9vbAj(oen!;S=bNQT zsBUQLIAeo@O{gAh9qaL==WdkOx#}q{22OLD{6Xgb0PjyZ=GuhB^%Tv_dQ>C=3Ewpd z1Y;C=IdO~{ZrJHg27X<=>fj9Y1097(ppSak1I#EO1E{EP0b#vcT!(Ru$Gs%O>L^Th z^rn}mQ$kWgER2%k-(PGRJIvDp_*5>r<1=ayI(c zgj?Q)s|LyaDm!9M`+cZecI5`1&p7NoDeQC5e$>_<>96JBft3JMc09NOqqf40ziKwa zkmP6YMi3BDjB=88qaT#x2Q;bWr;C_xMiEk54d~l!ccX4`)4y8$CjENX;Z9BsHMtE! zBF6yztHFL?dA9o3BfFeYXI+hRHgi$A$o8n@U_mrxI0l+R-MUng{c2ecVTzTB10#Rh zh$>D$dQNU$-=#tGRkuO)s6Jyur7y}VKGhG-wFhcXkbNn8Q+1)%kIP5=IvpwcAEimv zX#BLje$@&5+Fqul`HfHV)AclZQ}w9&kEH?TG=p`e9V$VvtZhsOpy^5nCrSWqwIJAi zD32{jJf@ruPLv0feQAf3)AXkAL~PZKjWF2JA1wjqr|N6^>jRshta<7|vHH>h%hHr| Xq0)%**Y&MSQ+&tiQi^``I#>VM=ez;a literal 0 HcmV?d00001 diff --git a/spec/integration/media_api_integration_spec.rb b/spec/integration/media_api_integration_spec.rb index 06e92232..3aadfb06 100644 --- a/spec/integration/media_api_integration_spec.rb +++ b/spec/integration/media_api_integration_spec.rb @@ -3,40 +3,83 @@ # Integration Tests for Bandwidth::MediaApi describe 'MediaApi Integration Tests' do - before do - # run before each test - @api_instance = Bandwidth::MediaApi.new + before(:all) do + Bandwidth.configure do |config| + config.username = BW_USERNAME + config.password = BW_PASSWORD + config.return_binary_data = true + end + @api_instance_media = Bandwidth::MediaApi.new + @binary_media_name = 'ruby_binary_media' + SecureRandom.uuid + @binary_media_data = '123456' + @media_file_name = 'ruby_media_file' + SecureRandom.uuid + @media_file_data = File.open("spec/fixtures/ruby_cat.jpeg").read + @media_file_md5 = Digest::MD5.hexdigest(@media_file_data) end - after do - # run after each test - end + # Upload Media + describe 'upload_media' do + it 'uploads binary media' do + response = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, @binary_media_data) + expect(response[CODE]).to eq(204) + end - # Delete Media - describe 'delete_media test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + it 'uploads media file' do + response = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @media_file_name, @media_file_data) + expect(response[CODE]).to eq(204) end end + + # List Media + describe 'list_media' do + it 'lists media' do + response = @api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID) + expect(response[CODE]).to eq(200) + expect(response[DATA][0]).to be_instance_of(Bandwidth::Media) + expect(response[DATA][0].content).to be_instance_of(String) + expect(response[DATA][0].content_length).to be > 0 + end + end # Get Media - describe 'get_media test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe 'get_media' do + it 'gets uploaded binary media' do + response = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, debug_return_type: 'String') + expect(response[CODE]).to eq(200) + expect(response[DATA]).to eq(@binary_media_data) + end + + it 'gets uploaded media file' do + response = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @media_file_name) + response_md5 = Digest::MD5.hexdigest(response[DATA]) + + expect(response[CODE]).to eq(200) + expect(response_md5).to eq(@media_file_md5) end end - # List Media - describe 'list_media test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # Delete Media + describe 'delete_media' do + it 'deletes the binary media' do + response = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name) + expect(response[CODE]).to eq(204) + end + + it 'deletes the media file' do + response = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @media_file_name) + expect(response[CODE]).to eq(204) end end - # Upload Media - describe 'upload_media test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # HTTP 4XX Errors + describe 'http error' do + it 'causes a 404 error' do + expect { + response = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, "does_not_exist") + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.code).to eq(404) + } end end diff --git a/spec/test.rb b/spec/test.rb deleted file mode 100644 index d5afd8ad..00000000 --- a/spec/test.rb +++ /dev/null @@ -1,280 +0,0 @@ -require 'test/unit' -require_relative '../lib/bandwidth-sdk.rb' -require 'securerandom' -require 'set' -include Bandwidth - -begin - BW_USERNAME = ENV.fetch("BW_USERNAME") - BW_PASSWORD = ENV.fetch("BW_PASSWORD") - BW_ACCOUNT_ID = ENV.fetch("BW_ACCOUNT_ID") - BW_VOICE_APPLICATION_ID = ENV.fetch("BW_VOICE_APPLICATION_ID") - BW_MESSAGING_APPLICATION_ID = ENV.fetch("BW_MESSAGING_APPLICATION_ID") - BASE_CALLBACK_URL = ENV.fetch("BASE_CALLBACK_URL") - BW_NUMBER = ENV.fetch("BW_NUMBER") - USER_NUMBER = ENV.fetch("USER_NUMBER") -rescue - puts "Environmental variables not found" - exit(-1) -end - -class ValidationTest < Test::Unit::TestCase - - def test_valid_media # Test Media Upload, List, Download, and Delete - media_name = 'ruby_media' + SecureRandom.uuid - media_data = '123456' - - # upload media - up_response = $api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, media_name, media_data) - assert_equal(204, up_response[CODE], "incorrect response code") - - # list media - list_media = $api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID) - assert_equal(200, list_media[CODE], "incorrect response code") - assert(list_media[DATA][0].content_length > 0, "media data does not exist") - - # download media - downloaded_media = $api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, media_name, debug_return_type: 'String') - assert_equal(200, downloaded_media[CODE], "incorrect response code") - assert_equal(media_data, downloaded_media[DATA], "downloaded media file not equal to upload") - - # delete media - del_response = $api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, media_name) - assert_equal(204, del_response[CODE], "incorrect response code") - end - - def test_get_delete_invalid_media # Test to make sure correct errors are thrown when trying to list and get media that does not exist - media_name = "invalid_media" - # get media - e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do - $api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, media_name, debug_return_type: 'String') - end - assert_equal(404, e.code, "incorrect response code") - assert_equal("object-not-found", JSON.parse(e.response_body)['type'], "response error type does not match") - - # delete media (the fact that this returns a 204 is actually painful, but we need to verify ¯\_(ツ)_/¯) - del_response = $api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, media_name) - assert_equal(204, del_response[CODE], "incorrect response code") - end - - - #-----------Voice Tests----------- - $api_instance_voice = Bandwidth::CallsApi.new() - - def test_create_call_and_get_call_state # Test to create an outbound call and get its state - amd_config = Bandwidth::MachineDetectionConfiguration.new( - mode: "async", - detection_timeout: 5.0, - silence_timeout: 5.0, - speech_threshold: 5.0, - speech_end_threshold: 5.0, - delay_result: true, - callback_url: BASE_CALLBACK_URL + "/machineDetection", - callback_method: "POST" - ) - call_body = Bandwidth::CreateCallRequest.new( - application_id: BW_VOICE_APPLICATION_ID, - to: USER_NUMBER, - from: BW_NUMBER, - answer_url: BASE_CALLBACK_URL + "/callbacks/answer", - answer_method: "POST", - disconnect_url: BASE_CALLBACK_URL + "/callbacks/disconnect", - disconnect_method: "GET", - machine_detection: amd_config - ) - call_response = $api_instance_voice.create_call_with_http_info(BW_ACCOUNT_ID, call_body) - sleep(3) - # asserts for creating call - assert_equal(201, call_response[CODE], "incorrect response code") - assert_equal(47, call_response[DATA].call_id.length, "id not set") - assert_equal(BW_ACCOUNT_ID, call_response[DATA].account_id, "account id does not match") - assert_equal(BW_VOICE_APPLICATION_ID, call_response[DATA].application_id, "application id does not match") - assert_equal(USER_NUMBER, call_response[DATA].to, "to number does not match") - assert_equal(BW_NUMBER, call_response[DATA].from, "from number does not match") - assert_equal("https://voice.bandwidth.com/api/v2/accounts/" + BW_ACCOUNT_ID + "/calls/" + call_response[DATA].call_id, call_response[DATA].call_url, "call url does not match") - assert(call_response[DATA].call_timeout.is_a?(Float), "incorrect call timeout data type") - assert(call_response[DATA].callback_timeout.is_a?(Float), "incorrect callback timeout data type") - assert(call_response[DATA].start_time.is_a?(Time), "incorrect start time data type") - assert_equal("POST", call_response[DATA].answer_method, "answer method does not match") - assert_equal("GET", call_response[DATA].disconnect_method, "disconnect method does not match") - assert_equal(BASE_CALLBACK_URL + "/callbacks/answer", call_response[DATA].answer_url, "answer url does not match") - assert_equal(BASE_CALLBACK_URL + "/callbacks/disconnect", call_response[DATA].disconnect_url, "disconnect url does not match") - - - get_call_response = $api_instance_voice.get_call_with_http_info(BW_ACCOUNT_ID, call_response[DATA].call_id) - #asserts for getting call state - assert_equal(200, get_call_response[CODE], "incorrect response code") - assert_equal(call_response[DATA].call_id, get_call_response[DATA].call_id, "call id does not match") - assert_equal(BW_ACCOUNT_ID, get_call_response[DATA].account_id, "account id does not match") - assert_equal(BW_VOICE_APPLICATION_ID, get_call_response[DATA].application_id, "application id does not match") - assert(get_call_response[DATA].start_time.is_a?(Time), "incorrect start time data type") - assert(get_call_response[DATA].last_update.is_a?(Time), "incorrect last update time data type") - if get_call_response[DATA].answer_time - assert(get_call_response[DATA].answer_time.is_a?(Time), "incorrect answer time data type") - end - if get_call_response[DATA].end_time - assert(get_call_response[DATA].end_time.is_a?(Time), "incorrect end time data type") - end - if get_call_response[DATA].disconnect_cause == "error" - assert(get_call_response[DATA].error_message.is_a?(String), "incorrect error message data type") - assert_equal(36, get_call_response[DATA].error_id.length, "error id not set") - end - end - - def test_create_get_failed_call # Test to make sure correct errors are thrown when trying to create a call incorrectly and get a call that does not exist - call_body = Bandwidth::CreateCallRequest.new( - application_id: BW_VOICE_APPLICATION_ID, - to: "+1invalid", - from: BW_NUMBER, - answer_url: BASE_CALLBACK_URL + "/callbacks/answer", - answer_method: "POST", - disconnect_url: BASE_CALLBACK_URL + "/callbacks/disconnect", - disconnect_method: "GET" - ) - - dne_id = "does-not-exist" - - call_e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do - $api_instance_voice.create_call_with_http_info(BW_ACCOUNT_ID, call_body) - end - get_e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do - $api_instance_voice.get_call_with_http_info(BW_ACCOUNT_ID, dne_id) - end - - # asserts for creating bad call - assert_equal(400, call_e.code, "incorrect response code") - assert_equal("validation", JSON.parse(call_e.response_body)['type'], "response error type does not match") - assert(JSON.parse(call_e.response_body)['description'].is_a?(String), "incorrect error description type") - - # asserts for getting non-existent call - assert_equal(404, get_e.code, "incorrect response code") - #assert_equal("", JSON.parse(get_e.response_body)['type'], "response error type does not match") for some reason, this doesnt have a response body 🙃 - #assert(JSON.parse(get_e.response_body)['description'], "incorrect error description type") - end - - #-----------MFA Tests----------- - $api_instance_mfa = Bandwidth::MFAApi.new() - - def test_mfa_messaging # Test to send a messaging mfa code - req_schema = Bandwidth::TwoFactorCodeRequestSchema.new( - to: USER_NUMBER, - from: BW_NUMBER, - application_id: BW_MESSAGING_APPLICATION_ID, - message: "Your temporary {NAME} {SCOPE} code is: {CODE}", - digits: 6 - ) - mfa_response = $api_instance_mfa.messaging_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) - assert_equal(200, mfa_response[CODE], "incorrect response code") - assert_equal(29, mfa_response[DATA].message_id.length, "message id not set") - end - - def test_failed_mfa_messaging # Test to make sure correct errors are thrown when trying to send a messaging mfa code incorrectly - req_schema = Bandwidth::TwoFactorCodeRequestSchema.new( - to: USER_NUMBER, - from: BW_NUMBER, - application_id: BW_MESSAGING_APPLICATION_ID, - message: "Your temporary {NAME} {SCOPE} code is: ", - digits: 6 - ) - e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do - $api_instance_mfa.messaging_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) - end - assert_equal(400, e.code, "incorrect response code") - assert_equal("{CODE} is required in MFA message", JSON.parse(e.response_body)['error'], "response error does not match") - end - - def test_mfa_voice # Test to send a voice mfa code - req_schema = Bandwidth::TwoFactorCodeRequestSchema.new( - to: USER_NUMBER, - from: BW_NUMBER, - application_id: BW_VOICE_APPLICATION_ID, - message: "Your temporary {NAME} {SCOPE} code is: {CODE}", - digits: 6 - ) - mfa_response = $api_instance_mfa.voice_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) - assert_equal(200, mfa_response[CODE], "incorrect response code") - assert_equal(47, mfa_response[DATA].call_id.length, "call id not set") - end - - def test_failed_mfa_voice # Test to make sure correct errors are thrown when trying to send a voice mfa code incorrectly - req_schema = Bandwidth::TwoFactorCodeRequestSchema.new( - to: USER_NUMBER, - from: BW_NUMBER, - application_id: BW_VOICE_APPLICATION_ID, - message: "Your temporary {NAME} {SCOPE} code is: ", - digits: 6 - ) - e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do - $api_instance_mfa.voice_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) - end - assert_equal(400, e.code, "incorrect response code") - assert_equal("{CODE} is required in MFA message", JSON.parse(e.response_body)['error'], "response error does not match") - end - - def test_mfa_verify # Test to verify a correct received mfa code - omit("Currently no way to do this without receiving callbacks") - req_schema = Bandwidth::TwoFactorVerifyRequestSchema.new( - to: "+1000" + rand(1...10000000).to_s, - application_id: BW_VOICE_APPLICATION_ID, - expiration_time_in_minutes: 3, - code: "123456" - ) - mfa_response = $api_instance_mfa.verify_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) - assert_equal(200, mfa_response[CODE], "incorrect response code") - assert(mfa_response[DATA].valid.is_a?(TrueClass), "incorrect valid data type") - end - - def test_failed_mfa_verify # Test to verify an incorrect received mfa code - req_schema = Bandwidth::TwoFactorVerifyRequestSchema.new( - to: "+1000" + rand(1...10000000).to_s, - application_id: BW_VOICE_APPLICATION_ID, - expiration_time_in_minutes: 3, - code: "12345" # 5 digits so as to never match one randomly generated by previous tests - ) - mfa_response = $api_instance_mfa.verify_two_factor_with_http_info(BW_ACCOUNT_ID, req_schema) - assert_equal(200, mfa_response[CODE], "incorrect response code") - assert(mfa_response[DATA].valid.is_a?(FalseClass), "incorrect valid data type") - end - - #-----------TN Lookup Tests----------- - $api_instance_tnlookup = Bandwidth::PhoneNumberLookupApi.new() - - def test_create_get_tn_lookup # Test to create and get the status of a TN Lookup Request - tn_body = Bandwidth::OrderRequest.new( - tns: [BW_NUMBER] - ) - create_response = $api_instance_tnlookup.lookup_request_with_http_info(BW_ACCOUNT_ID, tn_body) - assert_equal(202, create_response[CODE], "incorrect response code") - assert_equal(36, create_response[DATA].request_id.length, "request id not set") - assert(create_response[DATA].status.is_a?(String), "incorrect status data type") - - sleep(1) - - req_id = create_response[DATA].request_id - get_response = $api_instance_tnlookup.lookup_request_status_with_http_info(BW_ACCOUNT_ID, req_id) - assert_equal(200, get_response[CODE], "incorrect response code") - assert_equal(req_id, get_response[DATA].request_id, "request id does not match") - assert(get_response[DATA].status.is_a?(String), "incorrect response status type") - assert(get_response[DATA].result[0].response_code.is_a?(Integer), "incorrect response code type") - assert_equal(BW_NUMBER, get_response[DATA].result[0].e_164_format, "phone number does not match") - end - - def test_failed_create_get_tn_lookup # Test to make sure correct errors are thrown when trying to improperly create and get a TN Lookup Request - tn_body_bad = Bandwidth::OrderRequest.new( - tns: ["+1invalid"] - ) - req_id_dne = "invalid" - expected_error = "Some tns do not match e164 format: " + tn_body_bad.tns[0] - #req_id_dne = "11111111-2222-3333-4444-555555555555" - create_e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do - $api_instance_tnlookup.lookup_request_with_http_info(BW_ACCOUNT_ID, tn_body_bad) - end - assert_equal(400, create_e.code, "incorrect response type") - assert_equal(expected_error, JSON.parse(create_e.response_body)['message'], "response error does not match") - - get_e = assert_raise(Bandwidth::ApiError, "expected exception not raised") do - $api_instance_tnlookup.lookup_request_status_with_http_info(BW_ACCOUNT_ID, req_id_dne) - end - assert_equal(404, get_e.code, "incorrect response type") - end -end diff --git a/spec/unit/api_client_spec.rb b/spec/unit/api_client_spec.rb deleted file mode 100644 index a5177d4e..00000000 --- a/spec/unit/api_client_spec.rb +++ /dev/null @@ -1,188 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'spec_helper' - -describe Bandwidth::ApiClient do - context 'initialization' do - context 'URL stuff' do - context 'host' do - it 'removes http from host' do - Bandwidth.configure { |c| c.host = 'http://example.com' } - expect(Bandwidth::Configuration.default.host).to eq('example.com') - end - - it 'removes https from host' do - Bandwidth.configure { |c| c.host = 'https://wookiee.com' } - expect(Bandwidth::ApiClient.default.config.host).to eq('wookiee.com') - end - - it 'removes trailing path from host' do - Bandwidth.configure { |c| c.host = 'hobo.com/v4' } - expect(Bandwidth::Configuration.default.host).to eq('hobo.com') - end - end - - context 'base_path' do - it "prepends a slash to base_path" do - Bandwidth.configure { |c| c.base_path = 'v4/dog' } - expect(Bandwidth::Configuration.default.base_path).to eq('/v4/dog') - end - - it "doesn't prepend a slash if one is already there" do - Bandwidth.configure { |c| c.base_path = '/v4/dog' } - expect(Bandwidth::Configuration.default.base_path).to eq('/v4/dog') - end - - it "ends up as a blank string if nil" do - Bandwidth.configure { |c| c.base_path = nil } - expect(Bandwidth::Configuration.default.base_path).to eq('') - end - end - end - end - - describe '#deserialize' do - it "handles Array" do - api_client = Bandwidth::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[12, 34]') - data = api_client.deserialize(response, 'Array') - expect(data).to be_instance_of(Array) - expect(data).to eq([12, 34]) - end - - it 'handles Array>' do - api_client = Bandwidth::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[[12, 34], [56]]') - data = api_client.deserialize(response, 'Array>') - expect(data).to be_instance_of(Array) - expect(data).to eq([[12, 34], [56]]) - end - - it 'handles Hash' do - api_client = Bandwidth::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '{"message": "Hello"}') - data = api_client.deserialize(response, 'Hash') - expect(data).to be_instance_of(Hash) - expect(data).to eq(:message => 'Hello') - end - end - - describe "#object_to_hash" do - it 'ignores nils and includes empty arrays' do - # uncomment below to test object_to_hash for model - # api_client = Bandwidth::ApiClient.new - # _model = Bandwidth::ModelName.new - # update the model attribute below - # _model.id = 1 - # update the expected value (hash) below - # expected = {id: 1, name: '', tags: []} - # expect(api_client.object_to_hash(_model)).to eq(expected) - end - end - - describe '#build_collection_param' do - let(:param) { ['aa', 'bb', 'cc'] } - let(:api_client) { Bandwidth::ApiClient.new } - - it 'works for csv' do - expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') - end - - it 'works for ssv' do - expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc') - end - - it 'works for tsv' do - expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") - end - - it 'works for pipes' do - expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc') - end - - it 'works for multi' do - expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) - end - - it 'fails for invalid collection format' do - expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') - end - end - - describe '#json_mime?' do - let(:api_client) { Bandwidth::ApiClient.new } - - it 'works' do - expect(api_client.json_mime?(nil)).to eq false - expect(api_client.json_mime?('')).to eq false - - expect(api_client.json_mime?('application/json')).to eq true - expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true - expect(api_client.json_mime?('APPLICATION/JSON')).to eq true - - expect(api_client.json_mime?('application/xml')).to eq false - expect(api_client.json_mime?('text/plain')).to eq false - expect(api_client.json_mime?('application/jsonp')).to eq false - end - end - - describe '#select_header_accept' do - let(:api_client) { Bandwidth::ApiClient.new } - - it 'works' do - expect(api_client.select_header_accept(nil)).to be_nil - expect(api_client.select_header_accept([])).to be_nil - - expect(api_client.select_header_accept(['application/json'])).to eq('application/json') - expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - - expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') - end - end - - describe '#select_header_content_type' do - let(:api_client) { Bandwidth::ApiClient.new } - - it 'works' do - expect(api_client.select_header_content_type(nil)).to be_nil - expect(api_client.select_header_content_type([])).to be_nil - - expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') - expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') - end - end - - describe '#sanitize_filename' do - let(:api_client) { Bandwidth::ApiClient.new } - - it 'works' do - expect(api_client.sanitize_filename('sun')).to eq('sun') - expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif') - end - end -end diff --git a/spec/unit/configuration_spec.rb b/spec/unit/configuration_spec.rb deleted file mode 100644 index 490eb306..00000000 --- a/spec/unit/configuration_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'spec_helper' - -describe Bandwidth::Configuration do - let(:config) { Bandwidth::Configuration.default } - - before(:each) do - # uncomment below to setup host and base_path - # require 'URI' - # uri = URI.parse("http://localhost") - # Bandwidth.configure do |c| - # c.host = uri.host - # c.base_path = uri.path - # end - end - - describe '#base_url' do - it 'should have the default value' do - # uncomment below to test default value of the base path - # expect(config.base_url).to eq("http://localhost") - end - - it 'should remove trailing slashes' do - [nil, '', '/', '//'].each do |base_path| - config.base_path = base_path - # uncomment below to test trailing slashes - # expect(config.base_url).to eq("http://localhost") - end - end - end -end From 79b4553daac98f3498daa5870e184b72a00a0d89 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Thu, 2 Mar 2023 10:53:22 -0500 Subject: [PATCH 11/30] Add BXML Verbs (#75) * Add Root Classes for BXML Verbs * remove unfinished verbs from sdk requires * add unit tests for Bxml and Response * add ffi to install libxml2 for windows * use 3.2.2 of libxml * switch to libxml require * Try Using Ox (#78) * ox dump instead of to_s * use attribute map in verb * standardize expected bxml var * typos * Add Terminal Verbs (#76) * Add Terminal Verbs * update bridge and add unit test * add unit test for root verb module * bridge test * bridge comment * update conference * add terminal verb unit test * verb test * all attributes in bridge test * add conference and test * add conference to sdk * remove backslash escaping * test number * use real booleans for conference * add comment to bridge * add pause and test * conference timeout is a Number * add forward and test * add explicit empty hash to tag * add hangup and test * add pause_recording and test * add phone_number and test * add play_audio and test * comments for params * add record and test * add redirect and test * add resume_recording and test * add ring and test * add send_dtmf and test * add sip_uri and test * add speak_sentence and test * add start_gather and test * add start_recording and test * add stop_gather and test * add stop_recording and test * add stop_stream and test * _name for stop_stream * add stream_param and test * add test for tag verb * turn ssml regex into constants * test decimals in ring verb * test decimals in conference * comment clean up * Add Non-Terminal Verbs (#77) * Add Non-Terminal Verbs * merge SWI-1730 * update gather and add tests * period in gather comment * add start_stream and test * add transfer and test * remove add_verb method * update response and bxml class tests * update non-terminal verbs and tests * refactor base verb classes (#80) * use call id for bridge test * update gem ox dependency * Apply suggestions from code review Co-authored-by: Matthew Martin <105743990+matthewkmartin@users.noreply.github.com> --------- Co-authored-by: Matthew Martin <105743990+matthewkmartin@users.noreply.github.com> --- Gemfile.lock | 3 + bandwidth-sdk.gemspec | 1 + lib/bandwidth-sdk.rb | 32 +++++++ lib/bandwidth-sdk/models/bxml/bxml.rb | 37 ++------ .../models/bxml/nestable_verb.rb | 50 +++++++++++ lib/bandwidth-sdk/models/bxml/response.rb | 40 ++------- lib/bandwidth-sdk/models/bxml/root.rb | 47 ++++++++++ lib/bandwidth-sdk/models/bxml/verb.rb | 51 +++++++++++ lib/bandwidth-sdk/models/bxml/verbs/bridge.rb | 46 +++++----- .../models/bxml/verbs/conference.rb | 51 ++++++----- .../models/bxml/verbs/forward.rb | 30 ++++--- lib/bandwidth-sdk/models/bxml/verbs/gather.rb | 81 ++++++++--------- lib/bandwidth-sdk/models/bxml/verbs/hangup.rb | 14 ++- lib/bandwidth-sdk/models/bxml/verbs/pause.rb | 20 +++-- .../models/bxml/verbs/pause_recording.rb | 14 ++- .../models/bxml/verbs/phone_number.rb | 42 +++++---- .../models/bxml/verbs/play_audio.rb | 24 ++--- lib/bandwidth-sdk/models/bxml/verbs/record.rb | 53 +++++------ .../models/bxml/verbs/redirect.rb | 37 ++++---- .../models/bxml/verbs/resume_recording.rb | 14 ++- lib/bandwidth-sdk/models/bxml/verbs/ring.rb | 22 ++--- .../models/bxml/verbs/send_dtmf.rb | 23 ++--- .../models/bxml/verbs/sip_uri.rb | 44 +++++----- .../models/bxml/verbs/speak_sentence.rb | 33 ++++--- .../models/bxml/verbs/start_gather.rb | 29 +++--- .../models/bxml/verbs/start_recording.rb | 37 ++++---- .../models/bxml/verbs/start_stream.rb | 59 +++++-------- .../models/bxml/verbs/stop_gather.rb | 14 ++- .../models/bxml/verbs/stop_recording.rb | 14 ++- .../models/bxml/verbs/stop_stream.rb | 21 ++--- .../models/bxml/verbs/stream_param.rb | 23 ++--- lib/bandwidth-sdk/models/bxml/verbs/tag.rb | 14 +-- .../models/bxml/verbs/transfer.rb | 72 +++++++-------- .../models/bxml/verbs/xml_verb.rb | 26 ------ spec/unit/models/bxml/bxml_spec.rb | 18 ++++ spec/unit/models/bxml/nestable_verb_spec.rb | 13 +++ spec/unit/models/bxml/response_spec.rb | 18 ++++ spec/unit/models/bxml/verb_spec.rb | 28 ++++++ spec/unit/models/bxml/verbs/bridge_spec.rb | 60 +++++++++++++ .../unit/models/bxml/verbs/conference_spec.rb | 60 +++++++++++++ spec/unit/models/bxml/verbs/forward_spec.rb | 46 ++++++++++ spec/unit/models/bxml/verbs/gather_spec.rb | 88 +++++++++++++++++++ spec/unit/models/bxml/verbs/hangup_spec.rb | 18 ++++ .../models/bxml/verbs/pause_recording_spec.rb | 18 ++++ spec/unit/models/bxml/verbs/pause_spec.rb | 36 ++++++++ .../models/bxml/verbs/phone_number_spec.rb | 56 ++++++++++++ .../unit/models/bxml/verbs/play_audio_spec.rb | 38 ++++++++ spec/unit/models/bxml/verbs/record_spec.rb | 70 +++++++++++++++ spec/unit/models/bxml/verbs/redirect_spec.rb | 52 +++++++++++ .../bxml/verbs/resume_recording_spec.rb | 18 ++++ spec/unit/models/bxml/verbs/ring_spec.rb | 38 ++++++++ spec/unit/models/bxml/verbs/send_dtmf_spec.rb | 38 ++++++++ spec/unit/models/bxml/verbs/sip_uri_spec.rb | 58 ++++++++++++ .../models/bxml/verbs/speak_sentence_spec.rb | 40 +++++++++ .../models/bxml/verbs/start_gather_spec.rb | 44 ++++++++++ .../models/bxml/verbs/start_recording_spec.rb | 54 ++++++++++++ .../models/bxml/verbs/start_stream_spec.rb | 74 ++++++++++++++++ .../models/bxml/verbs/stop_gather_spec.rb | 18 ++++ .../models/bxml/verbs/stop_recording_spec.rb | 18 ++++ .../models/bxml/verbs/stop_stream_spec.rb | 36 ++++++++ .../models/bxml/verbs/stream_param_spec.rb | 38 ++++++++ spec/unit/models/bxml/verbs/tag_spec.rb | 18 ++++ spec/unit/models/bxml/verbs/transfer_spec.rb | 86 ++++++++++++++++++ 63 files changed, 1810 insertions(+), 505 deletions(-) create mode 100644 lib/bandwidth-sdk/models/bxml/nestable_verb.rb create mode 100644 lib/bandwidth-sdk/models/bxml/root.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verb.rb delete mode 100644 lib/bandwidth-sdk/models/bxml/verbs/xml_verb.rb create mode 100644 spec/unit/models/bxml/bxml_spec.rb create mode 100644 spec/unit/models/bxml/nestable_verb_spec.rb create mode 100644 spec/unit/models/bxml/response_spec.rb create mode 100644 spec/unit/models/bxml/verb_spec.rb create mode 100644 spec/unit/models/bxml/verbs/bridge_spec.rb create mode 100644 spec/unit/models/bxml/verbs/conference_spec.rb create mode 100644 spec/unit/models/bxml/verbs/forward_spec.rb create mode 100644 spec/unit/models/bxml/verbs/gather_spec.rb create mode 100644 spec/unit/models/bxml/verbs/hangup_spec.rb create mode 100644 spec/unit/models/bxml/verbs/pause_recording_spec.rb create mode 100644 spec/unit/models/bxml/verbs/pause_spec.rb create mode 100644 spec/unit/models/bxml/verbs/phone_number_spec.rb create mode 100644 spec/unit/models/bxml/verbs/play_audio_spec.rb create mode 100644 spec/unit/models/bxml/verbs/record_spec.rb create mode 100644 spec/unit/models/bxml/verbs/redirect_spec.rb create mode 100644 spec/unit/models/bxml/verbs/resume_recording_spec.rb create mode 100644 spec/unit/models/bxml/verbs/ring_spec.rb create mode 100644 spec/unit/models/bxml/verbs/send_dtmf_spec.rb create mode 100644 spec/unit/models/bxml/verbs/sip_uri_spec.rb create mode 100644 spec/unit/models/bxml/verbs/speak_sentence_spec.rb create mode 100644 spec/unit/models/bxml/verbs/start_gather_spec.rb create mode 100644 spec/unit/models/bxml/verbs/start_recording_spec.rb create mode 100644 spec/unit/models/bxml/verbs/start_stream_spec.rb create mode 100644 spec/unit/models/bxml/verbs/stop_gather_spec.rb create mode 100644 spec/unit/models/bxml/verbs/stop_recording_spec.rb create mode 100644 spec/unit/models/bxml/verbs/stop_stream_spec.rb create mode 100644 spec/unit/models/bxml/verbs/stream_param_spec.rb create mode 100644 spec/unit/models/bxml/verbs/tag_spec.rb create mode 100644 spec/unit/models/bxml/verbs/transfer_spec.rb diff --git a/Gemfile.lock b/Gemfile.lock index 1761ea14..181b9e2b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,6 +4,7 @@ PATH bandwidth-sdk (11.0.0) faraday (>= 1.0.1, < 3.0) faraday-multipart + ox (~> 2.4) GEM remote: https://rubygems.org/ @@ -21,6 +22,7 @@ GEM jaro_winkler (1.5.4) method_source (1.0.0) multipart-post (2.3.0) + ox (2.14.14) parallel (1.22.1) parser (3.2.0.0) ast (~> 2.4.1) @@ -65,6 +67,7 @@ PLATFORMS DEPENDENCIES bandwidth-sdk! + ox (~> 2.4, >= 2.4.1) pry-byebug rake (~> 13.0.1) rspec (~> 3.6, >= 3.6.0) diff --git a/bandwidth-sdk.gemspec b/bandwidth-sdk.gemspec index e6212665..39c3de64 100644 --- a/bandwidth-sdk.gemspec +++ b/bandwidth-sdk.gemspec @@ -29,6 +29,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0' s.add_runtime_dependency 'faraday-multipart' + s.add_runtime_dependency 'ox', '~> 2.4' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index 1e2f2c49..84f94741 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -105,6 +105,38 @@ require 'bandwidth-sdk/models/voice_api_error' require 'bandwidth-sdk/models/voice_code_response' +# BXML +require 'bandwidth-sdk/models/bxml/root' +require 'bandwidth-sdk/models/bxml/bxml' +require 'bandwidth-sdk/models/bxml/response' +require 'bandwidth-sdk/models/bxml/verb' +require 'bandwidth-sdk/models/bxml/nestable_verb' +require 'bandwidth-sdk/models/bxml/verbs/bridge' +require 'bandwidth-sdk/models/bxml/verbs/conference' +require 'bandwidth-sdk/models/bxml/verbs/forward' +require 'bandwidth-sdk/models/bxml/verbs/gather' +require 'bandwidth-sdk/models/bxml/verbs/hangup' +require 'bandwidth-sdk/models/bxml/verbs/pause_recording' +require 'bandwidth-sdk/models/bxml/verbs/pause' +require 'bandwidth-sdk/models/bxml/verbs/phone_number' +require 'bandwidth-sdk/models/bxml/verbs/play_audio' +require 'bandwidth-sdk/models/bxml/verbs/record' +require 'bandwidth-sdk/models/bxml/verbs/redirect' +require 'bandwidth-sdk/models/bxml/verbs/resume_recording' +require 'bandwidth-sdk/models/bxml/verbs/ring' +require 'bandwidth-sdk/models/bxml/verbs/send_dtmf' +require 'bandwidth-sdk/models/bxml/verbs/sip_uri' +require 'bandwidth-sdk/models/bxml/verbs/speak_sentence' +require 'bandwidth-sdk/models/bxml/verbs/start_gather' +require 'bandwidth-sdk/models/bxml/verbs/start_recording' +require 'bandwidth-sdk/models/bxml/verbs/start_stream' +require 'bandwidth-sdk/models/bxml/verbs/stop_gather' +require 'bandwidth-sdk/models/bxml/verbs/stop_recording' +require 'bandwidth-sdk/models/bxml/verbs/stop_stream' +require 'bandwidth-sdk/models/bxml/verbs/stream_param' +require 'bandwidth-sdk/models/bxml/verbs/tag' +require 'bandwidth-sdk/models/bxml/verbs/transfer' + # APIs require 'bandwidth-sdk/api/calls_api' require 'bandwidth-sdk/api/conferences_api' diff --git a/lib/bandwidth-sdk/models/bxml/bxml.rb b/lib/bandwidth-sdk/models/bxml/bxml.rb index ffcec42c..f33160c3 100644 --- a/lib/bandwidth-sdk/models/bxml/bxml.rb +++ b/lib/bandwidth-sdk/models/bxml/bxml.rb @@ -1,35 +1,12 @@ -require 'builder' -Dir[File.dirname(__FILE__) + '/verbs/*'].each {|file| - require_relative file -} - -module Bandwidth - module Voice +module Bandwidth + module Bxml class Bxml - # Initializer - # @param verbs [Array] optional list of verbs to include in the bxml tag - def initialize(verbs = nil) - @verbs = verbs || [] - end - - # Return BXML representaion of this response - def to_bxml() - xml = Builder::XmlMarkup.new() - xml.instruct!(:xml, :version=>'1.0', :encoding=>'UTF-8') - xml.Bxml do - @verbs.each {|verb| verb.to_bxml(xml)} - end - xml.target!().gsub(SPEAK_SENTENCE_REGEX){|s|s.gsub(SSML_REGEX, '<\1>')} - end - - # Add one or more verbs to this response - def push(*verbs) - @verbs.push(*verbs) - end + include Bandwidth::Bxml::Root - # Add a verb to this response - def <<(verb) - @verbs << verb + # Initializer + # @param nested_verbs [Array] XML element children. Defaults to an empty array. + def initialize(nested_verbs = []) + super(tag='Bxml', nested_verbs) end end end diff --git a/lib/bandwidth-sdk/models/bxml/nestable_verb.rb b/lib/bandwidth-sdk/models/bxml/nestable_verb.rb new file mode 100644 index 00000000..8d380e4a --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/nestable_verb.rb @@ -0,0 +1,50 @@ +require 'ox' + +module Bandwidth + module Bxml + module NestableVerb + include Bandwidth::Bxml::Verb + + # Initializer + # @param tag [String] Name of the XML element. + # @param content [String] XML element content. Defaults to nil. + # @param nested_verbs [Array] XML element children. Defaults to an empty array. + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(tag, content = nil, nested_verbs = [], attributes = {}) + @tag = tag + @content = content + @nested_verbs = nested_verbs + @attributes = attributes + @attribute_map = [] + end + + # Generate an XML element for the verb + # @return [Node] The XML element. + def generate_xml + root = Ox::Element.new(@tag) + if @content + root << @content + end + + if @nested_verbs.length > 0 + @nested_verbs.each do |verb| + root << verb.generate_xml + end + end + + if !@attributes.empty? + @attributes.each do |key, value| + if @attribute_map.include? key.to_sym + root[@attribute_map[key.to_sym]] = value + else + raise NoMethodError.new("attribute '#{key}' is not a valid attribute for this verb") + end + end + end + + return root + end + + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/response.rb b/lib/bandwidth-sdk/models/bxml/response.rb index fda1cfe7..174509bd 100644 --- a/lib/bandwidth-sdk/models/bxml/response.rb +++ b/lib/bandwidth-sdk/models/bxml/response.rb @@ -1,38 +1,12 @@ -require 'builder' -Dir[File.dirname(__FILE__) + '/verbs/*'].each {|file| - require_relative file -} - -SSML_REGEX = /<([a-zA-Z\/\/].*?)>/ -SPEAK_SENTENCE_REGEX = /.*?<\/SpeakSentence>/ - -module Bandwidth - module Voice +module Bandwidth + module Bxml class Response - # Initializer - # @param verbs [Array] optional list of verbs to include into response - def initialize(verbs = nil) - @verbs = verbs || [] - end + include Bandwidth::Bxml::Root - # Return BXML representaion of this response - def to_bxml() - xml = Builder::XmlMarkup.new() - xml.instruct!(:xml, :version=>'1.0', :encoding=>'UTF-8') - xml.Response do - @verbs.each {|verb| verb.to_bxml(xml)} - end - xml.target!().gsub(SPEAK_SENTENCE_REGEX){|s|s.gsub(SSML_REGEX, '<\1>')} - end - - # Add one or more verbs to this response - def push(*verbs) - @verbs.push(*verbs) - end - - # Add a verb to this response - def <<(verb) - @verbs << verb + # Initializer + # @param nested_verbs [Array] XML element children. Defaults to an empty array. + def initialize(nested_verbs = []) + super(tag='Response', nested_verbs) end end end diff --git a/lib/bandwidth-sdk/models/bxml/root.rb b/lib/bandwidth-sdk/models/bxml/root.rb new file mode 100644 index 00000000..c171a868 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/root.rb @@ -0,0 +1,47 @@ +require 'ox' + +module Bandwidth + module Bxml + SPEAK_SENTENCE_REGEX = /(.*?)<\/SpeakSentence>/ + SSML_REGEX = /<([a-zA-Z\/\/].*?)>/ + + module Root + # Initializer + # @param tag [String] Name of the XML element. + # @param nested_verbs [Array] XML element children. Defaults to an empty array. + def initialize(tag, nested_verbs = []) + @tag = tag + @nested_verbs = nested_verbs + end + + # Generate an XML element for the BXML response + # @return [Document] The XML element. + def generate_xml + xml = Ox::Document.new + instruct = Ox::Instruct.new(:xml) + instruct[:version] = '1.0' + instruct[:encoding] = 'UTF-8' + xml << instruct + root = Ox::Element.new(@tag) + @nested_verbs.each do |verb| + root << verb.generate_xml + end + xml << root + return xml + end + + # Add a verb to the nested verbs array + # @param *nested_verbs [Verb] or [Array] Verb or verbs to add to the array. + def add_verb(nested_verbs) + @nested_verbs.push(*nested_verbs) + end + + # Return BXML representaion of this response + # @return [String] The XML response in string format. + def to_bxml + bxml = Ox.dump(generate_xml) + return bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>')} + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verb.rb b/lib/bandwidth-sdk/models/bxml/verb.rb new file mode 100644 index 00000000..03853462 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verb.rb @@ -0,0 +1,51 @@ +require 'ox' + +module Bandwidth + module Bxml + module Verb + # Initializer + # @param tag [String] Name of the XML element. + # @param content [String] XML element content. Defaults to nil. + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(tag, content = nil, attributes = {}) + @tag = tag + @content = content + @attributes = attributes + @attribute_map = [] + end + + # Set XML attributes for the verb + # @param attributes [Hash] The attributes to add to the element. + def set_attributes(attributes) + @attributes = attributes + end + + # Generate an XML element for the verb + # @return [Node] The XML element. + def generate_xml + root = Ox::Element.new(@tag) + if @content + root << @content + end + + if !@attributes.empty? + @attributes.each do |key, value| + if @attribute_map.include? key.to_sym + root[@attribute_map[key.to_sym]] = value + else + raise NoMethodError.new("attribute '#{key}' is not a valid attribute for this verb") + end + end + end + + return root + end + + # Return BXML representaion of this element + # @return [String] The XML element in string format. + def to_bxml + return Ox.dump(generate_xml) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb b/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb index 8235ebfc..73cb15ae 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb @@ -1,27 +1,29 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Bridge verb allows you to connect 2 calls +module Bandwidth + module Bxml class Bridge - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.Bridge(call_id, compact_hash({ - 'bridgeCompleteUrl' => bridge_complete_url, - 'bridgeCompleteMethod' => bridge_complete_method, - 'bridgeTargetCompleteUrl' => bridge_target_complete_url, - 'bridgeTargetCompleteMethod' => bridge_target_complete_method, - 'username' => username, - 'password' => password, - 'tag' => tag, - 'bridgeCompleteFallbackUrl' => bridge_complete_fallback_url, - 'bridgeCompleteFallbackMethod' => bridge_complete_fallback_method, - 'bridgeTargetCompleteFallbackUrl' => bridge_target_complete_fallback_url, - 'bridgeTargetCompleteFallbackMethod' => bridge_target_complete_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) + # Initializer + # @param target_call [String] The callId of the call to be bridged. + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(target_call, attributes = {}) + super("Bridge", target_call, attributes) + + @attribute_map = { + bridge_complete_url: 'bridgeCompleteUrl', # Optional [String]: URL to send the Bridge Complete event to and request new BXML. If this attribute is specified, then Verbs following the verb will be ignored and the BXML returned in this webhook is executed on the call. If this attribute is not specified then no webhook will be sent, and execution of the verbs following the verb continues. May be a relative URL. Defaults to None. + bridge_complete_method: 'bridgeCompleteMethod', # Optional [String]: The HTTP method to use for the request to bridgeCompleteUrl. GET or POST. Default value is POST. + bridge_complete_fallback_url: 'bridgeCompleteFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Bridge Complete webhook delivery in case bridgeCompleteUrl fails to respond. Defaults to None. + bridge_complete_fallback_method: 'bridgeCompleteFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Bridge Complete webhook to bridgeCompleteFallbackUrl. GET or POST. Default value is POST. + bridge_target_complete_url: 'bridgeTargetCompleteUrl', # Optional [String]: URL to send the Bridge Target Complete event to and request new BXML. If this attribute is specified, then the BXML returned in this webhook is executed on the target call. If this attribute is not specified then no webhook will be sent, and the target call will be hung up. May be a relative URL. Defaults to None. + bridge_target_complete_method: 'bridgeTargetCompleteMethod', # Optional [String]: The HTTP method to use for the request to bridgeTargetCompleteUrl. GET or POST. Default value is POST. + bridge_target_complete_fallback_url: 'bridgeTargetCompleteFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Bridge Target Complete webhook delivery in case bridgeTargetCompleteUrl fails to respond. Defaults to None. + bridge_target_complete_fallback_method: 'bridgeTargetCompleteFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Bridge Target Complete webhook to bridgeTargetCompleteFallbackUrl. GET or POST. Default value is POST. + username: 'username', # Optional [String]: The username to send in the HTTP request to bridgeCompleteUrl and to bridgeTargetCompleteUrl. Defaults to None. + password: 'password', # Optional [String]: The password to send in the HTTP request to bridgeCompleteUrl and to bridgeTargetCompleteUrl. Defaults to None. + fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to bridgeCompleteFallbackUrl and to bridgeTargetCompleteFallbackUrl. Defaults to None. + fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to bridgeCompleteFallbackUrl and to bridgeTargetCompleteFallbackUrl. Defaults to None. + tag: 'tag', # Optional [String]: A custom string that will be sent with the bridgeComplete webhook and all future webhooks of the call unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/conference.rb b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb index c4147a00..21467422 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/conference.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb @@ -1,32 +1,31 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Conference verb is used to add callees to conferences +module Bandwidth + module Bxml class Conference - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - if not call_ids_to_coach.nil? - coach_ids = call_ids_to_coach.instance_of?(String) ? call_ids_to_coach : call_ids_to_coach.join(",") - else - coach_ids = nil - end - xml.Conference(conference_name, compact_hash({ - 'mute' => mute, - 'hold' => hold, - 'callIdsToCoach' => coach_ids, - 'conferenceEventUrl' => conference_event_url, - 'conferenceEventMethod' => conference_event_method, - 'username' => username, - 'password' => password, - 'tag' => tag, - 'conferenceEventFallbackUrl' => conference_event_fallback_url, - 'conferenceEventFallbackMethod' => conference_event_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) + # Initializer + # @param name [String] The name of the conference. Can contain up to 100 characters of letters, numbers, and the symbols -, _, and . + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(name, attributes = {}) + super("Conference", name, attributes) + + @attribute_map = { + mute: 'mute', # Optional [Boolean]: A boolean value to indicate whether the member should be on mute in the conference. When muted, a member can hear others speak, but others cannot hear them speak. Defaults to false. + hold: 'hold', # Optional [Boolean]: A boolean value to indicate whether the member should be on hold in the conference. When on hold, a member cannot hear others, and they cannot be heard. Defaults to false. + call_ids_to_coach: 'callIdsToCoach', # Optional [String]: A comma-separated list of call ids to coach. When a call joins a conference with this attribute set, it will coach the listed calls. Those calls will be able to hear and be heard by the coach, but other calls in the conference will not hear the coach. + conference_event_url: 'conferenceEventUrl', # Optional [String]: URL to send Conference events to. The URL, method, username, and password are set by the BXML document that creates the conference, and all events related to that conference will be delivered to that same endpoint. If more calls join afterwards and also have this property (or any other webhook related properties like username and password), they will be ignored and the original webhook information will be used. This URL may be a relative endpoint. + conference_event_method: 'conferenceEventMethod', # Optional [String]: The HTTP method to use for the request to conferenceEventUrl. GET or POST. Default value is POST. + conference_event_fallback_url: 'conferenceEventFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the conference webhook deliveries in case conferenceEventUrl fails to respond. + conference_event_fallback_method: 'conferenceEventFallbackMethod', # Optional [String]: The HTTP method to use to deliver the conference webhooks to conferenceEventFallbackUrl. GET or POST. Default value is POST. + username: 'username', # Optional [String]: The username to send in the HTTP request to conferenceEventUrl. + password: 'password', # Optional [String]: The password to send in the HTTP request to conferenceEventUrl. + fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to conferenceEventFallbackUrl. + fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to conferenceEventFallbackUrl. + tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None. + callback_timeout: 'callbackTimeout', # Optional [Number]: This is the timeout (in seconds) to use when delivering webhooks for the conference. If not set, it will inherit the webhook timeout from the call that creates the conference. Can be any numeric value (including decimals) between 1 and 25. + } end end end end + diff --git a/lib/bandwidth-sdk/models/bxml/verbs/forward.rb b/lib/bandwidth-sdk/models/bxml/verbs/forward.rb index d429ae4a..6852764d 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/forward.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/forward.rb @@ -1,17 +1,21 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice +module Bandwidth + module Bxml class Forward - include XmlVerb - def to_bxml(xml) - xml.Forward(compact_hash({ - 'to' => to, - 'from' => from, - 'callTimeout' => call_timeout, - 'diversionTreatment' => diversion_treatment, - 'diversionReason' => diversion_reason - })) + include Bandwidth::Bxml::Verb + + # Initializer + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(attributes = {}) + super("Forward", nil, attributes) + + @attribute_map = { + to: 'to', # [String]: The phone number destination of the call. + from: 'from', # Optional [String]: The phone number that the recipient will receive the call from. + call_timeout: 'callTimeout', # Optional [Number]: The number of seconds to wait before timing out the call. + diversion_treatment: 'diversionTreatment', # Optional [String]: Can be any of the following: - none: No diversion headers are sent on the outbound leg of the transferred call. - propagate: Copy the Diversion header from the inbound leg to the outbound leg. Ignored if there is no Diversion header present on the inbound leg. - stack: After propagating any Diversion header from the inbound leg to the outbound leg, stack on top another Diversion header based on the Request-URI of the inbound call. If diversionTreatment is not specified, no diversion header will be included for the transfer even if one came with the inbound call. Defaults to None. + diversion_reason: 'diversionReason', # Optional [String]: Can be any of the following values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away. This parameter is considered only when diversionTreatment is set to stack. Defaults to None. + uui: 'uui', # Optional [String]: The value of the User-To-User header to send within the outbound INVITE when forwarding to a SIP URI. Must include the encoding parameter as specified in RFC 7433. Only base64 and jwt encoding are currently allowed. This value, including the encoding specifier, may not exceed 256 characters. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb index d898f8cd..451d330c 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb @@ -1,48 +1,43 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Gather verb is used to collect digits for some period of time +module Bandwidth + module Bxml class Gather - include XmlVerb + include Bandwidth::Bxml::NestableVerb + + # Initializer + # @param audio_verbs [Array] XML element children. Defaults to an empty array. Valid nested audio verbs are: SpeakSentence, PlayAudio. + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(audio_verbs = [], attributes = {}) + super("Gather", nil, audio_verbs, attributes) + + @attribute_map = { + gather_url: 'gatherUrl', # Optional [String]: URL to send Gather event to and request new BXML. May be a relative URL. + gather_method: 'gatherMethod', # Optional [String]: The HTTP method to use for the request to gather_url. GET or POST. Default value is POST. + gather_fallback_url: 'gatherFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Gather event callback delivery in case gather_url fails to respond. + gather_fallback_method: 'gatherFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Gather event callback to gather_fallback_url. GET or POST. Default value is POST. + username: 'username', # Optional [String]: The username to send in the HTTP request to gather_url. + password: 'password', # Optional [String]: The password to send in the HTTP request to gather_url. + fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to gather_fallback_url. + fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to gather_fallback_url. + tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters. + terminating_digits: 'terminatingDigits', # Optional [String]: When any of these digits are pressed, it will terminate the Gather. Default value is "", which disables this feature. + max_digits: 'maxDigits', # Optional [Number]: Max number of digits to collect. Default value is 50. Range: decimal values between 1 - 50. + inter_digit_timeout: 'interDigitTimeout', # Optional [Number]: Time (in seconds) allowed between digit presses before automatically terminating the Gather. Default value is 5. Range: decimal values between 1 - 60. + first_digit_timeout: 'firstDigitTimeout', # Optional [Number]: Time (in seconds) to pause after any audio from nested or verb is played (in seconds) before terminating the Gather. Default value is 5. Range: decimal values between 0 - 60. + repeat_count: 'repeat_count', # Optional [Number]: The number of times the audio prompt should be played if no digits are pressed. For example, if this value is 3, the nested audio clip will be played a maximum of three times. The delay between repetitions will be equal to first_digit_timeout. Default value is 1. repeat_count * number of verbs must not be greater than 20. + } + end + + # Return BXML representaion of this response + # @return [String] The XML response in string format. + def to_bxml + bxml = Ox.dump(generate_xml) + return bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>')} + end - def to_bxml(xml) - xml.Gather(compact_hash({ - 'gatherUrl' => gather_url, - 'gatherMethod' => gather_method, - 'terminatingDigits' => terminating_digits, - 'tag' => tag, - 'maxDigits' => max_digits, - 'interDigitTimeout' => inter_digit_timeout, - 'username' => username, - 'password' => password, - 'firstDigitTimeout' => first_digit_timeout, - 'repeatCount' => repeat_count, - 'gatherFallbackUrl' => gather_fallback_url, - 'gatherFallbackMethod' => gather_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) do - def embedded_xml(xml, property, type) - if property - s = if property.is_a?(type) - then property - else type.new(property) - end - s.to_bxml(xml) - end - end - def nest_verbs_list(xml, property) - if property - property.each do |verb| - verb.to_bxml(xml) - end - end - end - embedded_xml(xml, speak_sentence, SpeakSentence) - embedded_xml(xml, play_audio, PlayAudio) - nest_verbs_list(xml, nested_verbs) - end + # Add audio verb/s to the nested verbs array + # @param audio_verbs [SpeakSentence] || [PlayAudio] or [Array] Verb or verbs to add to the array. + def add_audio_verb(audio_verbs) + @nested_verbs.push(*audio_verbs) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb b/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb index d316ebfc..3b0a5aad 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb @@ -1,13 +1,11 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Hangup verb is used to hangup current call +module Bandwidth + module Bxml class Hangup - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.Hangup() + # Initializer + def initialize + super("Hangup", nil, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/pause.rb b/lib/bandwidth-sdk/models/bxml/verbs/pause.rb index 7c6dc966..14c03fd2 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/pause.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/pause.rb @@ -1,14 +1,16 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice +module Bandwidth + module Bxml class Pause - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.Pause(compact_hash({ - 'duration' => duration - })) + # Initializer + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(attributes = {}) + super("Pause", nil, attributes) + + @attribute_map = { + duration: 'duration', # Optional [Number]: The time in seconds to pause. Default value is 1. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb index 86cd439c..24d8f6ed 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb @@ -1,13 +1,11 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The PauseRecording verb is used to pause recording in a call +module Bandwidth + module Bxml class PauseRecording - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.PauseRecording() + # Initializer + def initialize + super("PauseRecording", nil, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb b/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb index 725dbdc0..3b82ef23 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb @@ -1,23 +1,27 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice +module Bandwidth + module Bxml class PhoneNumber - include XmlVerb - def to_bxml(xml) - xml.PhoneNumber(number, compact_hash({ - 'transferAnswerUrl' => transfer_answer_url, - 'transferAnswerMethod' => transfer_answer_method, - 'transferDisconnectUrl' => transfer_disconnect_url, - 'transferDisconnectMethod' => transfer_disconnect_method, - 'username' => username, - 'password' => password, - 'tag' => tag, - 'transferAnswerFallbackUrl' => transfer_answer_fallback_url, - 'transferAnswerFallbackMethod' => transfer_answer_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) + include Bandwidth::Bxml::Verb + + # Initializer + # @param number [String] A phone number to transfer the call to. Value must be in E.164 format (e.g. +15555555555). + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(number, attributes = {}) + super("PhoneNumber", number, attributes) + + @attribute_map = { + transfer_answer_url: 'transferAnswerUrl', # Optional [String]: URL, if any, to send the Transfer Answer event to and request BXML to be executed for the called party before the call is bridged. May be a relative URL. Defaults to None. + transfer_answer_method: 'transferAnswerMethod', # Optional [String]: The HTTP method to use for the request to transferAnswerUrl. GET or POST. Default value is POST. Defaults to None. + transfer_answer_fallback_url: 'transferAnswerFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Transfer Answer callback delivery in case transferAnswerUrl fails to respond. Defaults to None. + transfer_answer_fallback_method: 'transferAnswerFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Transfer Answer callback to transferAnswerFallbackUrl. GET or POST. Default value is POST. Defaults to None. + transfer_disconnect_url: 'transferDisconnectUrl', # Optional [String]: URL, if any, to send the Transfer Disconnect event to. This event will be sent regardless of how the transfer ends and may not be responded to with BXML. May be a relative URL. Defaults to None. + transfer_disconnect_method: 'transferDisconnectMethod', # Optional [String]: The HTTP method to use for the request to transferDisconnectUrl. GET or POST. Default value is POST. Defaults to Defaults to Defaults to None. + username: 'username', # Optional [String]: The username to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None. + password: 'password', # Optional [String]: The password to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None. + fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None. + fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None. + tag: 'tag', # Optional [String]: A custom string that will be sent with these and all future callbacks unless overwritten by a future tag attribute or cleared. May be cleared by setting tag="" Max length 256 characters. Defaults to None. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb b/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb index 59e7bfcb..93f86073 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb @@ -1,16 +1,18 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The PlayAudio verb is used to play an audio file in the call +module Bandwidth + module Bxml class PlayAudio - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.PlayAudio(url, compact_hash({ - 'username' => username, - 'password' => password - })) + # Initializer + # @param audio_uri [String] The URL of the audio file to play. May be a relative URL. + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(audio_uri, attributes = {}) + super("PlayAudio", audio_uri, attributes) + + @attribute_map = { + username: 'username', # Optional [String]: The username to send in the HTTP request to audio_uri. + password: 'password', # Optional [String]: The password to send in the HTTP request to audio_uri. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/record.rb b/lib/bandwidth-sdk/models/bxml/verbs/record.rb index ad2f6676..d1d01e6c 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/record.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/record.rb @@ -1,32 +1,33 @@ -require_relative 'xml_verb' - module Bandwidth - module Voice - # The Record verb is used to trigger call recording + module Bxml class Record - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.Record(compact_hash({ - 'tag' => tag, - 'username' => username, - 'password' => password, - 'recordCompleteUrl' => record_complete_url, - 'recordCompleteMethod' => record_complete_method, - 'recordingAvailableUrl' => recording_available_url, - 'recordingAvailableMethod' => recording_available_method, - 'terminatingDigits' => terminating_digits, - 'maxDuration' => max_duration, - 'fileFormat' => file_format, - 'transcribe' => transcribe, - 'transcriptionAvailableUrl' => transcription_available_url, - 'transcriptionAvailableMethod' => transcription_available_method, - 'silenceTimeout' => silence_timeout, - 'recordCompleteFallbackUrl' => record_complete_fallback_url, - 'recordCompleteFallbackMethod' => record_complete_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) + # Initializer + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(attributes = {}) + super("Record", nil, attributes) + + @attribute_map = { + record_complete_url: 'recordCompleteUrl', # Optional [String]: URL to send the Record Complete event to once the recording has ended. Accepts BXML, and may be a relative URL. This callback will not be sent if the recording ended due to the call hanging up. Defaults to None. + record_complete_method: 'recordCompleteMethod', # Optional [String]: The HTTP method to use for the request to recordCompleteUrl. GET or POST. Default value is POST. Defaults to None. + record_complete_fallback_url: 'recordCompleteFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Record Complete callback delivery in case recordCompleteUrl fails to respond. Defaults to None. + record_complete_fallback_method: 'recordCompleteFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Record Complete callback to recordCompleteFallbackUrl. GET or POST. Default value is POST. Defaults to None. + recording_available_url: 'recordingAvailableUrl', # Optional [String]: URL to send the Recording Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None. + recording_available_method: 'recordingAvailableMethod', # Optional [String]: The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default value is POST. Defaults to None. + transcribe: 'transcribe', # Optional [Boolean]: A boolean value to indicate that recording should be transcribed. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. Default is false. Defaults to None. + transcription_available_url: 'transcriptionAvailableUrl', # Optional [String]: URL to send the Transcription Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None. + transcription_available_method: 'transcriptionAvailableMethod', # Optional [String]: The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default value is POST. Defaults to None. + username: 'username', # Optional [String]: The username to send in the HTTP request to recordCompleteUrl, recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None. + password: 'password', # Optional [String]: The password to send in the HTTP request to recordCompleteUrl, recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None. + fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to recordCompleteFallbackUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None. + fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to recordCompleteFallbackUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None. + tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None. + terminating_digits: 'terminatingDigits', # Optional [String]: When pressed, this digit will terminate the recording. Default value is “#”. This feature can be disabled with "". Defaults to None. + max_duration: 'maxDuration', # Optional [Number]: Maximum length of recording (in seconds). Max 10800 (3 hours). Default value is 60. Defaults to None. + silence_timeout: 'silenceTimeout', # Optional [Number]: Length of silence after which to end the recording (in seconds). Max is equivalent to the maximum maxDuration value. Default value is 0, which means no timeout. Defaults to None. + file_format: 'fileFormat', # Optional [String]: The audio format that the recording will be saved as: mp3 or wav. Default value is wav. Defaults to None. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb b/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb index 80112e0b..d5d29ecb 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb @@ -1,23 +1,24 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Redirect verb is used to redirect the current XML execution to another URL +module Bandwidth + module Bxml class Redirect - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.Redirect(compact_hash({ - 'redirectUrl' => redirect_url, - 'redirectMethod' => redirect_method, - 'tag' => tag, - 'username' => username, - 'password' => password, - 'redirectFallbackUrl' => redirect_fallback_url, - 'redirectFallbackMethod' => redirect_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) + # Initializer + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(attributes = {}) + super("Redirect", nil, attributes) + + @attribute_map = { + redirect_url: 'redirectUrl', # [String]: URL to request new BXML from. A Redirect event will be sent to this endpoint. May be a relative URL. Defaults to None. + redirect_method: 'redirectMethod', # Optional [String]: The HTTP method to use for the request to redirectUrl. GET or POST. Defaults to None. + redirect_fallback_url: 'redirectFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Redirect callback delivery in case redirectUrl fails to respond. Defaults to None. + redirect_fallback_method: 'redirectFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Redirect callback to redirectFallbackUrl. GET or POST. Default value is POST. Defaults to None. + username: 'username', # Optional [String]: The username to send in the HTTP request to redirectUrl. Defaults to None. + password: 'password', # Optional [String]: The password to send in the HTTP request to redirectUrl. Defaults to None. + fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to redirectFallbackUrl. Defaults to None. + fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to redirectFallbackUrl. Defaults to None. + tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb index 09ec5ebf..e2ff1aea 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb @@ -1,13 +1,11 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The ResumeRecording verb is used to resume recording in a call +module Bandwidth + module Bxml class ResumeRecording - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.ResumeRecording() + # Initializer + def initialize + super("ResumeRecording", nil, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/ring.rb b/lib/bandwidth-sdk/models/bxml/verbs/ring.rb index d1a41c14..cfc1d196 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/ring.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/ring.rb @@ -1,15 +1,17 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice +module Bandwidth + module Bxml class Ring - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.Ring(compact_hash({ - 'duration' => duration, - 'answerCall' => answer_call - })) + # Initializer + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(attributes = {}) + super("Ring", nil, attributes) + + @attribute_map = { + duration: 'duration', # Optional [Number]: How many seconds to play ringing on the call. Default value is 5. Range: decimal values between 0.1 - 86400. + answer_call: 'answerCall', # Optional [Boolean]: A boolean indicating whether or not to answer the call when Ring is executed on an unanswered incoming call. Default value is 'true'. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb b/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb index f2c9a140..cbe673d7 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb @@ -1,15 +1,18 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice +module Bandwidth + module Bxml class SendDtmf - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.SendDtmf(dtmf, compact_hash({ - 'toneDuration' => tone_duration, - 'toneInterval' => tone_interval - })) + # Initializer + # @param digits [String] String containing the DTMF characters to be sent in a call. Allows a maximum of 50 characters. The digits will be sent one-by-one with a marginal delay. + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(digits, attributes = {}) + super("SendDtmf", digits, attributes) + + @attribute_map = { + tone_duration: 'toneDuration', # Optional [Number]: The length (in milliseconds) of each DTMF tone. Default value is 200. Range: decimal values between 50 - 5000. + tone_interval: 'toneInterval', # Optional [Number]: The duration of silence (in milliseconds) following each DTMF tone. Default value is 400. Range: decimal values between 50 - 5000. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb b/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb index 2465a8b0..9f320f29 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb @@ -1,24 +1,28 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice +module Bandwidth + module Bxml class SipUri - include XmlVerb - def to_bxml(xml) - xml.SipUri(uri, compact_hash({ - 'transferAnswerUrl' => transfer_answer_url, - 'transferAnswerMethod' => transfer_answer_method, - 'transferDisconnectUrl' => transfer_disconnect_url, - 'transferDisconnectMethod' => transfer_disconnect_method, - 'username' => username, - 'password' => password, - 'tag' => tag, - 'uui' => uui, - 'transferAnswerFallbackUrl' => transfer_answer_fallback_url, - 'transferAnswerFallbackMethod' => transfer_answer_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) + include Bandwidth::Bxml::Verb + + # Initializer + # @param uri [String] A SIP URI to transfer the call to (e.g. sip:user@server.com) + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(uri, attributes = {}) + super("SipUri", uri, attributes) + + @attribute_map = { + uui: 'uui', # Optional [String]: The value of the User-To-User header to send within the initial INVITE. Must include the encoding parameter as specified in RFC 7433. Only base64 and jwt encoding are currently allowed. This value, including the encoding specifier, may not exceed 256 characters. Defaults to None. + transfer_answer_url: 'transferAnswerUrl', # Optional [String]: URL, if any, to send the Transfer Answer event to and request BXML to be executed for the called party before the call is bridged. May be a relative URL. Defaults to None. + transfer_answer_method: 'transferAnswerMethod', # Optional [String]: The HTTP method to use for the request to transferAnswerUrl. GET or POST. Default value is POST. Defaults to None. + transfer_answer_fallback_url: 'transferAnswerFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Transfer Answer callback delivery in case transferAnswerUrl fails to respond. Defaults to None. + transfer_answer_fallback_method: 'transferAnswerFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Transfer Answer callback to transferAnswerFallbackUrl. GET or POST. Default value is POST. Defaults to None. + transfer_disconnect_url: 'transferDisconnectUrl', # Optional [String]: URL, if any, to send the Transfer Disconnect event to. This event will be sent regardless of how the transfer ends and may not be responded to with BXML. May be a relative URL. Defaults to None. + transfer_disconnect_method: 'transferDisconnectMethod', # Optional [String]: The HTTP method to use for the request to transferDisconnectUrl. GET or POST. Default value is POST. Defaults to Defaults to Defaults to None. + username: 'username', # Optional [String]: The username to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None. + password: 'password', # Optional [String]: The password to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None. + fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None. + fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None. + tag: 'tag', # Optional [String]: A custom string that will be sent with these and all future callbacks unless overwritten by a future tag attribute or cleared. May be cleared by setting tag="" Max length 256 characters. Defaults to None. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb index b43c9795..20cfac35 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb @@ -1,17 +1,26 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The SpeakSentence verb is used to convert any text into speak for the caller +module Bandwidth + module Bxml class SpeakSentence - include XmlVerb + include Bandwidth::Bxml::Verb + + # Initializer + # @param text [String] The text to speak. Cannot be blank. Can be a mixture of plain text and SSML tags. + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(text, attributes = {}) + super("SpeakSentence", text, attributes) + + @attribute_map = { + voice: 'voice', # Optional [String]: Selects the voice of the speaker. If the voice attribute is present, gender and locale are ignored. You can find a list of supported voices here: https://dev.bandwidth.com/docs/voice/bxml/speakSentence/#supported-voices + gender: 'gender', # Optional [String]: Selects the gender of the speaker. Valid values are "male" or "female". Default "female". + locale: 'locale', # Optional [String]: Selects the locale of the speaker. Default "en_US" + } + end - def to_bxml(xml) - xml.SpeakSentence(sentence, compact_hash({ - 'voice' => voice, - 'locale' => locale, - 'gender' => gender - })) + # Return BXML representaion of this response + # @return [String] The XML response in string format. + def to_bxml + bxml = Ox.dump(generate_xml) + return bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>')} end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb index 39454343..9571e642 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb @@ -1,19 +1,20 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StartGather verb is used to start a gather +module Bandwidth + module Bxml class StartGather - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.StartGather(compact_hash({ - 'username' => username, - 'password' => password, - 'tag' => tag, - 'dtmfUrl' => dtmf_url, - 'dtmfMethod' => dtmf_method, - })) + # Initializer + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(attributes = {}) + super("StartGather", nil, attributes) + + @attribute_map = { + dtmf_url: 'dtmfUrl', # [String]: URL to send the DTMF event to. May be a relative URL. + dtmf_method: 'dtmfMethod', # Optional [String]: The HTTP method to use for the request to dtmfUrl. GET or POST. Default value is POST. + username: 'username', # Optional [String]: The username to send in the HTTP request to dtmfUrl. Defaults to None. + password: 'password', # Optional [String]: The password to send in the HTTP request to dtmfUrl. Defaults to None. + tag: 'tag', # Optional [String]: A custom string that will be sent with these and all future callbacks unless overwritten by a future tag attribute or cleared. May be cleared by setting tag="" Max length 256 characters. Defaults to None. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb index 292ea88a..b1c4748e 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb @@ -1,24 +1,25 @@ -require_relative 'xml_verb' - module Bandwidth - module Voice - # The StartRecording verb is used to trigger call recording + module Bxml class StartRecording - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.StartRecording(compact_hash({ - 'tag' => tag, - 'username' => username, - 'password' => password, - 'recordingAvailableUrl' => recording_available_url, - 'recordingAvailableMethod' => recording_available_method, - 'fileFormat' => file_format, - 'multiChannel' => multi_channel, - 'transcribe' => transcribe, - 'transcriptionAvailableUrl' => transcription_available_url, - 'transcriptionAvailableMethod' => transcription_available_method - })) + # Initializer + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(attributes = {}) + super("StartRecording", nil, attributes) + + @attribute_map = { + recording_available_url: 'recordingAvailableUrl', # Optional [String]: URL to send the Recording Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None. + recording_available_method: 'recordingAvailableMethod', # Optional [String]: The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default value is POST. + transcribe: 'transcribe', # Optional [Boolean]: A boolean value to indicate that recording should be transcribed. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. Default is false. Defaults to None. + transcription_available_url: 'transcriptionAvailableUrl', # Optional [String]: URL to send the Transcription Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None. + transcription_available_method: 'transcriptionAvailableMethod', # Optional [String]: The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default value is POST. Defaults to None. + username: 'username', # Optional [String]: The username to send in the HTTP request to recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None. + password: 'password', # Optional [String]: The password to send in the HTTP request to recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None. + tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None. + file_format: 'fileFormat', # Optional [String]: The audio format that the recording will be saved as: mp3 or wav. Default value is wav. + multi_channel: 'multiChannel', # Optional [Boolean]: A boolean value indicating whether or not the recording file should separate each side of the call into its own audio channel. Default value is false. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb index 7b5fa526..d7ba9fdd 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb @@ -1,40 +1,29 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StartStream verb allows a segment of a call to be sent off to another destination for additional processing +module Bandwidth + module Bxml class StartStream - include XmlVerb + include Bandwidth::Bxml::NestableVerb + + # Initializer + # @param stream_params [Array] XML element children. Defaults to an empty array. Valid nested stream params are: StreamParam. You may specify up to 12 elements nested within a tag. + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(stream_params = [], attributes = {}) + super("StartStream", nil, stream_params, attributes) + + @attribute_map = { + name: 'name', # Optional [String]: A name to refer to this stream by. Used when sending . If not provided, it will default to the generated stream id as sent in the Media Stream Started webhook. + tracks: 'tracks', # Optional [String]: The part of the call to send a stream from. inbound, outbound or both. Default is inbound. + destination: 'destination', # Optional [String]: A websocket URI to send the stream to. The audio from the specified tracks will be sent via websocket to this URL as base64-encoded PCMU/G711 audio. + stream_event_url: 'streamEventUrl', # Optional [String]: URL to send the associated Webhook events to during this stream's lifetime. Does not accept BXML. May be a relative URL. + stream_event_method: 'streamEventMethod', # Optional [String]: The HTTP method to use for the request to streamEventUrl. GET or POST. Default value is POST. + username: 'username', # Optional [String]: The username to send in the HTTP request to streamEventUrl. If specified, the URLs must be TLS-encrypted (i.e., https). + password: 'password', # Optional [String]: The password to send in the HTTP request to streamEventUrl. If specified, the URLs must be TLS-encrypted (i.e., https). + } + end - def to_bxml(xml) - xml.StartStream(compact_hash({ - 'destination' => destination, - 'name' => name, - 'tracks' => tracks, - 'streamEventUrl' => streamEventUrl, - 'streamEventMethod' => streamEventMethod, - 'username' => username, - 'password' => password - })) do - def embedded_xml(xml, property, type) - if property - s = if property.is_a?(type) - then property - else type.new(property) - end - s.to_bxml(xml) - end - end - def nest_verbs_list(xml, property) - if property - property.each do |verb| - verb.to_bxml(xml) - end - end - end - embedded_xml(xml, stream_params, StreamParam) - nest_verbs_list(xml, nested_verbs) - end + # Add stream param/s to the nested verbs array + # @param stream_params [StreamParam] or [Array] Verb or verbs to add to the array. + def add_stream_param(stream_params) + @nested_verbs.push(*stream_params) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb index 0e4c5dae..700d9e83 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb @@ -1,13 +1,11 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StopGather verb is used to complete a gather +module Bandwidth + module Bxml class StopGather - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.StopGather() + # Initializer + def initialize + super("StopGather", nil, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb index eececb46..ac870044 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb @@ -1,13 +1,11 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StopRecording verb is used to stop recording in a call +module Bandwidth + module Bxml class StopRecording - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.StopRecording() + # Initializer + def initialize + super("StopRecording", nil, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb index 32920835..45896261 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb @@ -1,15 +1,16 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StopStream verb is used to stop a stream that was started with a previous `` verb +module Bandwidth + module Bxml class StopStream - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.StopStream(compact_hash({ - 'name' => name - })) + # Initializer + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(attributes = {}) + super("StopStream", nil, attributes) + + @attribute_map = { + name: 'name' # [String]: The name of the stream to stop. This is either the user selected name when sending the verb, or the system generated name returned in the Media Stream Started webhook if was sent with no name attribute. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb b/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb index 9c487b17..9962cf01 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb @@ -1,16 +1,17 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StartStream verb allows a segment of a call to be sent off to another destination for additional processing +module Bandwidth + module Bxml class StreamParam - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.StreamParam(compact_hash({ - 'name' => name, - 'value' => value - })) + # Initializer + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(attributes = {}) + super("StreamParam", nil, attributes) + + @attribute_map = { + name: 'name', # [String]: The name of this parameter, up to 256 characters. + value: 'value', # [String]: The value of this parameter, up to 2048 characters. + } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/tag.rb b/lib/bandwidth-sdk/models/bxml/verbs/tag.rb index 20e2f7d2..956a0725 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/tag.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/tag.rb @@ -1,12 +1,12 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice +module Bandwidth + module Bxml class Tag - include XmlVerb + include Bandwidth::Bxml::Verb - def to_bxml(xml) - xml.Tag(tag) + # Initializer + # @param content [String] Custom tag value. Defaults to nil. + def initialize(content = nil) + super("Tag", content, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb b/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb index 680da916..5a0f1f0d 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb @@ -1,47 +1,35 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The Transfer verb is used to transfer the call to another number +module Bandwidth + module Bxml class Transfer - include XmlVerb + include Bandwidth::Bxml::NestableVerb + + # Initializer + # @param transfer_to [Array] XML element children. Defaults to an empty array. Valid nested transfer verbs are: PhoneNumber, SipUri. + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(transfer_to = [], attributes = {}) + super("Transfer", nil, transfer_to, attributes) + + @attribute_map = { + transfer_caller_id: 'transferCallerId', # Optional [String]: The caller ID to use when the call is transferred, if different. Must be in E.164 format (e.g. +15555555555) or be one of the following strings Restricted, Anonymous, Private, or Unavailable. Leave as default to pass along the number of the remote party. Defaults to None. + call_timeout: 'callTimeout', # Optional [Number]: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. Range: decimal values between 1 - 300. Default value is 30 seconds. Defaults to None. + transfer_complete_url: 'transferCompleteUrl', # Optional [String]: URL to send the Transfer Complete event to and request new BXML. Optional but recommended. See below for further details. May be a relative URL. Defaults to None. + transfer_complete_method: 'transferCompleteMethod', # Optional [String]: The HTTP method to use for the request to transferCompleteUrl. GET or POST. Default value is POST. Defaults to None. + transfer_complete_fallback_url: 'transferCompleteFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Transfer Complete callback delivery in case transferCompleteUrl fails to respond. Defaults to None. + transfer_complete_fallback_method: 'transferCompleteFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Transfer Complete callback to transferCompleteFallbackUrl. GET or POST. Default value is POST. Defaults to None. + username: 'username', # Optional [String]: The username to send in the HTTP request to transferCompleteUrl. Defaults to None. + password: 'password', # Optional [String]: The password to send in the HTTP request to transferCompleteUrl. Defaults to None. + fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to transferCompleteFallbackUrl. Defaults to None. + fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to transferCompleteFallbackUrl. Defaults to None. + tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or cleared. May be cleared by setting tag="" Max length 256 characters. Defaults to None. + diversion_treatment: 'diversionTreatment', # Optional [String]: Can be any of the following: - none: No diversion headers are sent on the outbound leg of the transferred call. - propagate: Copy the Diversion header from the inbound leg to the outbound leg. Ignored if there is no Diversion header present on the inbound leg. - stack: After propagating any Diversion header from the inbound leg to the outbound leg, stack on top another Diversion header based on the Request-URI of the inbound call. If diversionTreatment is not specified, no diversion header will be included for the transfer even if one came with the inbound call. Defaults to None. + diversion_reason: 'diversionReason', # Optional [String]: Can be any of the following values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away. This parameter is considered only when diversionTreatment is set to stack. Defaults to None. + } + end - def to_bxml(xml) - xml.Transfer(compact_hash({ - 'transferCallerId' => transfer_caller_id, - 'callTimeout' => call_timeout, - 'tag' => tag, - 'transferCompleteUrl' => transfer_complete_url, - 'transferCompleteMethod' => transfer_complete_method, - 'username' => username, - 'password' => password, - 'diversionTreatment' => diversion_treatment, - 'diversionReason' => diversion_reason, - 'transferCompleteFallbackUrl' => transfer_complete_fallback_url, - 'transferCompleteFallbackMethod' => transfer_complete_fallback_method, - 'fallbackUsername' => fallback_username, - 'fallbackPassword' => fallback_password - })) do - def embedded_xml(xml, property, type) - if property - s = if property.is_a?(type) - then property - else type.new(property) - end - s.to_bxml(xml) - end - end - if not phone_numbers.nil? - phone_numbers.each do |number| - embedded_xml(xml, number, PhoneNumber) - end - end - if not sip_uris.nil? - sip_uris.each do |sip_uri| - embedded_xml(xml, sip_uri, SipUri) - end - end - end + # Add transfer recipient/s to the nested verbs array + # @param recipients [PhoneNumber] || [SipUri] or [Array] Verb or verbs to add to the array. + def add_transfer_recipient(recipients) + @nested_verbs.push(*recipients) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/xml_verb.rb b/lib/bandwidth-sdk/models/bxml/verbs/xml_verb.rb deleted file mode 100644 index 8233a934..00000000 --- a/lib/bandwidth-sdk/models/bxml/verbs/xml_verb.rb +++ /dev/null @@ -1,26 +0,0 @@ -module Bandwidth - module Voice - module XmlVerb - def initialize(data = nil) - @data = (data || {}).clone() - end - - def method_missing(name, *args, &block) - if name[name.size - 1] == '=' - @data[name[0..-2].to_sym] = args[0] - else - @data[name] - end - end - - def compact_hash(hash) - hash.inject({}) do |new_hash, (k,v)| - if !v.nil? - new_hash[k] = v.class == Hash ? compact_hash(v) : v - end - new_hash - end - end - end - end -end diff --git a/spec/unit/models/bxml/bxml_spec.rb b/spec/unit/models/bxml/bxml_spec.rb new file mode 100644 index 00000000..62943263 --- /dev/null +++ b/spec/unit/models/bxml/bxml_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Bxml +describe 'Bandwidth::Bxml::Bxml' do + let(:instance) { Bandwidth::Bxml::Bxml.new } + + describe 'test an instance of Bxml' do + it 'validates instance of Bxml' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Bxml) + expect(instance).to be_a(Bandwidth::Bxml::Root) + end + + it 'test the to_bxml method of the Bxml instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/nestable_verb_spec.rb b/spec/unit/models/bxml/nestable_verb_spec.rb new file mode 100644 index 00000000..423e90fc --- /dev/null +++ b/spec/unit/models/bxml/nestable_verb_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::NestableVerb +describe 'Bandwidth::Bxml::NestableVerb' do + let(:instance) { Class.new.include(Bandwidth::Bxml::NestableVerb).new('Test') } + + describe 'test an instance of NestableVerb' do + it 'validates instance of NestableVerb' do + expect(instance).to be_a(Bandwidth::Bxml::NestableVerb) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + end +end diff --git a/spec/unit/models/bxml/response_spec.rb b/spec/unit/models/bxml/response_spec.rb new file mode 100644 index 00000000..420ec57f --- /dev/null +++ b/spec/unit/models/bxml/response_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Response +describe 'Bandwidth::Bxml::Response' do + let(:instance) { Bandwidth::Bxml::Response.new } + + describe 'test an instance of Response' do + it 'validates instance of Response' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Response) + expect(instance).to be_a(Bandwidth::Bxml::Root) + end + + it 'test the to_bxml method of the Response instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verb_spec.rb b/spec/unit/models/bxml/verb_spec.rb new file mode 100644 index 00000000..55f08270 --- /dev/null +++ b/spec/unit/models/bxml/verb_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Verb +describe 'Bandwidth::Bxml::Verb' do + let(:instance) { Class.new.include(Bandwidth::Bxml::Verb).new('Test') } + + describe 'test an instance of Verb' do + it 'validates instance of Verb' do + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Verb instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests invalid attribute' do + attributes = {'invalid_attribute' => 'invalid'} + instance.set_attributes(attributes) + + expect { + instance.generate_xml + }.to raise_error { |e| + expect(e).to be_a(NoMethodError) + } + end + end +end diff --git a/spec/unit/models/bxml/verbs/bridge_spec.rb b/spec/unit/models/bxml/verbs/bridge_spec.rb new file mode 100644 index 00000000..71454d3f --- /dev/null +++ b/spec/unit/models/bxml/verbs/bridge_spec.rb @@ -0,0 +1,60 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Bridge +describe 'Bandwidth::Bxml::Bridge' do + let(:initial_attributes) { + { + bridge_complete_url: 'https://initial.com', + bridge_complete_method: 'POST', + bridge_complete_fallback_url: 'https://initial.com', + bridge_complete_fallback_method: 'POST', + bridge_target_complete_url: 'https://initial.com', + bridge_target_complete_method: 'POST', + bridge_target_complete_fallback_url: 'https://initial.com', + bridge_target_complete_fallback_method: 'POST', + username: 'initial_username', + password: 'initial_password', + fallback_username: 'initial_fallback_username', + fallback_password: 'initial_fallback_password', + tag: 'initial_tag' + } + } + + let(:new_attributes) { + { + bridge_complete_url: 'https://new.com', + bridge_complete_method: 'GET', + bridge_complete_fallback_url: 'https://new.com', + bridge_complete_fallback_method: 'GET', + bridge_target_complete_url: 'https://new.com', + bridge_target_complete_method: 'GET', + bridge_target_complete_fallback_url: 'https://new.com', + bridge_target_complete_fallback_method: 'GET', + username: 'new_username', + password: 'new_password', + fallback_username: 'new_fallback_username', + fallback_password: 'new_fallback_password', + tag: 'new_tag' + } + } + + let(:instance) { Bandwidth::Bxml::Bridge.new('c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', initial_attributes) } + + describe 'test an instance of Bridge' do + it 'validates instance of Bridge' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Bridge) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Bridge instance' do + expected = "\nc-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the Bridge instance' do + instance.set_attributes(new_attributes) + expected = "\nc-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/conference_spec.rb b/spec/unit/models/bxml/verbs/conference_spec.rb new file mode 100644 index 00000000..4d7710ac --- /dev/null +++ b/spec/unit/models/bxml/verbs/conference_spec.rb @@ -0,0 +1,60 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Conference +describe 'Bandwidth::Bxml::Conference' do + let(:initial_attributes) { + { + mute: true, + hold: true, + call_ids_to_coach: 'initial', + conference_event_url: 'https://initial.com', + conference_event_method: 'POST', + conference_event_fallback_url: 'https://initial.com', + conference_event_fallback_method: 'POST', + username: 'initial_username', + password: 'initial_password', + fallback_username: 'initial_fallback_username', + fallback_password: 'initial_fallback_password', + tag: 'initial_tag', + callback_timeout: 5.0 + } + } + + let(:new_attributes) { + { + mute: false, + hold: false, + call_ids_to_coach: 'new', + conference_event_url: 'https://new.com', + conference_event_method: 'GET', + conference_event_fallback_url: 'https://new.com', + conference_event_fallback_method: 'GET', + username: 'new_username', + password: 'new_password', + fallback_username: 'new_fallback_username', + fallback_password: 'new_fallback_password', + tag: 'new_tag', + callback_timeout: 10.0 + } + } + + let(:instance) { Bandwidth::Bxml::Conference.new('conference_name', initial_attributes) } + + describe 'test an instance of Conference' do + it 'validates instance of Conference' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Conference) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Conference instance' do + expected = "\nconference_name\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the Conference instance' do + instance.set_attributes(new_attributes) + expected = "\nconference_name\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/forward_spec.rb b/spec/unit/models/bxml/verbs/forward_spec.rb new file mode 100644 index 00000000..f032f873 --- /dev/null +++ b/spec/unit/models/bxml/verbs/forward_spec.rb @@ -0,0 +1,46 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Forward +describe 'Bandwidth::Bxml::Forward' do + let(:initial_attributes) { + { + to: '+19195551234', + from: '+19195554321', + call_timeout: 5, + diversion_treatment: 'propogate', + diversion_reason: 'user-busy', + uui: '93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt' + } + } + + let(:new_attributes) { + { + to: '+19195554321', + from: '+19195551234', + call_timeout: 10, + diversion_treatment: 'stack', + diversion_reason: 'no-answer', + uui: '4fa28015d8ede84bd1a493d6f3c0be5845960b74;encoding=base64,fdsa;encoding=jwt' + } + } + + let(:instance) { Bandwidth::Bxml::Forward.new(initial_attributes) } + + describe 'test an instance of Forward' do + it 'validates instance of Forward' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Forward) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Forward instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the Forward instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/gather_spec.rb b/spec/unit/models/bxml/verbs/gather_spec.rb new file mode 100644 index 00000000..a105e6c4 --- /dev/null +++ b/spec/unit/models/bxml/verbs/gather_spec.rb @@ -0,0 +1,88 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Gather +describe 'Bandwidth::Bxml::Gather' do + let(:initial_attributes) { + { + gather_url: 'https://initial.com', + gather_method: 'POST', + gather_fallback_url: 'https://initial.com', + gather_fallback_method: 'POST', + username: 'initial_username', + password: 'initial_password', + fallback_username: 'initial_fallback_username', + fallback_password: 'initial_fallback_password', + tag: 'initial_tag', + terminating_digits: '5', + max_digits: 5, + inter_digit_timeout: 5, + first_digit_timeout: 5, + repeat_count: 5 + } + } + + let(:new_attributes) { + { + gather_url: 'https://new.com', + gather_method: 'POST', + gather_fallback_url: 'https://new.com', + gather_fallback_method: 'GET', + username: 'new_username', + password: 'new_password', + fallback_username: 'new_fallback_username', + fallback_password: 'new_fallback_password', + tag: 'new_tag', + terminating_digits: '10', + max_digits: 10, + inter_digit_timeout: 10, + first_digit_timeout: 10, + repeat_count: 10 + } + } + + let (:play_audio) { Bandwidth::Bxml::PlayAudio.new('https://audio.url/audio1.wav') } + let (:speak_sentence) { Bandwidth::Bxml::SpeakSentence.new('Holaruby speak sentence SSML test') } + + let(:instance) { Bandwidth::Bxml::Gather.new([], initial_attributes) } + let(:instance_nested) { Bandwidth::Bxml::Gather.new([play_audio], initial_attributes) } + + describe 'test an instance of Gather' do + it 'validates instance of Gather' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Gather) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Gather instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the Gather instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end + + describe 'test an instance of Gather with nested verbs' do + it 'validates instance of Gather' do + expect(instance_nested).to be_instance_of(Bandwidth::Bxml::Gather) + expect(instance_nested).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the nested Gather instance' do + expected = "\n\n https://audio.url/audio1.wav\n\n" + expect(instance_nested.to_bxml).to eq(expected) + end + + it 'tests the add_verb method of the nested Gather instance' do + expected_single = "\n\n https://audio.url/audio1.wav\n Holaruby speak sentence SSML test\n\n" + instance_nested.add_audio_verb(speak_sentence) + expect(instance_nested.to_bxml).to eq(expected_single) + + expected_multiple = "\n\n https://audio.url/audio1.wav\n Holaruby speak sentence SSML test\n Holaruby speak sentence SSML test\n https://audio.url/audio1.wav\n\n" + instance_nested.add_audio_verb([speak_sentence, play_audio]) + expect(instance_nested.to_bxml).to eq(expected_multiple) + end + end +end diff --git a/spec/unit/models/bxml/verbs/hangup_spec.rb b/spec/unit/models/bxml/verbs/hangup_spec.rb new file mode 100644 index 00000000..836a3e62 --- /dev/null +++ b/spec/unit/models/bxml/verbs/hangup_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Hangup +describe 'Bandwidth::Bxml::Hangup' do + let(:instance) { Bandwidth::Bxml::Hangup.new } + + describe 'test an instance of Hangup' do + it 'validates instance of Hangup' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Hangup) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Hangup instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/pause_recording_spec.rb b/spec/unit/models/bxml/verbs/pause_recording_spec.rb new file mode 100644 index 00000000..8045cccd --- /dev/null +++ b/spec/unit/models/bxml/verbs/pause_recording_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::PauseRecording +describe 'Bandwidth::Bxml::PauseRecording' do + let(:instance) { Bandwidth::Bxml::PauseRecording.new } + + describe 'test an instance of PauseRecording' do + it 'validates instance of PauseRecording' do + expect(instance).to be_instance_of(Bandwidth::Bxml::PauseRecording) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the PauseRecording instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/pause_spec.rb b/spec/unit/models/bxml/verbs/pause_spec.rb new file mode 100644 index 00000000..35918ef9 --- /dev/null +++ b/spec/unit/models/bxml/verbs/pause_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Pause +describe 'Bandwidth::Bxml::Pause' do + let(:initial_attributes) { + { + duration: 5 + } + } + + let(:new_attributes) { + { + duration: 10 + } + } + + let(:instance) { Bandwidth::Bxml::Pause.new(initial_attributes) } + + describe 'test an instance of Pause' do + it 'validates instance of Pause' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Pause) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Pause instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the Pause instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/phone_number_spec.rb b/spec/unit/models/bxml/verbs/phone_number_spec.rb new file mode 100644 index 00000000..4d02c513 --- /dev/null +++ b/spec/unit/models/bxml/verbs/phone_number_spec.rb @@ -0,0 +1,56 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::PhoneNumber +describe 'Bandwidth::Bxml::PhoneNumber' do + let(:initial_attributes) { + { + transfer_answer_url: 'https://initial.com', + transfer_answer_method: 'POST', + transfer_answer_fallback_url: 'https://initial.com', + transfer_answer_fallback_method: 'POST', + transfer_disconnect_url: 'https://initial.com', + transfer_disconnect_method: 'POST', + username: 'initial_username', + password: 'initial_password', + fallback_username: 'initial_fallback_username', + fallback_password: 'initial_fallback_password', + tag: 'initial_tag' + } + } + + let(:new_attributes) { + { + transfer_answer_url: 'https://new.com', + transfer_answer_method: 'GET', + transfer_answer_fallback_url: 'https://new.com', + transfer_answer_fallback_method: 'GET', + transfer_disconnect_url: 'https://new.com', + transfer_disconnect_method: 'GET', + username: 'new_username', + password: 'new_password', + fallback_username: 'new_fallback_username', + fallback_password: 'new_fallback_password', + tag: 'new_tag' + } + } + + let(:instance) { Bandwidth::Bxml::PhoneNumber.new('+19195551234', initial_attributes) } + + describe 'test an instance of PhoneNumber' do + it 'validates instance of PhoneNumber' do + expect(instance).to be_instance_of(Bandwidth::Bxml::PhoneNumber) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the PhoneNumber instance' do + expected = "\n+19195551234\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the PhoneNumber instance' do + instance.set_attributes(new_attributes) + expected = "\n+19195551234\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/play_audio_spec.rb b/spec/unit/models/bxml/verbs/play_audio_spec.rb new file mode 100644 index 00000000..76d51195 --- /dev/null +++ b/spec/unit/models/bxml/verbs/play_audio_spec.rb @@ -0,0 +1,38 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::PlayAudio +describe 'Bandwidth::Bxml::PlayAudio' do + let(:initial_attributes) { + { + username: 'initial_username', + password: 'initial_password' + } + } + + let(:new_attributes) { + { + username: 'new_username', + password: 'new_password' + } + } + + let(:instance) { Bandwidth::Bxml::PlayAudio.new('https://audio.url/audio1.wav', initial_attributes) } + + describe 'test an instance of PlayAudio' do + it 'validates instance of PlayAudio' do + expect(instance).to be_instance_of(Bandwidth::Bxml::PlayAudio) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the PlayAudio instance' do + expected = "\nhttps://audio.url/audio1.wav\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the PlayAudio instance' do + instance.set_attributes(new_attributes) + expected = "\nhttps://audio.url/audio1.wav\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/record_spec.rb b/spec/unit/models/bxml/verbs/record_spec.rb new file mode 100644 index 00000000..2633ce92 --- /dev/null +++ b/spec/unit/models/bxml/verbs/record_spec.rb @@ -0,0 +1,70 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Record +describe 'Bandwidth::Bxml::Record' do + let(:initial_attributes) { + { + record_complete_url: 'https://initial.com', + record_complete_method: 'POST', + record_complete_fallback_url: 'https://initial.com', + record_complete_fallback_method: 'POST', + recording_available_url: 'https://initial.com', + recording_available_method: 'POST', + transcribe: true, + transcription_available_url: 'https://initial.com', + transcription_available_method: 'POST', + username: 'initial_username', + password: 'initial_password', + fallback_username: 'initial_fallback_username', + fallback_password: 'initial_fallback_password', + tag: 'initial_tag', + terminating_digits: '5', + max_duration: 5, + silence_timeout: 5, + file_format: 'wav' + } + } + + let(:new_attributes) { + { + record_complete_url: 'https://new.com', + record_complete_method: 'GET', + record_complete_fallback_url: 'https://new.com', + record_complete_fallback_method: 'GET', + recording_available_url: 'https://new.com', + recording_available_method: 'GET', + transcribe: true, + transcription_available_url: 'https://new.com', + transcription_available_method: 'GET', + username: 'new_username', + password: 'new_password', + fallback_username: 'new_fallback_username', + fallback_password: 'new_fallback_password', + tag: 'new_tag', + terminating_digits: '0', + max_duration: 10, + silence_timeout: 10, + file_format: 'mp3' + } + } + + let(:instance) { Bandwidth::Bxml::Record.new(initial_attributes) } + + describe 'test an instance of Record' do + it 'validates instance of Record' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Record) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Record instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the Record instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/redirect_spec.rb b/spec/unit/models/bxml/verbs/redirect_spec.rb new file mode 100644 index 00000000..69aa068e --- /dev/null +++ b/spec/unit/models/bxml/verbs/redirect_spec.rb @@ -0,0 +1,52 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Redirect +describe 'Bandwidth::Bxml::Redirect' do + let(:initial_attributes) { + { + redirect_url: 'https://initial.com', + redirect_method: 'POST', + redirect_fallback_url: 'https://initial.com', + redirect_fallback_method: 'POST', + username: 'initial_username', + password: 'initial_password', + fallback_username: 'initial_fallback_username', + fallback_password: 'initial_fallback_password', + tag: 'initial_tag' + } + } + + let(:new_attributes) { + { + redirect_url: 'https://new.com', + redirect_method: 'GET', + redirect_fallback_url: 'https://new.com', + redirect_fallback_method: 'GET', + username: 'new_username', + password: 'new_password', + fallback_username: 'new_fallback_username', + fallback_password: 'new_fallback_password', + tag: 'new_tag' + } + } + + let(:instance) { Bandwidth::Bxml::Redirect.new(initial_attributes) } + + describe 'test an instance of Redirect' do + it 'validates instance of Redirect' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Redirect) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Redirect instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the Redirect instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/resume_recording_spec.rb b/spec/unit/models/bxml/verbs/resume_recording_spec.rb new file mode 100644 index 00000000..f599b9cc --- /dev/null +++ b/spec/unit/models/bxml/verbs/resume_recording_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::ResumeRecording +describe 'Bandwidth::Bxml::ResumeRecording' do + let(:instance) { Bandwidth::Bxml::ResumeRecording.new } + + describe 'test an instance of ResumeRecording' do + it 'validates instance of ResumeRecording' do + expect(instance).to be_instance_of(Bandwidth::Bxml::ResumeRecording) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the ResumeRecording instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/ring_spec.rb b/spec/unit/models/bxml/verbs/ring_spec.rb new file mode 100644 index 00000000..14089ee4 --- /dev/null +++ b/spec/unit/models/bxml/verbs/ring_spec.rb @@ -0,0 +1,38 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Ring +describe 'Bandwidth::Bxml::Ring' do + let(:initial_attributes) { + { + duration: 5.0, + answer_call: true + } + } + + let(:new_attributes) { + { + duration: 10.0, + answer_call: false + } + } + + let(:instance) { Bandwidth::Bxml::Ring.new(initial_attributes) } + + describe 'test an instance of Ring' do + it 'validates instance of Ring' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Ring) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Ring instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the Ring instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/send_dtmf_spec.rb b/spec/unit/models/bxml/verbs/send_dtmf_spec.rb new file mode 100644 index 00000000..757a8ace --- /dev/null +++ b/spec/unit/models/bxml/verbs/send_dtmf_spec.rb @@ -0,0 +1,38 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::SendDtmf +describe 'Bandwidth::Bxml::SendDtmf' do + let(:initial_attributes) { + { + tone_duration: 5, + tone_interval: 5 + } + } + + let(:new_attributes) { + { + tone_duration: 10, + tone_interval: 10 + } + } + + let(:instance) { Bandwidth::Bxml::SendDtmf.new('1234', initial_attributes) } + + describe 'test an instance of SendDtmf' do + it 'validates instance of SendDtmf' do + expect(instance).to be_instance_of(Bandwidth::Bxml::SendDtmf) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the SendDtmf instance' do + expected = "\n1234\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the SendDtmf instance' do + instance.set_attributes(new_attributes) + expected = "\n1234\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/sip_uri_spec.rb b/spec/unit/models/bxml/verbs/sip_uri_spec.rb new file mode 100644 index 00000000..149ad1b5 --- /dev/null +++ b/spec/unit/models/bxml/verbs/sip_uri_spec.rb @@ -0,0 +1,58 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::SipUri +describe 'Bandwidth::Bxml::SipUri' do + let(:initial_attributes) { + { + uui: 'abc123', + transfer_answer_url: 'https://initial.com', + transfer_answer_method: 'POST', + transfer_answer_fallback_url: 'https://initial.com', + transfer_answer_fallback_method: 'POST', + transfer_disconnect_url: 'https://initial.com', + transfer_disconnect_method: 'POST', + username: 'initial_username', + password: 'initial_password', + fallback_username: 'initial_fallback_username', + fallback_password: 'initial_fallback_password', + tag: 'initial_tag' + } + } + + let(:new_attributes) { + { + uui: '123abc', + transfer_answer_url: 'https://new.com', + transfer_answer_method: 'GET', + transfer_answer_fallback_url: 'https://new.com', + transfer_answer_fallback_method: 'GET', + transfer_disconnect_url: 'https://new.com', + transfer_disconnect_method: 'GET', + username: 'new_username', + password: 'new_password', + fallback_username: 'new_fallback_username', + fallback_password: 'new_fallback_password', + tag: 'new_tag' + } + } + + let(:instance) { Bandwidth::Bxml::SipUri.new('sip:1-999-123-4567@voip-provider.example.net', initial_attributes) } + + describe 'test an instance of SipUri' do + it 'validates instance of SipUri' do + expect(instance).to be_instance_of(Bandwidth::Bxml::SipUri) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the SipUri instance' do + expected = "\nsip:1-999-123-4567@voip-provider.example.net\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the SipUri instance' do + instance.set_attributes(new_attributes) + expected = "\nsip:1-999-123-4567@voip-provider.example.net\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/speak_sentence_spec.rb b/spec/unit/models/bxml/verbs/speak_sentence_spec.rb new file mode 100644 index 00000000..14ebcadc --- /dev/null +++ b/spec/unit/models/bxml/verbs/speak_sentence_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::SpeakSentence +describe 'Bandwidth::Bxml::SpeakSentence' do + let(:initial_attributes) { + { + voice: 'julie', + gender: 'female', + locale: 'en_US' + } + } + + let(:new_attributes) { + { + voice: 'simon', + gender: 'male', + locale: 'en_UK' + } + } + + let(:instance) { Bandwidth::Bxml::SpeakSentence.new('Holaruby speak sentence SSML test', initial_attributes) } + + describe 'test an instance of SpeakSentence' do + it 'validates instance of SpeakSentence' do + expect(instance).to be_instance_of(Bandwidth::Bxml::SpeakSentence) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the SpeakSentence instance' do + expected = "\nHolaruby speak sentence SSML test\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the SpeakSentence instance' do + instance.set_attributes(new_attributes) + expected = "\nHolaruby speak sentence SSML test\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/start_gather_spec.rb b/spec/unit/models/bxml/verbs/start_gather_spec.rb new file mode 100644 index 00000000..1bf0e37c --- /dev/null +++ b/spec/unit/models/bxml/verbs/start_gather_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::StartGather +describe 'Bandwidth::Bxml::StartGather' do + let(:initial_attributes) { + { + dtmf_url: 'https://initial.com', + dtmf_method: 'POST', + username: 'initial_username', + password: 'initial_password', + tag: 'initial_tag' + } + } + + let(:new_attributes) { + { + dtmf_url: 'https://new.com', + dtmf_method: 'GET', + username: 'new_username', + password: 'new_password', + tag: 'new_tag' + } + } + + let(:instance) { Bandwidth::Bxml::StartGather.new(initial_attributes) } + + describe 'test an instance of StartGather' do + it 'validates instance of StartGather' do + expect(instance).to be_instance_of(Bandwidth::Bxml::StartGather) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the StartGather instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the StartGather instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/start_recording_spec.rb b/spec/unit/models/bxml/verbs/start_recording_spec.rb new file mode 100644 index 00000000..7d81feb9 --- /dev/null +++ b/spec/unit/models/bxml/verbs/start_recording_spec.rb @@ -0,0 +1,54 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::StartRecording +describe 'Bandwidth::Bxml::StartRecording' do + let(:initial_attributes) { + { + recording_available_url: 'https://initial.com', + recording_available_method: 'POST', + transcribe: true, + transcription_available_url: 'https://initial.com', + transcription_available_method: 'POST', + username: 'initial_username', + password: 'initial_password', + tag: 'initial_tag', + file_format: 'wav', + multi_channel: true + } + } + + let(:new_attributes) { + { + recording_available_url: 'https://new.com', + recording_available_method: 'GET', + transcribe: false, + transcription_available_url: 'https://new.com', + transcription_available_method: 'GET', + username: 'new_username', + password: 'new_password', + tag: 'new_tag', + file_format: 'mp3', + multi_channel: false + } + } + + let(:instance) { Bandwidth::Bxml::StartRecording.new(initial_attributes) } + + describe 'test an instance of StartRecording' do + it 'validates instance of StartRecording' do + expect(instance).to be_instance_of(Bandwidth::Bxml::StartRecording) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the StartRecording instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the StartRecording instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/start_stream_spec.rb b/spec/unit/models/bxml/verbs/start_stream_spec.rb new file mode 100644 index 00000000..2fd99fa1 --- /dev/null +++ b/spec/unit/models/bxml/verbs/start_stream_spec.rb @@ -0,0 +1,74 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::StartStream +describe 'Bandwidth::Bxml::StartStream' do + let(:initial_attributes) { + { + name: 'initial_name', + tracks: 'inbound', + destination: 'https://initial.com', + stream_event_url: 'https://initial.com', + stream_event_method: 'POST', + username: 'initial_username', + password: 'initial_password' + } + } + + let(:new_attributes) { + { + name: 'new_name', + tracks: 'outbound', + destination: 'https://new.com', + stream_event_url: 'https://new.com', + stream_event_method: 'GET', + username: 'new_username', + password: 'new_password' + } + } + + let (:stream_param_1) { Bandwidth::Bxml::StreamParam.new({name: 'stream_param_name_1', value: 'stream_param_value_1'}) } + let (:stream_param_2) { Bandwidth::Bxml::StreamParam.new({name: 'stream_param_name_2', value: 'stream_param_value_2'}) } + + let(:instance) { Bandwidth::Bxml::StartStream.new([], initial_attributes) } + let(:instance_nested) { Bandwidth::Bxml::StartStream.new([stream_param_1], initial_attributes) } + + describe 'test an instance of StartStream' do + it 'validates instance of StartStream' do + expect(instance).to be_instance_of(Bandwidth::Bxml::StartStream) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the StartStream instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the StartStream instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end + + describe 'test an instance of StartStream with nested verbs' do + it 'validates instance of StartStream' do + expect(instance_nested).to be_instance_of(Bandwidth::Bxml::StartStream) + expect(instance_nested).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the nested StartStream instance' do + expected = "\n\n \n\n" + expect(instance_nested.to_bxml).to eq(expected) + end + + it 'tests the add_stream_param method of the nested StartStream instance' do + expected_single = "\n\n \n \n\n" + instance_nested.add_stream_param(stream_param_2) + expect(instance_nested.to_bxml).to eq(expected_single) + + expected_multiple = "\n\n \n \n \n \n\n" + instance_nested.add_stream_param([stream_param_2, stream_param_2]) + expect(instance_nested.to_bxml).to eq(expected_multiple) + end + end +end diff --git a/spec/unit/models/bxml/verbs/stop_gather_spec.rb b/spec/unit/models/bxml/verbs/stop_gather_spec.rb new file mode 100644 index 00000000..e8c8cad8 --- /dev/null +++ b/spec/unit/models/bxml/verbs/stop_gather_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::StopGather +describe 'Bandwidth::Bxml::StopGather' do + let(:instance) { Bandwidth::Bxml::StopGather.new } + + describe 'test an instance of StopGather' do + it 'validates instance of StopGather' do + expect(instance).to be_instance_of(Bandwidth::Bxml::StopGather) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the StopGather instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/stop_recording_spec.rb b/spec/unit/models/bxml/verbs/stop_recording_spec.rb new file mode 100644 index 00000000..36e37725 --- /dev/null +++ b/spec/unit/models/bxml/verbs/stop_recording_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::StopRecording +describe 'Bandwidth::Bxml::StopRecording' do + let(:instance) { Bandwidth::Bxml::StopRecording.new } + + describe 'test an instance of StopRecording' do + it 'validates instance of StopRecording' do + expect(instance).to be_instance_of(Bandwidth::Bxml::StopRecording) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the StopRecording instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/stop_stream_spec.rb b/spec/unit/models/bxml/verbs/stop_stream_spec.rb new file mode 100644 index 00000000..be08beea --- /dev/null +++ b/spec/unit/models/bxml/verbs/stop_stream_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::StopStream +describe 'Bandwidth::Bxml::StopStream' do + let(:initial_attributes) { + { + name: 'initial_name' + } + } + + let(:new_attributes) { + { + name: 'new_name' + } + } + + let(:instance) { Bandwidth::Bxml::StopStream.new(initial_attributes) } + + describe 'test an instance of StopStream' do + it 'validates instance of StopStream' do + expect(instance).to be_instance_of(Bandwidth::Bxml::StopStream) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the StopStream instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the StopStream instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/stream_param_spec.rb b/spec/unit/models/bxml/verbs/stream_param_spec.rb new file mode 100644 index 00000000..64cb3bbb --- /dev/null +++ b/spec/unit/models/bxml/verbs/stream_param_spec.rb @@ -0,0 +1,38 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::StreamParam +describe 'Bandwidth::Bxml::StreamParam' do + let(:initial_attributes) { + { + name: 'initial_name', + value: 'initial_value' + } + } + + let(:new_attributes) { + { + name: 'new_name', + value: 'new_value' + } + } + + let(:instance) { Bandwidth::Bxml::StreamParam.new(initial_attributes) } + + describe 'test an instance of StreamParam' do + it 'validates instance of StreamParam' do + expect(instance).to be_instance_of(Bandwidth::Bxml::StreamParam) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the StreamParam instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the StreamParam instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/tag_spec.rb b/spec/unit/models/bxml/verbs/tag_spec.rb new file mode 100644 index 00000000..2bb6b9ce --- /dev/null +++ b/spec/unit/models/bxml/verbs/tag_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Tag +describe 'Bandwidth::Bxml::Tag' do + let(:instance) { Bandwidth::Bxml::Tag.new('test_tag') } + + describe 'test an instance of Tag' do + it 'validates instance of Tag' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Tag) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Tag instance' do + expected = "\ntest_tag\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/transfer_spec.rb b/spec/unit/models/bxml/verbs/transfer_spec.rb new file mode 100644 index 00000000..c91bae5e --- /dev/null +++ b/spec/unit/models/bxml/verbs/transfer_spec.rb @@ -0,0 +1,86 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::Transfer +describe 'Bandwidth::Bxml::Transfer' do + let(:initial_attributes) { + { + transfer_caller_id: '+19195551234', + call_timeout: 5, + transfer_complete_url: 'https://initial.com', + transfer_complete_method: 'POST', + transfer_complete_fallback_url: 'https://initial.com', + transfer_complete_fallback_method: 'POST', + username: 'initial_username', + password: 'initial_password', + fallback_username: 'initial_fallback_username', + fallback_password: 'initial_fallback_password', + tag: 'initial_tag', + diversion_treatment: 'propogate', + diversion_reason: 'user-busy' + } + } + + let(:new_attributes) { + { + transfer_caller_id: '+19195554321', + call_timeout: 10, + transfer_complete_url: 'https://new.com', + transfer_complete_method: 'POST', + transfer_complete_fallback_url: 'https://new.com', + transfer_complete_fallback_method: 'POST', + username: 'new_username', + password: 'new_password', + fallback_username: 'new_fallback_username', + fallback_password: 'new_fallback_password', + tag: 'new_tag', + diversion_treatment: 'stack', + diversion_reason: 'no-answer' + } + } + + let(:phone_number) { Bandwidth::Bxml::PhoneNumber.new('+19195551234') } + let(:sip_uri) { Bandwidth::Bxml::SipUri.new('sip:1-999-123-4567@voip-provider.example.net') } + + let(:instance) { Bandwidth::Bxml::Transfer.new([], initial_attributes) } + let(:instance_nested) { Bandwidth::Bxml::Transfer.new([phone_number], initial_attributes) } + + describe 'test an instance of Transfer' do + it 'validates instance of Transfer' do + expect(instance).to be_instance_of(Bandwidth::Bxml::Transfer) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the Transfer instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the Transfer instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end + + describe 'test an instance of Transfer with nested verbs' do + it 'validates instance of Transfer' do + expect(instance_nested).to be_instance_of(Bandwidth::Bxml::Transfer) + expect(instance_nested).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the nested Transfer instance' do + expected = "\n\n +19195551234\n\n" + expect(instance_nested.to_bxml).to eq(expected) + end + + it 'tests the add_verb method of the nested Transfer instance' do + expected_single = "\n\n +19195551234\n sip:1-999-123-4567@voip-provider.example.net\n\n" + instance_nested.add_transfer_recipient(sip_uri) + expect(instance_nested.to_bxml).to eq(expected_single) + + expected_multiple = "\n\n +19195551234\n sip:1-999-123-4567@voip-provider.example.net\n sip:1-999-123-4567@voip-provider.example.net\n +19195551234\n\n" + instance_nested.add_transfer_recipient([sip_uri, phone_number]) + expect(instance_nested.to_bxml).to eq(expected_multiple) + end + end +end From 90f420e28739d0bbfe276e4a9259fb9437f66094 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Thu, 2 Mar 2023 11:04:35 -0500 Subject: [PATCH 12/30] Calls, Recordings, Conferences, and Statistics Integration Tests (#71) * DX-2937 Calls Integration Tests * update ignore * separate tests * remove test.rb * split tests and add 4xx tests * add 403 * update call test * update call * clearer variable name and update env vars * secrets. * finish calls * add env vars, refactoring, and recording tests * conferences test * more recordings tests * finish recordings * add asserts for response objects * finalize calls * reorder recordings * finish conferences * complete or partial * fix test.yml * spaces * updates and statistics tests (#79) * use stricter type matching for asserts * stricter asserts * add statistics tests * add retry logic to call cleanup * add sleep and retry less --- .github/workflows/test.yml | 8 + spec/call_utils.rb | 74 ++++++ .../integration/calls_api_integration_spec.rb | 176 +++++++++++-- .../conferences_api_integration_spec.rb | 167 +++++++++---- .../messages_api_integration_spec.rb | 10 +- spec/integration/mfa_api_integration_spec.rb | 12 +- ...hone_number_lookup_api_integration_spec.rb | 16 +- .../recordings_api_integration_spec.rb | 232 ++++++++++++++---- .../statistics_api_integration_spec.rb | 53 +++- spec/spec_helper.rb | 24 ++ 10 files changed, 635 insertions(+), 137 deletions(-) create mode 100644 spec/call_utils.rb diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03298f4c..ada93964 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,11 +35,19 @@ jobs: 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 }} 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 }} + OPERATING_SYSTEM: ${{ matrix.os }} + RUBY_VERSION: ${{ matrix.ruby-version }} run: rake - name: Notify Slack of Failures diff --git a/spec/call_utils.rb b/spec/call_utils.rb new file mode 100644 index 00000000..3c6d8191 --- /dev/null +++ b/spec/call_utils.rb @@ -0,0 +1,74 @@ +# Helper functions for voice calls +# These are reused in multiple tests + +def setup_manteca(type) + manteca_body = { + os: OPERATING_SYSTEM, + language: RUBY_VERSION, + type: type + } + manteca_test_url = URI(MANTECA_BASE_URL + "/tests") + manteca_header = { 'Content-Type': 'application/json' } + + begin + test_id = Net::HTTP.post(manteca_test_url, manteca_body.to_json, manteca_header) + return test_id.body.to_s.gsub("\"", "") + rescue => e + puts e.inspect + end +end + +def create_manteca_call(tag = "ruby", answer_path = "/bxml/pause", calls_api) + manteca_call_body = Bandwidth::CreateCall.new( + application_id: MANTECA_APPLICATION_ID, + to: MANTECA_IDLE_NUMBER, + from: MANTECA_ACTIVE_NUMBER, + answer_url: MANTECA_BASE_URL + answer_path, + tag: tag + ) + + response = calls_api.create_call(BW_ACCOUNT_ID, manteca_call_body) + $active_calls.append(response.call_id) + return response.call_id +end + +def get_manteca_test_status(test_id) + manteca_status_url = URI(MANTECA_BASE_URL + "/tests/" + test_id) + response = JSON.parse(Net::HTTP.get(manteca_status_url)) + return response +end + +def cleanup_calls(calls, calls_api) + attempts = 0 + + while (calls.length > 0 && attempts < 10) + calls.delete_if { |call_id| call_ended(call_id, calls_api) } + sleep(SLEEP_TIME_S) + attempts += 1 + end + + if (calls.length > 0) + error_message = "Failed to terminate all calls" + calls.to_s + raise StandardError.new error_message + end +end + +def call_ended(call_id, calls_api) + begin + response = calls_api.get_call_state(BW_ACCOUNT_ID, call_id) + rescue Bandwidth::ApiError + return false + end + + if !(response.state == 'disconnected') + begin + calls_api.update_call(BW_ACCOUNT_ID, call_id, $complete_call_body) + return true + rescue Bandwidth::ApiError + end + else + return true + end + + return false +end diff --git a/spec/integration/calls_api_integration_spec.rb b/spec/integration/calls_api_integration_spec.rb index 760e0b8d..0b34a33a 100644 --- a/spec/integration/calls_api_integration_spec.rb +++ b/spec/integration/calls_api_integration_spec.rb @@ -1,42 +1,180 @@ require 'spec_helper' require 'json' +require_relative '../call_utils' # Integration Tests for Bandwidth::CallsApi describe 'CallsApi Integration Tests' do - before do - # run before each test - @api_instance = Bandwidth::CallsApi.new - end - - after do - # run after each test + before(:all) do + Bandwidth.configure do |config| + config.username = BW_USERNAME + config.password = BW_PASSWORD + end + @api_instance_calls = Bandwidth::CallsApi.new + $call_info_id = "" end # Create Call - describe 'create_call test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe 'create_call' do + it 'creates a call with amd' do + amd_config = Bandwidth::MachineDetectionConfiguration.new( + mode: "async", + detection_timeout: 5.0, + silence_timeout: 5.0, + speech_threshold: 5.0, + speech_end_threshold: 5.0, + delay_result: true, + callback_url: BASE_CALLBACK_URL + "/machineDetection", + callback_method: Bandwidth::CallbackMethodEnum::POST + ) + + call_body = Bandwidth::CreateCall.new( + application_id: BW_VOICE_APPLICATION_ID, + to: USER_NUMBER, + from: BW_NUMBER, + answer_url: BASE_CALLBACK_URL + "/callbacks/answer", + answer_method: "POST", + disconnect_url: BASE_CALLBACK_URL + "/callbacks/disconnect", + disconnect_method: "GET", + machine_detection: amd_config, + call_timeout: 30.0, + callback_timeout: 15.0 + ) + + response = @api_instance_calls.create_call_with_http_info(BW_ACCOUNT_ID, call_body) + sleep(SLEEP_TIME_S) + + expect(response[CODE]).to eq(201) + expect(response[DATA]).to be_instance_of(Bandwidth::CreateCallResponse) + expect(response[DATA].call_id.length).to eq(47) + expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) + expect(response[DATA].application_id).to eq(BW_VOICE_APPLICATION_ID) + expect(response[DATA].to).to eq(USER_NUMBER) + expect(response[DATA].from).to eq(BW_NUMBER) + expect(response[DATA].call_id) + expect(response[DATA].call_timeout).to eq(30.0) + expect(response[DATA].callback_timeout).to eq(15.0) + expect(response[DATA].enqueued_time).to be_instance_of(Time) + expect(response[DATA].answer_method).to eq(Bandwidth::CallbackMethodEnum::POST) + expect(response[DATA].disconnect_method).to eq("GET") + expect(response[DATA].answer_url).to eq(BASE_CALLBACK_URL + "/callbacks/answer") + expect(response[DATA].disconnect_url).to eq(BASE_CALLBACK_URL + "/callbacks/disconnect") + + $call_info_id = response[DATA].call_id + $active_calls.append($call_info_id) end end # Get Call State Information - describe 'get_call_state test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe 'get_call_state' do + it 'gets the call state' do + response = @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(Bandwidth::CallState) + expect(response[DATA].call_id).to eq($call_info_id) + expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) + expect(response[DATA].application_id).to eq(BW_VOICE_APPLICATION_ID) + expect(response[DATA].start_time).to be_instance_of(Time) + expect(response[DATA].last_update).to be_instance_of(Time) + expect(response[DATA].state).to be_instance_of(String) + expect(response[DATA].direction).to eq(Bandwidth::CallDirectionEnum::OUTBOUND) end end # Update Call - describe 'update_call test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe 'update_call' do + it 'creates and updates a call' do + update_call_body = Bandwidth::UpdateCall.new( + state: Bandwidth::CallStateEnum::ACTIVE, + redirect_url: MANTECA_BASE_URL + "/bxml/pause" + ) + + update_call_id = create_manteca_call(@api_instance_calls) + sleep(SLEEP_TIME_S) + + update_response = @api_instance_calls.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, update_call_body) + expect(update_response[CODE]).to eq(200) + sleep(SLEEP_TIME_S) + + complete_response = @api_instance_calls.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body) + expect(complete_response[CODE]).to eq(200) end end # Update Call BXML - describe 'update_call_bxml test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe 'update_call_bxml' do + it 'updates a call using bxml' do + update_call_id = create_manteca_call(@api_instance_calls) + sleep(SLEEP_TIME_S) + + update_bxml = "This is a test bxml response"; + update_response = @api_instance_calls.update_call_bxml_with_http_info(BW_ACCOUNT_ID, update_call_id, update_bxml) + expect(update_response[CODE]).to eq(204) + sleep(SLEEP_TIME_S) + + complete_response = @api_instance_calls.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body) + expect(complete_response[CODE]).to eq(200) + end + end + + # HTTP 4XX Errors + describe 'http error' do + it 'causes a 400 error' do + call_body_bad = Bandwidth::CreateCall.new( + application_id: BW_VOICE_APPLICATION_ID, + to: "+1invalid", + from: BW_NUMBER, + answer_url: BASE_CALLBACK_URL + "/callbacks/answer", + answer_method: "POST", + disconnect_url: BASE_CALLBACK_URL + "/callbacks/disconnect", + disconnect_method: "GET" + ) + + expect { + @api_instance_calls.create_call_with_http_info(BW_ACCOUNT_ID, call_body_bad) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.code).to eq(400) + } + end + + it 'causes a 404 error' do + dne_id = "does-not-exist" + + expect { + @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, dne_id) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.code).to eq(404) + } + end + + it 'causes a 401 error' do + Bandwidth.configure do |config| + config.username = 'bad_username' + config.password = 'bad_password' + end + + expect { + @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.code).to eq(401) + } + end + + it 'causes a 403 error' do + Bandwidth.configure do |config| + config.username = FORBIDDEN_USERNAME + config.password = FORBIDDEN_PASSWORD + end + + expect { + @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.code).to eq(403) + } end end diff --git a/spec/integration/conferences_api_integration_spec.rb b/spec/integration/conferences_api_integration_spec.rb index 58683c78..4bb69778 100644 --- a/spec/integration/conferences_api_integration_spec.rb +++ b/spec/integration/conferences_api_integration_spec.rb @@ -1,77 +1,162 @@ require 'spec_helper' require 'json' +require_relative '../call_utils' # Integration Tests for Bandwidth::ConferencesApi describe 'ConferencesApi Integration Tests' do - before do - # run before each test - @api_instance = Bandwidth::ConferencesApi.new + before(:all) do + Bandwidth.configure do |config| + config.username = BW_USERNAME + config.password = BW_PASSWORD + config.return_binary_data = true + end + @api_instance_conferences = Bandwidth::ConferencesApi.new + @api_instance_calls = Bandwidth::CallsApi.new + $manteca_test_id = setup_manteca('conference') + $manteca_call_id = create_manteca_call($manteca_test_id, "/bxml/joinConferencePause", @api_instance_calls) + $conference_id = "" + $recording_id = "" end + + # Get Conferences + describe 'list_conferences' do + it 'list all conferences' do + conference_opts = { + name: $manteca_test_id + } - after do - # run after each test - end + sleep(SLEEP_TIME_S) + response = @api_instance_conferences.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts) - # Download Conference Recording - describe 'download_conference_recording test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + expect(response[CODE]).to eq(200) + expect(response[DATA][0]).to be_instance_of(Bandwidth::Conference) + expect(response[DATA][0].id).to be_instance_of(String) + $conference_id = response[DATA][0].id end end # Get Conference Information - describe 'get_conference test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe 'get_conference' do + it 'get a conference by id' do + response = @api_instance_conferences.get_conference_with_http_info(BW_ACCOUNT_ID, $conference_id) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(Bandwidth::Conference) + expect(response[DATA].id).to eq($conference_id) + expect(response[DATA].name).to eq($manteca_test_id) + expect(response[DATA].tag).to eq($manteca_test_id) end end - + # Get Conference Member - describe 'get_conference_member test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe 'get_conference_member' do + it 'gets a conference member by call id' do + response = @api_instance_conferences.get_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(Bandwidth::ConferenceMember) + expect(response[DATA].conference_id).to eq($conference_id) + expect(response[DATA].call_id).to eq($manteca_call_id) end end + + # Update Conference Member + describe 'update_conference_member' do + it 'updates a conference member by call id' do + update_conference_member = Bandwidth::UpdateConferenceMember.new( + mute: false + ) - # Get Conference Recording Information - describe 'get_conference_recording test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + response = @api_instance_conferences.update_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id, update_conference_member) + expect(response[CODE]).to eq(204) end end - # Get Conference Recordings - describe 'list_conference_recordings test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # Update Conference + describe 'update_conference' do + it 'updates a conference' do + update_conference_body = Bandwidth::UpdateConference.new( + status: Bandwidth::ConferenceStateEnum::ACTIVE, + redirect_url: MANTECA_BASE_URL + "/bxml/pause", + redirect_method: Bandwidth::RedirectMethodEnum::POST, + username: "username", + password: "password", + redirect_fallback_url: MANTECA_BASE_URL + "/bxml/pause", + redirect_fallback_method: Bandwidth::RedirectMethodEnum::POST, + fallback_username: "username", + fallback_password: "password" + ) + + response = @api_instance_conferences.update_conference_with_http_info(BW_ACCOUNT_ID, $conference_id, update_conference_body) + expect(response[CODE]).to eq(204) end end - # Get Conferences - describe 'list_conferences test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # Update Conference BXML + describe 'update_conference_bxml' do + it 'updates a conference using bxml' do + update_bxml = "This should be a conference recording." + + response = @api_instance_conferences.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, $conference_id, update_bxml) + expect(response[CODE]).to eq(204) + + retries = 0 + recording_complete = false + begin + while !recording_complete && retries < MAX_RETRIES + recording_complete = get_manteca_test_status($manteca_test_id)["callRecorded"] + retries += 1 + sleep(SLEEP_TIME_S) + end + rescue => e + puts e.inspect + end + + expect(recording_complete).to be_instance_of(TrueClass) end end + + # Get Conference Recordings + describe 'list_conference_recordings' do + it 'lists recordings for a conference' do + response = @api_instance_conferences.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, $conference_id) - # Update Conference - describe 'update_conference test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + expect(response[CODE]).to eq(200) + expect(response[DATA][0]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) + expect(response[DATA][0].conference_id).to eq($conference_id) + expect(response[DATA][0].account_id).to eq(BW_ACCOUNT_ID) + expect(response[DATA][0].name).to eq($manteca_test_id) + expect(response[DATA][0].status).to eq('complete').or eq('partial') + expect(response[DATA][0].recording_id).to be_instance_of(String) + expect(response[DATA][0].file_format).to eq(Bandwidth::FileFormatEnum::WAV) + + $recording_id = response[DATA][0].recording_id end end + + # Get Conference Recording Information + describe 'get_conference_recording' do + it 'gets a conference recording by id' do + response = @api_instance_conferences.get_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id) - # Update Conference BXML - describe 'update_conference_bxml test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) + expect(response[DATA].conference_id).to eq($conference_id) + expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) + expect(response[DATA].name).to eq($manteca_test_id) + expect(response[DATA].status).to eq('complete').or eq('partial') + expect(response[DATA].recording_id).to be_instance_of(String) + expect(response[DATA].file_format).to eq(Bandwidth::FileFormatEnum::WAV) + end end - end - # Update Conference Member - describe 'update_conference_member test' do + # Download Conference Recording + describe 'download_conference_recording test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + response = @api_instance_conferences.download_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(String) end end diff --git a/spec/integration/messages_api_integration_spec.rb b/spec/integration/messages_api_integration_spec.rb index f5f9882b..2847c45f 100644 --- a/spec/integration/messages_api_integration_spec.rb +++ b/spec/integration/messages_api_integration_spec.rb @@ -25,7 +25,7 @@ response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) expect(response[CODE]).to eq(202) - expect(response[DATA]).to be_a(Bandwidth::Message) + expect(response[DATA]).to be_instance_of(Bandwidth::Message) expect(response[DATA].id.length).to eq(29) expect(response[DATA].owner).to eq(BW_NUMBER) expect(response[DATA].from).to eq(BW_NUMBER) @@ -46,8 +46,8 @@ response = @api_instance_msg.list_messages_with_http_info(BW_ACCOUNT_ID, get_opts) expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_a(Bandwidth::MessagesList) - expect(response[DATA].messages[0]).to be_a(Bandwidth::ListMessageItem) + expect(response[DATA]).to be_instance_of(Bandwidth::MessagesList) + expect(response[DATA].messages[0]).to be_instance_of(Bandwidth::ListMessageItem) expect(response[DATA].messages[0].account_id).to eq(BW_ACCOUNT_ID) expect(response[DATA].messages[0].message_direction).to eq("OUTBOUND") expect(response[DATA].messages[0].source_tn).to eq(BW_NUMBER) @@ -67,7 +67,7 @@ expect { $response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) }.to raise_error { |e| - expect(e).to be_a(Bandwidth::ApiError) + expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(400) } end @@ -88,7 +88,7 @@ expect { $response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) }.to raise_error { |e| - expect(e).to be_a(Bandwidth::ApiError) + expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(401) } end diff --git a/spec/integration/mfa_api_integration_spec.rb b/spec/integration/mfa_api_integration_spec.rb index 8a0004fd..89472a20 100644 --- a/spec/integration/mfa_api_integration_spec.rb +++ b/spec/integration/mfa_api_integration_spec.rb @@ -24,7 +24,7 @@ response = @api_instance_mfa.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_a(Bandwidth::MessagingCodeResponse) + expect(response[DATA]).to be_instance_of(Bandwidth::MessagingCodeResponse) expect(response[DATA].message_id.length).to eq(29) end end @@ -42,7 +42,7 @@ response = @api_instance_mfa.generate_voice_code_with_http_info(BW_ACCOUNT_ID, req_schema) expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_a(Bandwidth::VoiceCodeResponse) + expect(response[DATA]).to be_instance_of(Bandwidth::VoiceCodeResponse) expect(response[DATA].call_id.length).to eq(47) end end @@ -59,8 +59,8 @@ response = @api_instance_mfa.verify_code_with_http_info(BW_ACCOUNT_ID, req_schema) expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_a(Bandwidth::VerifyCodeResponse) - expect(response[DATA].valid).to be_a(FalseClass) + expect(response[DATA]).to be_instance_of(Bandwidth::VerifyCodeResponse) + expect(response[DATA].valid).to be_instance_of(FalseClass) end end @@ -78,7 +78,7 @@ expect { response = @api_instance_mfa.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) }.to raise_error { |e| - expect(e).to be_a(Bandwidth::ApiError) + expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(400) } end @@ -100,7 +100,7 @@ expect { response = @api_instance_mfa.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) }.to raise_error { |e| - expect(e).to be_a(Bandwidth::ApiError) + expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(403) } end diff --git a/spec/integration/phone_number_lookup_api_integration_spec.rb b/spec/integration/phone_number_lookup_api_integration_spec.rb index dc2949de..b5e5c7e4 100644 --- a/spec/integration/phone_number_lookup_api_integration_spec.rb +++ b/spec/integration/phone_number_lookup_api_integration_spec.rb @@ -21,9 +21,9 @@ response = @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body) expect(response[CODE]).to eq(202) - expect(response[DATA]).to be_a(Bandwidth::CreateLookupResponse) + expect(response[DATA]).to be_instance_of(Bandwidth::CreateLookupResponse) expect(response[DATA].request_id.length).to eq(36) - expect(response[DATA].status).to be_a(String) + expect(response[DATA].status).to be_instance_of(String) $lookup_request_id = response[DATA].request_id sleep(1) @@ -36,10 +36,10 @@ response = @api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, $lookup_request_id) expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_a(Bandwidth::LookupStatus) + expect(response[DATA]).to be_instance_of(Bandwidth::LookupStatus) expect(response[DATA].request_id).to eq($lookup_request_id) - expect(response[DATA].status).to be_a(String) - expect(response[DATA].result[0].response_code).to be_a(Integer) + expect(response[DATA].status).to be_instance_of(String) + expect(response[DATA].result[0].response_code).to be_instance_of(Integer) expect(response[DATA].result[0].e_164_format).to eq(BW_NUMBER) end end @@ -54,7 +54,7 @@ expect { @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body_bad) }.to raise_error { |e| - expect(e).to be_a(Bandwidth::ApiError) + expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(400) } end @@ -65,7 +65,7 @@ expect { @api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, req_id_dne) }.to raise_error { |e| - expect(e).to be_a(Bandwidth::ApiError) + expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(404) } end @@ -83,7 +83,7 @@ expect { @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body) }.to raise_error { |e| - expect(e).to be_a(Bandwidth::ApiError) + expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(401) } end diff --git a/spec/integration/recordings_api_integration_spec.rb b/spec/integration/recordings_api_integration_spec.rb index a2477bc8..f7e132dc 100644 --- a/spec/integration/recordings_api_integration_spec.rb +++ b/spec/integration/recordings_api_integration_spec.rb @@ -1,84 +1,218 @@ require 'spec_helper' require 'json' +require_relative '../call_utils' # Integration Tests for Bandwidth::RecordingsApi describe 'RecordingsApi Integration Tests' do - before do - # run before each test - @api_instance = Bandwidth::RecordingsApi.new + before(:all) do + Bandwidth.configure do |config| + config.username = BW_USERNAME + config.password = BW_PASSWORD + config.return_binary_data = true + end + @api_instance_recordings = Bandwidth::RecordingsApi.new + @api_instance_calls = Bandwidth::CallsApi.new + $manteca_test_id = setup_manteca('CALL') + $manteca_call_id = create_manteca_call($manteca_test_id, "/bxml/startLongRecording", @api_instance_calls) + $recording_id = "" end + + # Update Recording + describe 'update_call_recording_state' do + it 'updates and ends the manteca call recording' do + pause_recording = Bandwidth::UpdateCallRecording.new( + state: Bandwidth::RecordingStateEnum::PAUSED + ) - after do - # run after each test - end + start_recording = Bandwidth::UpdateCallRecording.new( + state: Bandwidth::RecordingStateEnum::RECORDING + ) - # Delete Transcription - describe 'delete_call_transcription test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end + sleep(SLEEP_TIME_S * 2) + pause_response = @api_instance_recordings.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, pause_recording) + expect(pause_response[CODE]).to eq(200) - # Delete Recording - describe 'delete_recording test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + sleep(SLEEP_TIME_S) + record_response = @api_instance_recordings.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, start_recording) + expect(record_response[CODE]).to eq(200) + + complete_response = @api_instance_calls.update_call_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $complete_call_body) + expect(complete_response[CODE]).to eq(200) + + retries = 0 + recording_complete = false + begin + while !recording_complete && retries < MAX_RETRIES + recording_complete = get_manteca_test_status($manteca_test_id)["callRecorded"] + retries += 1 + sleep(SLEEP_TIME_S) + end + rescue => e + puts e.inspect + end + + expect(recording_complete).to be_instance_of(TrueClass) end end + + # Get Call Recordings + describe 'list_account_call_recordings' do + it 'lists account call recordings' do + response = @api_instance_recordings.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID) - # Delete Recording Media - describe 'delete_recording_media test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + expect(response[CODE]).to eq(200) + expect(response[DATA][0]).to be_instance_of(Bandwidth::CallRecordingMetadata) + expect(response[DATA][0].application_id).to eq(MANTECA_APPLICATION_ID) + expect(response[DATA][0].account_id).to eq(BW_ACCOUNT_ID) end end - # Download Recording - describe 'download_call_recording test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # List Call Recordings + describe 'list_call_recordings' do + it 'lists all recordings for a single call' do + response = @api_instance_recordings.list_call_recordings_with_http_info(BW_ACCOUNT_ID, $manteca_call_id) + + expect(response[CODE]).to eq(200) + expect(response[DATA][0]).to be_instance_of(Bandwidth::CallRecordingMetadata) + expect(response[DATA][0].application_id).to eq(MANTECA_APPLICATION_ID) + expect(response[DATA][0].account_id).to eq(BW_ACCOUNT_ID) + expect(response[DATA][0].call_id).to eq($manteca_call_id) + expect(response[DATA][0].recording_id).to be_instance_of(String) + expect(response[DATA][0].status).to eq('complete').or eq('partial') + + $recording_id = response[DATA][0].recording_id end end - + # Get Call Recording - describe 'get_call_recording test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe 'get_call_recording' do + it 'gets a call recording by id' do + response = @api_instance_recordings.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(Bandwidth::CallRecordingMetadata) + expect(response[DATA].application_id).to eq(MANTECA_APPLICATION_ID) + expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) + expect(response[DATA].call_id).to eq($manteca_call_id) + expect(response[DATA].status).to eq('complete').or eq('partial') + expect(response[DATA].recording_id).to eq($recording_id) end end + + # Download Recording + describe 'download_call_recording' do + it 'downloads a call recording by id' do + response = @api_instance_recordings.download_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) - # Get Transcription - describe 'get_call_transcription test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(String) + end end - end + + # Create Transcription Request + describe 'transcribe_call_recording' do + it 'creates a transcription request' do + transcribe_recording = Bandwidth::TranscribeRecording.new( + callback_url: MANTECA_BASE_URL + "/transcriptions", + tag: $manteca_test_id + ) - # Get Call Recordings - describe 'list_account_call_recordings test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + response = @api_instance_recordings.transcribe_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id, transcribe_recording) + expect(response[CODE]).to eq(204) + + retries = 0 + transcription_complete = false + sleep(SLEEP_TIME_S * 10) + begin + while !transcription_complete && retries < MAX_RETRIES + transcription_complete = get_manteca_test_status($manteca_test_id)["callTranscribed"] + retries += 1 + sleep(SLEEP_TIME_S) + end + rescue => e + puts e.inspect + end + + expect(transcription_complete).to be_instance_of(TrueClass) end end + + # Get Transcription + describe 'get_call_transcription' do + it 'gets the completed call recording transcription' do + response = @api_instance_recordings.get_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) - # List Call Recordings - describe 'list_call_recordings test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(Bandwidth::TranscriptionList) + expect(response[DATA].transcripts[0]).to be_instance_of(Bandwidth::Transcription) + expect(response[DATA].transcripts[0].text).to be_instance_of(String) + expect(response[DATA].transcripts[0].confidence).to be_instance_of(Float) + end + end + + # Delete Transcription + describe 'delete_call_transcription' do + it 'deletes the completed call recording transcription' do + response = @api_instance_recordings.delete_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + expect(response[CODE]).to eq(204) end end + + # Delete Recording Media + describe 'delete_recording_media' do + it 'deletes the completed call recording media' do + response = @api_instance_recordings.delete_recording_media_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + expect(response[CODE]).to eq(204) + end + end - # Create Transcription Request - describe 'transcribe_call_recording test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # Delete Recording + describe 'delete_recording' do + it 'deletes the completed call recording data' do + response = @api_instance_recordings.delete_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + expect(response[CODE]).to eq(204) end end - # Update Recording - describe 'update_call_recording_state test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # HTTP 4XX Errors + describe 'http error' do + it 'causes a 404 error' do + dne_id = "does-not-exist" + + expect { + @api_instance_recordings.get_call_recording_with_http_info(BW_ACCOUNT_ID, dne_id, dne_id) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.code).to eq(404) + } + end + + it 'causes a 401 error' do + Bandwidth.configure do |config| + config.username = 'bad_username' + config.password = 'bad_password' + end + + expect { + @api_instance_recordings.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.code).to eq(401) + } + end + + it 'causes a 403 error' do + Bandwidth.configure do |config| + config.username = FORBIDDEN_USERNAME + config.password = FORBIDDEN_PASSWORD + end + + expect { + @api_instance_recordings.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.code).to eq(403) + } end end diff --git a/spec/integration/statistics_api_integration_spec.rb b/spec/integration/statistics_api_integration_spec.rb index efcc7700..b86eb863 100644 --- a/spec/integration/statistics_api_integration_spec.rb +++ b/spec/integration/statistics_api_integration_spec.rb @@ -3,19 +3,54 @@ # Integration Tests for Bandwidth::StatisticsApi describe 'StatisticsApi Integration Tests' do - before do - # run before each test - @api_instance = Bandwidth::StatisticsApi.new + before(:all) do + Bandwidth.configure do |config| + config.username = BW_USERNAME + config.password = BW_PASSWORD + end + @api_instance_statistics = Bandwidth::StatisticsApi.new end - after do - # run after each test + # Get Account Statistics + describe 'get_statistics' do + it 'gets account statistics' do + response = @api_instance_statistics.get_statistics_with_http_info(BW_ACCOUNT_ID) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(Bandwidth::AccountStatistics) + expect(response[DATA].current_call_queue_size).to be_instance_of(Integer) + expect(response[DATA].max_call_queue_size).to eq(7500) + end end - # Get Account Statistics - describe 'get_statistics test' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # HTTP 4XX Errors + describe 'http error' do + it 'causes a 401 error' do + Bandwidth.configure do |config| + config.username = 'bad_username' + config.password = 'bad_password' + end + + expect { + @api_instance_statistics.get_statistics_with_http_info(BW_ACCOUNT_ID) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.code).to eq(401) + } + end + + it 'causes a 403 error' do + Bandwidth.configure do |config| + config.username = FORBIDDEN_USERNAME + config.password = FORBIDDEN_PASSWORD + end + + expect { + @api_instance_statistics.get_statistics_with_http_info(BW_ACCOUNT_ID) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.code).to eq(403) + } end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a532fecb..8a414837 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -36,12 +36,20 @@ begin BW_USERNAME = ENV.fetch("BW_USERNAME") BW_PASSWORD = ENV.fetch("BW_PASSWORD") + FORBIDDEN_USERNAME = ENV.fetch("BW_USERNAME_FORBIDDEN") + FORBIDDEN_PASSWORD = ENV.fetch("BW_PASSWORD_FORBIDDEN") BW_ACCOUNT_ID = ENV.fetch("BW_ACCOUNT_ID") BW_VOICE_APPLICATION_ID = ENV.fetch("BW_VOICE_APPLICATION_ID") BW_MESSAGING_APPLICATION_ID = ENV.fetch("BW_MESSAGING_APPLICATION_ID") BASE_CALLBACK_URL = ENV.fetch("BASE_CALLBACK_URL") BW_NUMBER = ENV.fetch("BW_NUMBER") USER_NUMBER = ENV.fetch("USER_NUMBER") + MANTECA_ACTIVE_NUMBER = ENV.fetch("MANTECA_ACTIVE_NUMBER") + MANTECA_IDLE_NUMBER = ENV.fetch("MANTECA_IDLE_NUMBER") + MANTECA_BASE_URL = ENV.fetch("MANTECA_BASE_URL") + MANTECA_APPLICATION_ID = ENV.fetch("MANTECA_APPLICATION_ID") + OPERATING_SYSTEM = ENV.fetch("OPERATING_SYSTEM") + RUBY_VERSION = ENV.fetch("RUBY_VERSION") rescue puts "Environmental variables not found" exit(-1) @@ -49,6 +57,22 @@ DATA = 0 # index for response array related to the response data CODE = 1 # index for response array related to the status code + SLEEP_TIME_S = 3 # default sleep time in seconds + MAX_RETRIES = 40 + $active_calls = [] + + $complete_call_body = Bandwidth::UpdateCall.new( + state: Bandwidth::CallStateEnum::COMPLETED + ) + } + + config.after(:suite) { + Bandwidth.configure do |config| + config.username = BW_USERNAME + config.password = BW_PASSWORD + end + calls_api = Bandwidth::CallsApi.new + cleanup_calls($active_calls, calls_api) } # rspec-expectations config goes here. You can use an alternate From 5a80cf6697e913542906f09e148cc6a1956cdf11 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Thu, 2 Mar 2023 13:48:49 -0500 Subject: [PATCH 13/30] update version --- lib/bandwidth-sdk/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bandwidth-sdk/version.rb b/lib/bandwidth-sdk/version.rb index abbfff68..efb86bd4 100644 --- a/lib/bandwidth-sdk/version.rb +++ b/lib/bandwidth-sdk/version.rb @@ -11,5 +11,5 @@ =end module Bandwidth - VERSION = '11.0.0' + VERSION = '11.0.0-beta.1' end From 34008b99dad8b1e94a105282528e420e8e3cfc1b Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Thu, 16 Mar 2023 09:20:30 -0400 Subject: [PATCH 14/30] SWI-1988 Update SDK with `expiration` field (#87) * SWI-1988 Update SDK with `expiration` field * update pre-release name regex --- .github/workflows/deploy.yml | 4 +- Gemfile.lock | 77 ------------------- bandwidth.yml | 9 ++- docs/Message.md | 4 +- docs/MessageRequest.md | 2 +- lib/bandwidth-sdk/models/message.rb | 18 ++++- lib/bandwidth-sdk/models/message_request.rb | 4 +- lib/bandwidth-sdk/version.rb | 2 +- ruby-notes.md | 71 +++-------------- .../messages_api_integration_spec.rb | 64 ++++++++++----- spec/unit/models/message_spec.rb | 6 ++ 11 files changed, 94 insertions(+), 167 deletions(-) delete mode 100644 Gemfile.lock diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a41c39c1..023f6390 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -75,9 +75,9 @@ jobs: - name: Check Release Tag Format run: | - re=[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+\.?[0-9]*\.?[0-9]* + re=[0-9]+\.[0-9]+\.[0-9]+\.pre\.beta\.[0-9]+\.?[0-9]*\.?[0-9]* if ! [[ $RELEASE_VERSION =~ $re ]]; then - echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+\.?[0-9]*\.?[0-9]*)' + echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+\.[0-9]+\.[0-9]+\.pre\.beta\.[0-9]+\.?[0-9]*\.?[0-9]*)' echo $RELEASE_VERSION echo 'Please update your tag to match the expected regex pattern' exit 1 diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 181b9e2b..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,77 +0,0 @@ -PATH - remote: . - specs: - bandwidth-sdk (11.0.0) - faraday (>= 1.0.1, < 3.0) - faraday-multipart - ox (~> 2.4) - -GEM - remote: https://rubygems.org/ - specs: - ast (2.4.2) - byebug (11.1.3) - coderay (1.1.3) - diff-lcs (1.5.0) - faraday (2.7.4) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (3.0.2) - jaro_winkler (1.5.4) - method_source (1.0.0) - multipart-post (2.3.0) - ox (2.14.14) - parallel (1.22.1) - parser (3.2.0.0) - ast (~> 2.4.1) - pry (0.14.2) - coderay (~> 1.1) - method_source (~> 1.0) - pry-byebug (3.10.1) - byebug (~> 11.0) - pry (>= 0.13, < 0.15) - psych (5.0.2) - stringio - rainbow (3.1.1) - rake (13.0.6) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.0) - rubocop (0.66.0) - jaro_winkler (~> 1.5.1) - parallel (~> 1.10) - parser (>= 2.5, != 2.5.1.1) - psych (>= 3.1.0) - rainbow (>= 2.2.2, < 4.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.6) - ruby-progressbar (1.11.0) - ruby2_keywords (0.0.5) - stringio (3.0.4) - unicode-display_width (1.5.0) - -PLATFORMS - arm64-darwin-22 - -DEPENDENCIES - bandwidth-sdk! - ox (~> 2.4, >= 2.4.1) - pry-byebug - rake (~> 13.0.1) - rspec (~> 3.6, >= 3.6.0) - rubocop (~> 0.66.0) - -BUNDLED WITH - 2.3.26 diff --git a/bandwidth.yml b/bandwidth.yml index 5904b442..5813c9ff 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -1446,6 +1446,11 @@ components: example: custom tag priority: $ref: '#/components/schemas/priorityEnum' + expiration: + type: string + format: date-time + description: The expiration date-time set by the user. + example: '2021-02-01T11:29:18-05:00' messageRequest: title: MessageRequest type: object @@ -1504,10 +1509,12 @@ components: $ref: '#/components/schemas/priorityEnum' expiration: type: string + format: date-time description: >- A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., - 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. + 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a + date-time in the future. example: '2021-02-01T11:29:18-05:00' inboundMessageCallback: description: Inbound Message Callback diff --git a/docs/Message.md b/docs/Message.md index 1aec01a6..5a660b2a 100644 --- a/docs/Message.md +++ b/docs/Message.md @@ -16,6 +16,7 @@ | **text** | **String** | The contents of the message. | [optional] | | **tag** | **String** | The custom string set by the user. | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | +| **expiration** | **Time** | The expiration date-time set by the user. | [optional] | ## Example @@ -34,7 +35,8 @@ instance = Bandwidth::Message.new( media: ["https://dev.bandwidth.com/images/bandwidth-logo.png"], text: Hello world, tag: custom tag, - priority: null + priority: null, + expiration: 2021-02-01T11:29:18-05:00 ) ``` diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md index f35a7459..515cc54b 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -11,7 +11,7 @@ | **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] | | **tag** | **String** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | -| **expiration** | **String** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. | [optional] | +| **expiration** | **Time** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. | [optional] | ## Example diff --git a/lib/bandwidth-sdk/models/message.rb b/lib/bandwidth-sdk/models/message.rb index 91df8c6c..d303fc1c 100644 --- a/lib/bandwidth-sdk/models/message.rb +++ b/lib/bandwidth-sdk/models/message.rb @@ -49,6 +49,9 @@ class Message attr_accessor :priority + # The expiration date-time set by the user. + attr_accessor :expiration + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -85,7 +88,8 @@ def self.attribute_map :'media' => :'media', :'text' => :'text', :'tag' => :'tag', - :'priority' => :'priority' + :'priority' => :'priority', + :'expiration' => :'expiration' } end @@ -108,7 +112,8 @@ def self.openapi_types :'media' => :'Array', :'text' => :'String', :'tag' => :'String', - :'priority' => :'PriorityEnum' + :'priority' => :'PriorityEnum', + :'expiration' => :'Time' } end @@ -184,6 +189,10 @@ def initialize(attributes = {}) if attributes.key?(:'priority') self.priority = attributes[:'priority'] end + + if attributes.key?(:'expiration') + self.expiration = attributes[:'expiration'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -227,7 +236,8 @@ def ==(o) media == o.media && text == o.text && tag == o.tag && - priority == o.priority + priority == o.priority && + expiration == o.expiration end # @see the `==` method @@ -239,7 +249,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, owner, application_id, time, segment_count, direction, to, from, media, text, tag, priority].hash + [id, owner, application_id, time, segment_count, direction, to, from, media, text, tag, priority, expiration].hash end # Builds the object from hash diff --git a/lib/bandwidth-sdk/models/message_request.rb b/lib/bandwidth-sdk/models/message_request.rb index d15d7c1d..e8c9b852 100644 --- a/lib/bandwidth-sdk/models/message_request.rb +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -35,7 +35,7 @@ class MessageRequest attr_accessor :priority - # A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. + # A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. attr_accessor :expiration class EnumAttributeValidator @@ -89,7 +89,7 @@ def self.openapi_types :'media' => :'Array', :'tag' => :'String', :'priority' => :'PriorityEnum', - :'expiration' => :'String' + :'expiration' => :'Time' } end diff --git a/lib/bandwidth-sdk/version.rb b/lib/bandwidth-sdk/version.rb index efb86bd4..0c910fe2 100644 --- a/lib/bandwidth-sdk/version.rb +++ b/lib/bandwidth-sdk/version.rb @@ -11,5 +11,5 @@ =end module Bandwidth - VERSION = '11.0.0-beta.1' + VERSION = '11.0.0.pre.beta.1.1' end diff --git a/ruby-notes.md b/ruby-notes.md index e24fe863..8f7fe482 100644 --- a/ruby-notes.md +++ b/ruby-notes.md @@ -1,64 +1,15 @@ -# Config and Basic Auth +# Generate Command +`openapi-generator generate -g ruby -i bandwidth.yml -c openapi-config.yml -o ./` -## APIMatic - -```ruby -bandwidth_client = Bandwidth::Client.new( - messaging_basic_auth_user_name: BW_USERNAME, - messaging_basic_auth_password: BW_PASSWORD -) -messaging_client = bandwidth_client.messaging_client.client -``` - -## OpenAPIGenerator - -```ruby -OpenapiClient.configure do |config| - config.username = BW_USERNAME - config.password = BW_PASSWORD -end -messaging_client = OpenapiClient::MessagesApi.new() -``` - -# Send SMS - -## APIMatic -```ruby -account_id = BW_ACCOUNT_ID - -body = MessageRequest.new -body.application_id = BW_MESSAGING_APPLICATION_ID -body.to = [USER_NUMBER] -body.from = BW_NUMBER -body.text = "Hello World!" - -messaging_client.create_message(account_id, body) -``` - -## OpenAPIGenerator - -```ruby -account_id = BW_ACCOUNT_ID - -body = OpenapiClient::MessageRequest.new( - application_id: BW_MESSAGING_APPLICATION_ID.to_s, - to: [USER_NUMBER], - from: BW_NUMBER, - text: "ruby new sdk test" -) - -messaging_client.create_message(account_id, body) -``` - -# OpenApiGenerator Quirks +# Custom Base URL * To get a custom url, instead of setting the `environment` parameter in the config, you must make a custom operation in `configuration.rb` ``` ruby -"Pipedream": [ - { - url: "https://d6979da481772c167be0edcd10eb64d7.m.pipedream.net", - description: "testing" - } - ], -``` -this must go in `operation_server_settings` and then `:operation => :"Pipedream",` must go in `new_options = opts.merge(` for the method you are calling within the `?_api.rb` file for the specific api +"Custom": [ + { + url: "https://d6979da481772c167be0edcd10eb64d7.m.pipedream.net", + description: "testing" + } +], +``` +this must go in `operation_server_settings` and then `:operation => :"Custom",` must go in `new_options = opts.merge(` for the method you are calling within the `?_api.rb` file for the specific api diff --git a/spec/integration/messages_api_integration_spec.rb b/spec/integration/messages_api_integration_spec.rb index 2847c45f..5a218473 100644 --- a/spec/integration/messages_api_integration_spec.rb +++ b/spec/integration/messages_api_integration_spec.rb @@ -14,25 +14,53 @@ # Create Message describe 'create_message' do it 'creates an mms message' do - message_text = "ruby sdk test MMS" - body = Bandwidth::MessageRequest.new( - application_id: BW_MESSAGING_APPLICATION_ID, - to: [USER_NUMBER], - from: BW_NUMBER, - text: message_text, - media: ["https://cdn2.thecatapi.com/images/MTY3ODIyMQ.jpg"] - ) - response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) + message_request = Bandwidth::MessageRequest.new( + application_id: BW_MESSAGING_APPLICATION_ID, + to: [USER_NUMBER], + from: BW_NUMBER, + text: "ruby sdk test MMS", + media: ["https://cdn2.thecatapi.com/images/MTY3ODIyMQ.jpg"], + tag: "ruby sdk test MMS tag" + ) + + response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, message_request) + + expect(response[CODE]).to eq(202) + expect(response[DATA]).to be_instance_of(Bandwidth::Message) + expect(response[DATA].id.length).to eq(29) + expect(response[DATA].owner).to eq(BW_NUMBER) + expect(response[DATA].to).to eq([USER_NUMBER]) + expect(response[DATA].from).to eq(BW_NUMBER) + expect(response[DATA].text).to eq(message_request.text) + expect(response[DATA].media).to eq(message_request.media) + expect(response[DATA].tag).to eq(message_request.tag) + end - expect(response[CODE]).to eq(202) - expect(response[DATA]).to be_instance_of(Bandwidth::Message) - expect(response[DATA].id.length).to eq(29) - expect(response[DATA].owner).to eq(BW_NUMBER) - expect(response[DATA].from).to eq(BW_NUMBER) - expect(response[DATA].to).to eq([USER_NUMBER]) - expect(response[DATA].tag).to eq(body.tag) - expect(response[DATA].media).to eq(body.media) - expect(response[DATA].text).to eq(message_text) + it 'creates an sms message' do + expiration_time = Time.now + 60 + expiration_time = expiration_time.round + message_request = Bandwidth::MessageRequest.new( + application_id: BW_MESSAGING_APPLICATION_ID, + to: [USER_NUMBER], + from: BW_NUMBER, + text: "ruby sdk test SMS", + tag: "ruby sdk test SMS tag", + priority: Bandwidth::PriorityEnum::HIGH, + expiration: expiration_time.to_datetime.rfc3339 + ) + + response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, message_request) + + expect(response[CODE]).to eq(202) + expect(response[DATA]).to be_instance_of(Bandwidth::Message) + expect(response[DATA].id.length).to eq(29) + expect(response[DATA].owner).to eq(BW_NUMBER) + expect(response[DATA].to).to eq([USER_NUMBER]) + expect(response[DATA].from).to eq(BW_NUMBER) + expect(response[DATA].text).to eq(message_request.text) + expect(response[DATA].tag).to eq(message_request.tag) + expect(response[DATA].priority).to eq(message_request.priority) + expect(response[DATA].expiration).to eq(expiration_time) end end diff --git a/spec/unit/models/message_spec.rb b/spec/unit/models/message_spec.rb index 0c4500ab..07e9d580 100644 --- a/spec/unit/models/message_spec.rb +++ b/spec/unit/models/message_spec.rb @@ -97,4 +97,10 @@ end end + describe 'test attribute "expiration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end From 28ed4499dcd3494b87c553ea524de3a48ca643d8 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Mon, 20 Mar 2023 16:08:54 -0400 Subject: [PATCH 15/30] remove application id assert from recordings test because its not guaranteed (#90) --- spec/integration/recordings_api_integration_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/recordings_api_integration_spec.rb b/spec/integration/recordings_api_integration_spec.rb index f7e132dc..27e3fce4 100644 --- a/spec/integration/recordings_api_integration_spec.rb +++ b/spec/integration/recordings_api_integration_spec.rb @@ -62,7 +62,7 @@ expect(response[CODE]).to eq(200) expect(response[DATA][0]).to be_instance_of(Bandwidth::CallRecordingMetadata) - expect(response[DATA][0].application_id).to eq(MANTECA_APPLICATION_ID) + expect(response[DATA][0].application_id).to be_instance_of(String) expect(response[DATA][0].account_id).to eq(BW_ACCOUNT_ID) end end From f13032c69e672d161e518d4fb9bfc46dac0de430 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Wed, 22 Mar 2023 10:50:25 -0400 Subject: [PATCH 16/30] update tests workflows for feature branch --- .github/workflows/test-nightly.yml | 23 ----------------------- .github/workflows/test-pr.yml | 27 ++------------------------- 2 files changed, 2 insertions(+), 48 deletions(-) diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-nightly.yml index 56501d4a..073aef42 100644 --- a/.github/workflows/test-nightly.yml +++ b/.github/workflows/test-nightly.yml @@ -43,29 +43,6 @@ jobs: with: ruby-version: ${{ matrix.ruby-version }} - - name: Install Packages and Test - run: | - bundle install - rake - - test_feature: - name: Test Feature Branch Nightly - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04] - ruby-version: [2.7, 3.0, 3.1, 3.2] - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: 'feature/openapi-generator-sdk' - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - - name: Install Packages and Test env: RUBY_VERSION: ${{ matrix.ruby-version }} diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index a21b06e8..3c136736 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -24,32 +24,9 @@ env: MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} jobs: - test_pr_main: - name: Test PR to Main Branch + test_pr: + name: Test PR runs-on: ${{ matrix.os }} - if: github.base_ref == 'main' - strategy: - matrix: - os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04] - ruby-version: [2.6, 2.7, 3.0] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - - - name: Install Packages and Test - run: | - bundle install - rake - - test_pr_feature: - name: Test PR to Feature Branch - runs-on: ${{ matrix.os }} - if: github.base_ref == 'feature/openapi-generator-sdk' strategy: matrix: os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04] From 677fd3df0241290e09d5f3ea6fba88b8cb326901 Mon Sep 17 00:00:00 2001 From: Matthew Martin <105743990+matthewkmartin@users.noreply.github.com> Date: Thu, 23 Mar 2023 08:19:15 -0400 Subject: [PATCH 17/30] Task: Update Manteca Test IDs (#89) --- spec/call_utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/call_utils.rb b/spec/call_utils.rb index 3c6d8191..0f67c962 100644 --- a/spec/call_utils.rb +++ b/spec/call_utils.rb @@ -12,7 +12,7 @@ def setup_manteca(type) begin test_id = Net::HTTP.post(manteca_test_url, manteca_body.to_json, manteca_header) - return test_id.body.to_s.gsub("\"", "") + return test_id.body.to_s rescue => e puts e.inspect end From ad74e918d47019275d3ead0d3600e2b005cedd50 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Fri, 9 Jun 2023 10:10:15 -0400 Subject: [PATCH 18/30] SWI-2788 Add Transcription BXML to Feature Branch (#100) * SWI-2788 Add Transcription BXML to Feature Branch * update workflow * update workflows with formatting --- .github/workflows/deploy.yml | 14 ++-- .github/workflows/test-nightly.yml | 6 +- .github/workflows/test-pr.yml | 2 +- lib/bandwidth-sdk.rb | 3 + .../models/bxml/verbs/custom_param.rb | 18 +++++ .../models/bxml/verbs/start_transcription.rb | 31 ++++++++ .../models/bxml/verbs/stop_transcription.rb | 17 +++++ .../integration/calls_api_integration_spec.rb | 29 ++++--- spec/spec_helper.rb | 3 + .../models/bxml/verbs/custom_param_spec.rb | 38 ++++++++++ .../bxml/verbs/start_transcription_spec.rb | 76 +++++++++++++++++++ .../bxml/verbs/stop_transcription_spec.rb | 36 +++++++++ 12 files changed, 250 insertions(+), 23 deletions(-) create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb create mode 100644 lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb create mode 100644 spec/unit/models/bxml/verbs/custom_param_spec.rb create mode 100644 spec/unit/models/bxml/verbs/start_transcription_spec.rb create mode 100644 spec/unit/models/bxml/verbs/stop_transcription_spec.rb diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 023f6390..c77f3b61 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -38,7 +38,7 @@ jobs: uses: ./.github/actions/deploy env: RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} - + - uses: Bandwidth/build-notify-slack-action@v1.0.0 if: always() with: @@ -61,14 +61,14 @@ jobs: BW_NUMBER: ${{ secrets.BW_NUMBER }} USER_NUMBER: ${{ secrets.USER_NUMBER }} BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} - RUBY_VERSION: '3.0' - OPERATING_SYSTEM: 'ubuntu' + RUBY_VERSION: "3.0" + OPERATING_SYSTEM: "ubuntu" 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 }} - + steps: - name: Set Release Version run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV @@ -82,7 +82,7 @@ jobs: echo 'Please update your tag to match the expected regex pattern' exit 1 fi - + - name: Checkout uses: actions/checkout@v3 with: @@ -98,12 +98,12 @@ jobs: - name: Test run: rake - + - name: Deploy to Rubygems uses: ./.github/actions/deploy env: RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} - + - uses: Bandwidth/build-notify-slack-action@v1.0.0 if: always() with: diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-nightly.yml index 773588ed..4eeeba57 100644 --- a/.github/workflows/test-nightly.yml +++ b/.github/workflows/test-nightly.yml @@ -29,14 +29,14 @@ jobs: name: Test Main Branch Nightly runs-on: ${{ matrix.os }} strategy: - matrix: + matrix: os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04] ruby-version: [2.7, 3.0, 3.1, 3.2] steps: - name: Checkout uses: actions/checkout@v3 with: - ref: 'main' + ref: "main" - name: Set up Ruby uses: ruby/setup-ruby@v1 @@ -53,7 +53,7 @@ jobs: notify_for_failures: name: Notify for Failures - needs: [test_main, test_feature] + needs: [test_main] if: failure() runs-on: ubuntu-latest steps: diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 3c136736..c6536f1f 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -28,7 +28,7 @@ jobs: name: Test PR runs-on: ${{ matrix.os }} strategy: - matrix: + matrix: os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04] ruby-version: [2.7, 3.0, 3.1, 3.2] steps: diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index 84f94741..e62e7295 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -113,6 +113,7 @@ require 'bandwidth-sdk/models/bxml/nestable_verb' require 'bandwidth-sdk/models/bxml/verbs/bridge' require 'bandwidth-sdk/models/bxml/verbs/conference' +require 'bandwidth-sdk/models/bxml/verbs/custom_param' require 'bandwidth-sdk/models/bxml/verbs/forward' require 'bandwidth-sdk/models/bxml/verbs/gather' require 'bandwidth-sdk/models/bxml/verbs/hangup' @@ -130,9 +131,11 @@ require 'bandwidth-sdk/models/bxml/verbs/start_gather' require 'bandwidth-sdk/models/bxml/verbs/start_recording' require 'bandwidth-sdk/models/bxml/verbs/start_stream' +require 'bandwidth-sdk/models/bxml/verbs/start_transcription' require 'bandwidth-sdk/models/bxml/verbs/stop_gather' require 'bandwidth-sdk/models/bxml/verbs/stop_recording' require 'bandwidth-sdk/models/bxml/verbs/stop_stream' +require 'bandwidth-sdk/models/bxml/verbs/stop_transcription' require 'bandwidth-sdk/models/bxml/verbs/stream_param' require 'bandwidth-sdk/models/bxml/verbs/tag' require 'bandwidth-sdk/models/bxml/verbs/transfer' diff --git a/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb b/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb new file mode 100644 index 00000000..3c83d710 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb @@ -0,0 +1,18 @@ +module Bandwidth + module Bxml + class CustomParam + include Bandwidth::Bxml::Verb + + # Initializer + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(attributes = {}) + super("CustomParam", nil, attributes) + + @attribute_map = { + name: 'name', # [String]: The name of this parameter, up to 256 characters. + value: 'value', # [String]: The value of this parameter, up to 2048 characters. + } + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb new file mode 100644 index 00000000..50e3a6ac --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb @@ -0,0 +1,31 @@ +module Bandwidth + module Bxml + class StartTranscription + include Bandwidth::Bxml::NestableVerb + + # Initializer + # @param custom_params [Array] XML element children. Defaults to an empty array. Valid nested custom params are: CustomParam. You may specify up to 12 elements nested within a tag. + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(custom_params = [], attributes = {}) + super("StartTranscription", nil, custom_params, attributes) + + @attribute_map = { + name: 'name', # Optional [String]: A name to refer to this transcription by. Used when sending . If not provided, it will default to the generated transcription id as sent in the Real-Time Transcription Started webhook. + tracks: 'tracks', # Optional [String]: The part of the call to send a transcription from. inbound, outbound or both. Default is inbound. + transcription_event_url: 'transcriptionEventUrl', # Optional [String]: URL to send the associated Webhook events to during this real-time transcription's lifetime. Does not accept BXML. May be a relative URL. + transcription_event_method: 'transcriptionEventMethod', # Optional [String]: The HTTP method to use for the request to transcriptionEventUrl. GET or POST. Default value is POST. + username: 'username', # Optional [String]: The username to send in the HTTP request to transcriptionEventUrl. If specified, the transcriptionEventUrl must be TLS-encrypted (i.e., https). + password: 'password', # Optional [String]: The password to send in the HTTP request to transcriptionEventUrl. If specified, the transcriptionEventUrl must be TLS-encrypted (i.e., https). + destination: 'destination', # Optional [String]: A websocket URI to send the transcription to. A transcription of the specified tracks will be sent via websocket to this URL as a series of JSON messages. See below for more details on the websocket packet format. + stabilized: 'stabilized', # Optional [Boolean]: Whether to send transcription update events to the specified destination only after they have become stable. Requires destination. Defaults to true. + } + end + + # Add custom param/s to the nested verbs array + # @param custom_params [CustomParam] or [Array] Verb or verbs to add to the array. + def add_custom_param(custom_params) + @nested_verbs.push(*custom_params) + end + end + end +end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb new file mode 100644 index 00000000..24c481f4 --- /dev/null +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb @@ -0,0 +1,17 @@ +module Bandwidth + module Bxml + class StopTranscription + include Bandwidth::Bxml::Verb + + # Initializer + # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. + def initialize(attributes = {}) + super("StopTranscription", nil, attributes) + + @attribute_map = { + name: 'name' # [String]: The name of the real-time transcription to stop. This is either the user selected name when sending the verb, or the system generated name returned in the Real-Time Transcription Started webhook if was sent with no name attribute. If no name is specified, then all active call transcriptions will be stopped. + } + end + end + end +end diff --git a/spec/integration/calls_api_integration_spec.rb b/spec/integration/calls_api_integration_spec.rb index 0b34a33a..c1e34bb8 100644 --- a/spec/integration/calls_api_integration_spec.rb +++ b/spec/integration/calls_api_integration_spec.rb @@ -41,7 +41,6 @@ ) response = @api_instance_calls.create_call_with_http_info(BW_ACCOUNT_ID, call_body) - sleep(SLEEP_TIME_S) expect(response[CODE]).to eq(201) expect(response[DATA]).to be_instance_of(Bandwidth::CreateCallResponse) @@ -67,17 +66,23 @@ # Get Call State Information describe 'get_call_state' do it 'gets the call state' do - response = @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id) - - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::CallState) - expect(response[DATA].call_id).to eq($call_info_id) - expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) - expect(response[DATA].application_id).to eq(BW_VOICE_APPLICATION_ID) - expect(response[DATA].start_time).to be_instance_of(Time) - expect(response[DATA].last_update).to be_instance_of(Time) - expect(response[DATA].state).to be_instance_of(String) - expect(response[DATA].direction).to eq(Bandwidth::CallDirectionEnum::OUTBOUND) + begin + response = @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(Bandwidth::CallState) + expect(response[DATA].call_id).to eq($call_info_id) + expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) + expect(response[DATA].application_id).to eq(BW_VOICE_APPLICATION_ID) + expect(response[DATA].start_time).to be_instance_of(Time) + expect(response[DATA].last_update).to be_instance_of(Time) + expect(response[DATA].state).to be_instance_of(String) + expect(response[DATA].direction).to eq(Bandwidth::CallDirectionEnum::OUTBOUND) + rescue Bandwidth::ApiError => e + if e.code != 404 + raise e + end + end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8a414837..1b2253d6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,6 +13,9 @@ # load the gem require 'bandwidth-sdk' +# load call utils every time. This prevents an error from occuring when running only unit tests +require_relative './call_utils' + # The following was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause diff --git a/spec/unit/models/bxml/verbs/custom_param_spec.rb b/spec/unit/models/bxml/verbs/custom_param_spec.rb new file mode 100644 index 00000000..9fac6600 --- /dev/null +++ b/spec/unit/models/bxml/verbs/custom_param_spec.rb @@ -0,0 +1,38 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::CustomParam +describe 'Bandwidth::Bxml::CustomParam' do + let(:initial_attributes) { + { + name: 'initial_name', + value: 'initial_value' + } + } + + let(:new_attributes) { + { + name: 'new_name', + value: 'new_value' + } + } + + let(:instance) { Bandwidth::Bxml::CustomParam.new(initial_attributes) } + + describe 'test an instance of CustomParam' do + it 'validates instance of CustomParam' do + expect(instance).to be_instance_of(Bandwidth::Bxml::CustomParam) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the CustomParam instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the CustomParam instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end diff --git a/spec/unit/models/bxml/verbs/start_transcription_spec.rb b/spec/unit/models/bxml/verbs/start_transcription_spec.rb new file mode 100644 index 00000000..39e388a8 --- /dev/null +++ b/spec/unit/models/bxml/verbs/start_transcription_spec.rb @@ -0,0 +1,76 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::StartTranscription +describe 'Bandwidth::Bxml::StartTranscription' do + let(:initial_attributes) { + { + name: 'initial_name', + tracks: 'inbound', + transcription_event_url: 'https://initial.com', + transcription_event_method: 'POST', + username: 'initial_username', + password: 'initial_password', + destination: 'https://initial.com', + stabilized: true + } + } + + let(:new_attributes) { + { + name: 'new_name', + tracks: 'outbound', + transcription_event_url: 'https://new.com', + transcription_event_method: 'GET', + username: 'new_username', + password: 'new_password', + destination: 'https://new.com', + stabilized: false + } + } + + let (:custom_param_1) { Bandwidth::Bxml::CustomParam.new({name: 'custom_param_name_1', value: 'custom_param_value_1'}) } + let (:custom_param_2) { Bandwidth::Bxml::CustomParam.new({name: 'custom_param_name_2', value: 'custom_param_value_2'}) } + + let(:instance) { Bandwidth::Bxml::StartTranscription.new([], initial_attributes) } + let(:instance_nested) { Bandwidth::Bxml::StartTranscription.new([custom_param_1], initial_attributes) } + + describe 'test an instance of StartTranscription' do + it 'validates instance of StartTranscription' do + expect(instance).to be_instance_of(Bandwidth::Bxml::StartTranscription) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the StartTranscription instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the StartTranscription instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end + + describe 'test an instance of StartTranscription with nested verbs' do + it 'validates instance of StartTranscription' do + expect(instance_nested).to be_instance_of(Bandwidth::Bxml::StartTranscription) + expect(instance_nested).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the nested StartTranscription instance' do + expected = "\n\n \n\n" + expect(instance_nested.to_bxml).to eq(expected) + end + + it 'tests the add_custom_param method of the nested StartTranscription instance' do + expected_single = "\n\n \n \n\n" + instance_nested.add_custom_param(custom_param_2) + expect(instance_nested.to_bxml).to eq(expected_single) + + expected_multiple = "\n\n \n \n \n \n\n" + instance_nested.add_custom_param([custom_param_2, custom_param_2]) + expect(instance_nested.to_bxml).to eq(expected_multiple) + end + end +end diff --git a/spec/unit/models/bxml/verbs/stop_transcription_spec.rb b/spec/unit/models/bxml/verbs/stop_transcription_spec.rb new file mode 100644 index 00000000..914d2c9f --- /dev/null +++ b/spec/unit/models/bxml/verbs/stop_transcription_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +# Unit tests for Bandwidth::Bxml::StopTranscription +describe 'Bandwidth::Bxml::StopTranscription' do + let(:initial_attributes) { + { + name: 'initial_name' + } + } + + let(:new_attributes) { + { + name: 'new_name' + } + } + + let(:instance) { Bandwidth::Bxml::StopTranscription.new(initial_attributes) } + + describe 'test an instance of StopTranscription' do + it 'validates instance of StopTranscription' do + expect(instance).to be_instance_of(Bandwidth::Bxml::StopTranscription) + expect(instance).to be_a(Bandwidth::Bxml::Verb) + end + + it 'tests the to_bxml method of the StopTranscription instance' do + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + + it 'tests the set_attributes method of the StopTranscription instance' do + instance.set_attributes(new_attributes) + expected = "\n\n" + expect(instance.to_bxml).to eq(expected) + end + end +end From 6f3eab70dec79300a6910f44049c71b34c69d2de Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Mon, 19 Jun 2023 17:18:02 -0400 Subject: [PATCH 19/30] SWI-2821 Prep for GA (#101) * update spec and use 6.6 * changes we'd need to automate * newline in readme * remove config tests * revert config back to working version * regenerate with v6.5.0 * fix other files * dont try to clean up calls since voice api is slow * update spec * add custom templates and update readme badge * update test workflow name * add openapitools * add sdk update workflow * add config test file and fix it * update config test * update integration tests * Revert "update integration tests" This reverts commit 77545d90ace098e448fa6f1bebd684e38af5e927. * add client option to rakefile * update version logic and ignore file * remove unnecessary env vars from build wf * revert version change * remove unnecessary spec_helper imports * lots of small changes based on rubocop linting * update custom templates * add rubocop badge to README * add gem version badge to readme * remove unnecessary deploy action * update codeowners * update workflows * add gem version env var to test wfs --- .github/CODEOWNERS | 5 +- .github/actions/deploy/Dockerfile | 11 - .github/actions/deploy/action.yml | 6 - .github/actions/deploy/entrypoint.sh | 7 - .github/workflows/deploy.yml | 69 +- .github/workflows/test-nightly.yml | 9 +- .github/workflows/test-pr.yml | 7 +- .github/workflows/update-sdk.yml | 109 +++ .openapi-generator-ignore | 2 + .openapi-generator/FILES | 99 +-- .openapi-generator/VERSION | 2 +- Gemfile | 2 +- README.md | 10 +- Rakefile | 10 +- bandwidth-sdk.gemspec | 2 +- bandwidth.yml | 733 +++++++++--------- custom_templates/Gemfile.mustache | 9 + custom_templates/README.mustache | 170 ++++ custom_templates/gem.mustache | 99 +++ custom_templates/gemspec.mustache | 37 + custom_templates/version.mustache | 7 + docs/AnswerCallback.md | 2 +- docs/CallState.md | 4 +- docs/CallsApi.md | 30 +- docs/Conference.md | 8 +- docs/ConferencesApi.md | 84 +- docs/CreateCall.md | 22 +- docs/CreateCallResponse.md | 22 +- docs/ListMessageItem.md | 4 +- docs/MFAApi.md | 12 +- docs/MachineDetectionCompleteCallback.md | 2 +- docs/MachineDetectionConfiguration.md | 4 +- docs/MachineDetectionResult.md | 20 + docs/MessageDeliveredCallbackMessage.md | 2 +- docs/MessageFailedCallbackMessage.md | 2 +- docs/MessageRequest.md | 2 +- docs/MessageSendingCallbackMessage.md | 2 +- docs/MessagesApi.md | 2 + docs/PhoneNumberLookupApi.md | 8 +- docs/RecordingsApi.md | 104 +-- docs/StatisticsApi.md | 4 +- docs/TranscribeRecording.md | 6 +- docs/UpdateCall.md | 6 +- docs/UpdateConference.md | 6 +- lib/bandwidth-sdk.rb | 3 +- lib/bandwidth-sdk/api/calls_api.rb | 36 +- lib/bandwidth-sdk/api/conferences_api.rb | 92 +-- lib/bandwidth-sdk/api/media_api.rb | 4 +- lib/bandwidth-sdk/api/messages_api.rb | 7 +- lib/bandwidth-sdk/api/mfa_api.rb | 20 +- .../api/phone_number_lookup_api.rb | 12 +- lib/bandwidth-sdk/api/recordings_api.rb | 110 +-- lib/bandwidth-sdk/api/statistics_api.rb | 6 +- lib/bandwidth-sdk/api_client.rb | 2 +- lib/bandwidth-sdk/api_error.rb | 2 +- lib/bandwidth-sdk/configuration.rb | 6 +- .../models/account_statistics.rb | 4 +- lib/bandwidth-sdk/models/answer_callback.rb | 7 +- .../models/bridge_complete_callback.rb | 4 +- .../models/bridge_target_complete_callback.rb | 4 +- lib/bandwidth-sdk/models/bxml/bxml.rb | 2 +- .../models/bxml/nestable_verb.rb | 3 +- lib/bandwidth-sdk/models/bxml/response.rb | 2 +- lib/bandwidth-sdk/models/bxml/root.rb | 4 +- lib/bandwidth-sdk/models/bxml/verb.rb | 4 +- .../models/bxml/verbs/conference.rb | 1 - lib/bandwidth-sdk/models/bxml/verbs/gather.rb | 2 +- .../models/bxml/verbs/speak_sentence.rb | 2 +- .../models/call_direction_enum.rb | 2 +- .../models/call_recording_metadata.rb | 4 +- lib/bandwidth-sdk/models/call_state.rb | 8 +- lib/bandwidth-sdk/models/call_state_enum.rb | 2 +- .../models/callback_method_enum.rb | 2 +- lib/bandwidth-sdk/models/code_request.rb | 4 +- lib/bandwidth-sdk/models/conference.rb | 10 +- .../models/conference_completed_callback.rb | 4 +- .../models/conference_created_callback.rb | 4 +- lib/bandwidth-sdk/models/conference_member.rb | 4 +- .../models/conference_member_exit_callback.rb | 4 +- .../models/conference_member_join_callback.rb | 4 +- ...conference_recording_available_callback.rb | 4 +- .../models/conference_recording_metadata.rb | 4 +- .../models/conference_redirect_callback.rb | 4 +- .../models/conference_state_enum.rb | 2 +- lib/bandwidth-sdk/models/create_call.rb | 19 +- .../models/create_call_response.rb | 20 +- .../models/create_lookup_response.rb | 4 +- .../models/create_message_request_error.rb | 4 +- lib/bandwidth-sdk/models/deferred_result.rb | 4 +- .../models/disconenct_callback.rb | 2 - .../models/disconnect_callback.rb | 4 +- lib/bandwidth-sdk/models/diversion.rb | 4 +- lib/bandwidth-sdk/models/dtmf_callback.rb | 4 +- lib/bandwidth-sdk/models/field_error.rb | 4 +- lib/bandwidth-sdk/models/file_format_enum.rb | 2 +- lib/bandwidth-sdk/models/gather_callback.rb | 4 +- .../models/inbound_message_callback.rb | 4 +- .../inbound_message_callback_message.rb | 5 +- lib/bandwidth-sdk/models/initiate_callback.rb | 4 +- .../models/list_message_direction_enum.rb | 2 +- lib/bandwidth-sdk/models/list_message_item.rb | 25 +- lib/bandwidth-sdk/models/lookup_request.rb | 4 +- lib/bandwidth-sdk/models/lookup_result.rb | 4 +- lib/bandwidth-sdk/models/lookup_status.rb | 4 +- .../models/lookup_status_enum.rb | 2 +- .../machine_detection_complete_callback.rb | 7 +- .../models/machine_detection_configuration.rb | 4 +- .../models/machine_detection_mode_enum.rb | 2 +- .../models/machine_detection_result.rb | 229 ++++++ lib/bandwidth-sdk/models/media.rb | 4 +- lib/bandwidth-sdk/models/message.rb | 4 +- .../models/message_delivered_callback.rb | 4 +- .../message_delivered_callback_message.rb | 5 +- .../models/message_direction_enum.rb | 2 +- .../models/message_failed_callback.rb | 4 +- .../models/message_failed_callback_message.rb | 5 +- lib/bandwidth-sdk/models/message_request.rb | 6 +- .../models/message_sending_callback.rb | 4 +- .../message_sending_callback_message.rb | 5 +- .../models/message_status_enum.rb | 2 +- lib/bandwidth-sdk/models/message_type_enum.rb | 2 +- lib/bandwidth-sdk/models/messages_list.rb | 4 +- .../models/messaging_code_response.rb | 4 +- .../models/messaging_request_error.rb | 4 +- .../models/mfa_forbidden_request_error.rb | 4 +- lib/bandwidth-sdk/models/mfa_request_error.rb | 4 +- .../models/mfa_unauthorized_request_error.rb | 4 +- lib/bandwidth-sdk/models/page_info.rb | 4 +- lib/bandwidth-sdk/models/priority_enum.rb | 2 +- .../models/recording_available_callback.rb | 4 +- .../models/recording_complete_callback.rb | 4 +- .../models/recording_state_enum.rb | 2 +- lib/bandwidth-sdk/models/redirect_callback.rb | 4 +- .../models/redirect_method_enum.rb | 2 +- lib/bandwidth-sdk/models/stir_shaken.rb | 4 +- lib/bandwidth-sdk/models/tag.rb | 4 +- .../models/tn_lookup_request_error.rb | 4 +- .../models/transcribe_recording.rb | 27 +- lib/bandwidth-sdk/models/transcription.rb | 4 +- .../transcription_available_callback.rb | 4 +- .../models/transcription_list.rb | 4 +- .../models/transcription_metadata.rb | 4 +- .../models/transfer_answer_callback.rb | 4 +- .../models/transfer_complete_callback.rb | 4 +- .../models/transfer_disconnect_callback.rb | 4 +- lib/bandwidth-sdk/models/update_call.rb | 15 +- .../models/update_call_recording.rb | 4 +- lib/bandwidth-sdk/models/update_conference.rb | 6 +- .../models/update_conference_member.rb | 4 +- .../models/verify_code_request.rb | 4 +- .../models/verify_code_response.rb | 4 +- lib/bandwidth-sdk/models/voice_api_error.rb | 4 +- .../models/voice_code_response.rb | 4 +- lib/bandwidth-sdk/version.rb | 4 +- openapi-config.yml | 1 + openapitools.json | 7 + spec/{unit => }/api/calls_api_spec.rb | 26 +- spec/{unit => }/api/conferences_api_spec.rb | 64 +- spec/{unit => }/api/media_api_spec.rb | 12 +- spec/{unit => }/api/messages_api_spec.rb | 9 +- spec/{unit => }/api/mfa_api_spec.rb | 16 +- .../api/phone_number_lookup_api_spec.rb | 12 +- spec/{unit => }/api/recordings_api_spec.rb | 76 +- spec/{unit => }/api/statistics_api_spec.rb | 8 +- spec/api_client_spec.rb | 223 ++++++ spec/call_utils.rb | 50 +- spec/configuration_spec.rb | 82 ++ .../integration/calls_api_integration_spec.rb | 4 +- .../conferences_api_integration_spec.rb | 30 +- .../integration/media_api_integration_spec.rb | 20 +- .../messages_api_integration_spec.rb | 2 +- spec/integration/mfa_api_integration_spec.rb | 2 +- ...hone_number_lookup_api_integration_spec.rb | 2 +- .../recordings_api_integration_spec.rb | 50 +- .../statistics_api_integration_spec.rb | 2 +- .../models/account_statistics_spec.rb | 8 +- .../{unit => }/models/answer_callback_spec.rb | 32 +- .../models/bridge_complete_callback_spec.rb | 36 +- .../bridge_target_complete_callback_spec.rb | 30 +- spec/{unit => }/models/bxml/bxml_spec.rb | 2 +- .../models/bxml/nestable_verb_spec.rb | 2 +- spec/{unit => }/models/bxml/response_spec.rb | 2 +- spec/{unit => }/models/bxml/verb_spec.rb | 4 +- .../models/bxml/verbs/bridge_spec.rb | 2 +- .../models/bxml/verbs/conference_spec.rb | 2 +- .../models/bxml/verbs/custom_param_spec.rb | 2 +- .../models/bxml/verbs/forward_spec.rb | 2 +- .../models/bxml/verbs/gather_spec.rb | 2 +- .../models/bxml/verbs/hangup_spec.rb | 2 +- .../models/bxml/verbs/pause_recording_spec.rb | 2 +- .../models/bxml/verbs/pause_spec.rb | 2 +- .../models/bxml/verbs/phone_number_spec.rb | 2 +- .../models/bxml/verbs/play_audio_spec.rb | 2 +- .../models/bxml/verbs/record_spec.rb | 2 +- .../models/bxml/verbs/redirect_spec.rb | 2 +- .../bxml/verbs/resume_recording_spec.rb | 2 +- .../{unit => }/models/bxml/verbs/ring_spec.rb | 2 +- .../models/bxml/verbs/send_dtmf_spec.rb | 2 +- .../models/bxml/verbs/sip_uri_spec.rb | 2 +- .../models/bxml/verbs/speak_sentence_spec.rb | 2 +- .../models/bxml/verbs/start_gather_spec.rb | 2 +- .../models/bxml/verbs/start_recording_spec.rb | 2 +- .../models/bxml/verbs/start_stream_spec.rb | 6 +- .../bxml/verbs/start_transcription_spec.rb | 6 +- .../models/bxml/verbs/stop_gather_spec.rb | 2 +- .../models/bxml/verbs/stop_recording_spec.rb | 2 +- .../models/bxml/verbs/stop_stream_spec.rb | 2 +- .../bxml/verbs/stop_transcription_spec.rb | 2 +- .../models/bxml/verbs/stream_param_spec.rb | 2 +- spec/{unit => }/models/bxml/verbs/tag_spec.rb | 2 +- .../models/bxml/verbs/transfer_spec.rb | 2 +- .../models/call_direction_enum_spec.rb | 4 +- .../models/call_recording_metadata_spec.rb | 40 +- .../{unit => }/models/call_state_enum_spec.rb | 4 +- spec/{unit => }/models/call_state_spec.rb | 40 +- .../models/callback_method_enum_spec.rb | 4 +- spec/{unit => }/models/code_request_spec.rb | 16 +- .../conference_completed_callback_spec.rb | 14 +- .../conference_created_callback_spec.rb | 14 +- .../conference_member_exit_callback_spec.rb | 20 +- .../conference_member_join_callback_spec.rb | 20 +- .../models/conference_member_spec.rb | 16 +- ...rence_recording_available_callback_spec.rb | 32 +- .../conference_recording_metadata_spec.rb | 26 +- .../conference_redirect_callback_spec.rb | 14 +- spec/{unit => }/models/conference_spec.rb | 20 +- .../models/conference_state_enum_spec.rb | 4 +- .../models/create_call_response_spec.rb | 46 +- spec/{unit => }/models/create_call_spec.rb | 42 +- .../models/create_lookup_response_spec.rb | 8 +- .../create_message_request_error_spec.rb | 10 +- .../{unit => }/models/deferred_result_spec.rb | 8 +- .../models/disconnect_callback_spec.rb | 38 +- spec/{unit => }/models/diversion_spec.rb | 18 +- spec/{unit => }/models/dtmf_callback_spec.rb | 38 +- spec/{unit => }/models/field_error_spec.rb | 8 +- .../models/file_format_enum_spec.rb | 4 +- .../{unit => }/models/gather_callback_spec.rb | 40 +- .../inbound_message_callback_message_spec.rb | 28 +- .../models/inbound_message_callback_spec.rb | 14 +- .../models/initiate_callback_spec.rb | 28 +- .../list_message_direction_enum_spec.rb | 4 +- .../models/list_message_item_spec.rb | 42 +- spec/{unit => }/models/lookup_request_spec.rb | 6 +- spec/{unit => }/models/lookup_result_spec.rb | 22 +- .../models/lookup_status_enum_spec.rb | 4 +- spec/{unit => }/models/lookup_status_spec.rb | 12 +- ...achine_detection_complete_callback_spec.rb | 32 +- .../machine_detection_configuration_spec.rb | 34 +- .../machine_detection_mode_enum_spec.rb | 4 +- spec/models/machine_detection_result_spec.rb | 40 + spec/{unit => }/models/media_spec.rb | 10 +- ...message_delivered_callback_message_spec.rb | 28 +- .../models/message_delivered_callback_spec.rb | 14 +- .../models/message_direction_enum_spec.rb | 4 +- .../message_failed_callback_message_spec.rb | 28 +- .../models/message_failed_callback_spec.rb | 16 +- .../{unit => }/models/message_request_spec.rb | 20 +- .../message_sending_callback_message_spec.rb | 28 +- .../models/message_sending_callback_spec.rb | 14 +- spec/{unit => }/models/message_spec.rb | 30 +- .../models/message_status_enum_spec.rb | 4 +- .../models/message_type_enum_spec.rb | 4 +- spec/{unit => }/models/messages_list_spec.rb | 10 +- .../models/messaging_code_response_spec.rb | 6 +- .../models/messaging_request_error_spec.rb | 8 +- .../mfa_forbidden_request_error_spec.rb | 6 +- .../models/mfa_request_error_spec.rb | 8 +- .../mfa_unauthorized_request_error_spec.rb | 6 +- spec/{unit => }/models/page_info_spec.rb | 12 +- spec/{unit => }/models/priority_enum_spec.rb | 4 +- .../recording_available_callback_spec.rb | 48 +- .../recording_complete_callback_spec.rb | 48 +- .../models/recording_state_enum_spec.rb | 4 +- .../models/redirect_callback_spec.rb | 36 +- .../models/redirect_method_enum_spec.rb | 4 +- spec/{unit => }/models/stir_shaken_spec.rb | 10 +- spec/{unit => }/models/tag_spec.rb | 8 +- .../models/tn_lookup_request_error_spec.rb | 6 +- .../models/transcribe_recording_spec.rb | 22 +- .../transcription_available_callback_spec.rb | 46 +- .../models/transcription_list_spec.rb | 6 +- .../models/transcription_metadata_spec.rb | 12 +- spec/{unit => }/models/transcription_spec.rb | 8 +- .../models/transfer_answer_callback_spec.rb | 34 +- .../models/transfer_complete_callback_spec.rb | 40 +- .../transfer_disconnect_callback_spec.rb | 44 +- .../models/update_call_recording_spec.rb | 6 +- spec/{unit => }/models/update_call_spec.rb | 24 +- .../models/update_conference_member_spec.rb | 10 +- .../models/update_conference_spec.rb | 22 +- .../models/verify_code_request_spec.rb | 12 +- .../models/verify_code_response_spec.rb | 6 +- .../{unit => }/models/voice_api_error_spec.rb | 10 +- .../models/voice_code_response_spec.rb | 6 +- spec/spec_helper.rb | 2 +- 296 files changed, 3009 insertions(+), 2169 deletions(-) delete mode 100644 .github/actions/deploy/Dockerfile delete mode 100644 .github/actions/deploy/action.yml delete mode 100644 .github/actions/deploy/entrypoint.sh create mode 100644 .github/workflows/update-sdk.yml create mode 100644 custom_templates/Gemfile.mustache create mode 100644 custom_templates/README.mustache create mode 100644 custom_templates/gem.mustache create mode 100644 custom_templates/gemspec.mustache create mode 100644 custom_templates/version.mustache create mode 100644 docs/MachineDetectionResult.md create mode 100644 lib/bandwidth-sdk/models/machine_detection_result.rb create mode 100644 openapitools.json rename spec/{unit => }/api/calls_api_spec.rb (76%) rename spec/{unit => }/api/conferences_api_spec.rb (69%) rename spec/{unit => }/api/media_api_spec.rb (86%) rename spec/{unit => }/api/messages_api_spec.rb (92%) rename spec/{unit => }/api/mfa_api_spec.rb (73%) rename spec/{unit => }/api/phone_number_lookup_api_spec.rb (76%) rename spec/{unit => }/api/recordings_api_spec.rb (69%) rename spec/{unit => }/api/statistics_api_spec.rb (82%) create mode 100644 spec/api_client_spec.rb create mode 100644 spec/configuration_spec.rb rename spec/{unit => }/models/account_statistics_spec.rb (76%) rename spec/{unit => }/models/answer_callback_spec.rb (54%) rename spec/{unit => }/models/bridge_complete_callback_spec.rb (54%) rename spec/{unit => }/models/bridge_target_complete_callback_spec.rb (56%) rename spec/{unit => }/models/bxml/bxml_spec.rb (95%) rename spec/{unit => }/models/bxml/nestable_verb_spec.rb (94%) rename spec/{unit => }/models/bxml/response_spec.rb (96%) rename spec/{unit => }/models/bxml/verb_spec.rb (89%) rename spec/{unit => }/models/bxml/verbs/bridge_spec.rb (99%) rename spec/{unit => }/models/bxml/verbs/conference_spec.rb (99%) rename spec/{unit => }/models/bxml/verbs/custom_param_spec.rb (97%) rename spec/{unit => }/models/bxml/verbs/forward_spec.rb (98%) rename spec/{unit => }/models/bxml/verbs/gather_spec.rb (99%) rename spec/{unit => }/models/bxml/verbs/hangup_spec.rb (95%) rename spec/{unit => }/models/bxml/verbs/pause_recording_spec.rb (96%) rename spec/{unit => }/models/bxml/verbs/pause_spec.rb (97%) rename spec/{unit => }/models/bxml/verbs/phone_number_spec.rb (99%) rename spec/{unit => }/models/bxml/verbs/play_audio_spec.rb (98%) rename spec/{unit => }/models/bxml/verbs/record_spec.rb (99%) rename spec/{unit => }/models/bxml/verbs/redirect_spec.rb (98%) rename spec/{unit => }/models/bxml/verbs/resume_recording_spec.rb (96%) rename spec/{unit => }/models/bxml/verbs/ring_spec.rb (97%) rename spec/{unit => }/models/bxml/verbs/send_dtmf_spec.rb (97%) rename spec/{unit => }/models/bxml/verbs/sip_uri_spec.rb (99%) rename spec/{unit => }/models/bxml/verbs/speak_sentence_spec.rb (98%) rename spec/{unit => }/models/bxml/verbs/start_gather_spec.rb (98%) rename spec/{unit => }/models/bxml/verbs/start_recording_spec.rb (99%) rename spec/{unit => }/models/bxml/verbs/start_stream_spec.rb (93%) rename spec/{unit => }/models/bxml/verbs/start_transcription_spec.rb (94%) rename spec/{unit => }/models/bxml/verbs/stop_gather_spec.rb (96%) rename spec/{unit => }/models/bxml/verbs/stop_recording_spec.rb (96%) rename spec/{unit => }/models/bxml/verbs/stop_stream_spec.rb (97%) rename spec/{unit => }/models/bxml/verbs/stop_transcription_spec.rb (97%) rename spec/{unit => }/models/bxml/verbs/stream_param_spec.rb (97%) rename spec/{unit => }/models/bxml/verbs/tag_spec.rb (95%) rename spec/{unit => }/models/bxml/verbs/transfer_spec.rb (99%) rename spec/{unit => }/models/call_direction_enum_spec.rb (92%) rename spec/{unit => }/models/call_recording_metadata_spec.rb (53%) rename spec/{unit => }/models/call_state_enum_spec.rb (92%) rename spec/{unit => }/models/call_state_spec.rb (52%) rename spec/{unit => }/models/callback_method_enum_spec.rb (92%) rename spec/{unit => }/models/code_request_spec.rb (62%) rename spec/{unit => }/models/conference_completed_callback_spec.rb (66%) rename spec/{unit => }/models/conference_created_callback_spec.rb (66%) rename spec/{unit => }/models/conference_member_exit_callback_spec.rb (61%) rename spec/{unit => }/models/conference_member_join_callback_spec.rb (61%) rename spec/{unit => }/models/conference_member_spec.rb (63%) rename spec/{unit => }/models/conference_recording_available_callback_spec.rb (56%) rename spec/{unit => }/models/conference_recording_metadata_spec.rb (57%) rename spec/{unit => }/models/conference_redirect_callback_spec.rb (66%) rename spec/{unit => }/models/conference_spec.rb (59%) rename spec/{unit => }/models/conference_state_enum_spec.rb (92%) rename spec/{unit => }/models/create_call_response_spec.rb (52%) rename spec/{unit => }/models/create_call_spec.rb (52%) rename spec/{unit => }/models/create_lookup_response_spec.rb (76%) rename spec/{unit => }/models/create_message_request_error_spec.rb (72%) rename spec/{unit => }/models/deferred_result_spec.rb (75%) rename spec/{unit => }/models/disconnect_callback_spec.rb (53%) rename spec/{unit => }/models/diversion_spec.rb (60%) rename spec/{unit => }/models/dtmf_callback_spec.rb (53%) rename spec/{unit => }/models/field_error_spec.rb (75%) rename spec/{unit => }/models/file_format_enum_spec.rb (92%) rename spec/{unit => }/models/gather_callback_spec.rb (52%) rename spec/{unit => }/models/inbound_message_callback_message_spec.rb (56%) rename spec/{unit => }/models/inbound_message_callback_spec.rb (65%) rename spec/{unit => }/models/initiate_callback_spec.rb (56%) rename spec/{unit => }/models/list_message_direction_enum_spec.rb (92%) rename spec/{unit => }/models/list_message_item_spec.rb (52%) rename spec/{unit => }/models/lookup_request_spec.rb (82%) rename spec/{unit => }/models/lookup_result_spec.rb (58%) rename spec/{unit => }/models/lookup_status_enum_spec.rb (92%) rename spec/{unit => }/models/lookup_status_spec.rb (67%) rename spec/{unit => }/models/machine_detection_complete_callback_spec.rb (56%) rename spec/{unit => }/models/machine_detection_configuration_spec.rb (56%) rename spec/{unit => }/models/machine_detection_mode_enum_spec.rb (92%) create mode 100644 spec/models/machine_detection_result_spec.rb rename spec/{unit => }/models/media_spec.rb (70%) rename spec/{unit => }/models/message_delivered_callback_message_spec.rb (56%) rename spec/{unit => }/models/message_delivered_callback_spec.rb (66%) rename spec/{unit => }/models/message_direction_enum_spec.rb (92%) rename spec/{unit => }/models/message_failed_callback_message_spec.rb (56%) rename spec/{unit => }/models/message_failed_callback_spec.rb (63%) rename spec/{unit => }/models/message_request_spec.rb (59%) rename spec/{unit => }/models/message_sending_callback_message_spec.rb (56%) rename spec/{unit => }/models/message_sending_callback_spec.rb (65%) rename spec/{unit => }/models/message_spec.rb (54%) rename spec/{unit => }/models/message_status_enum_spec.rb (92%) rename spec/{unit => }/models/message_type_enum_spec.rb (92%) rename spec/{unit => }/models/messages_list_spec.rb (70%) rename spec/{unit => }/models/messaging_code_response_spec.rb (83%) rename spec/{unit => }/models/messaging_request_error_spec.rb (76%) rename spec/{unit => }/models/mfa_forbidden_request_error_spec.rb (83%) rename spec/{unit => }/models/mfa_request_error_spec.rb (75%) rename spec/{unit => }/models/mfa_unauthorized_request_error_spec.rb (83%) rename spec/{unit => }/models/page_info_spec.rb (67%) rename spec/{unit => }/models/priority_enum_spec.rb (92%) rename spec/{unit => }/models/recording_available_callback_spec.rb (52%) rename spec/{unit => }/models/recording_complete_callback_spec.rb (52%) rename spec/{unit => }/models/recording_state_enum_spec.rb (92%) rename spec/{unit => }/models/redirect_callback_spec.rb (53%) rename spec/{unit => }/models/redirect_method_enum_spec.rb (92%) rename spec/{unit => }/models/stir_shaken_spec.rb (71%) rename spec/{unit => }/models/tag_spec.rb (74%) rename spec/{unit => }/models/tn_lookup_request_error_spec.rb (82%) rename spec/{unit => }/models/transcribe_recording_spec.rb (59%) rename spec/{unit => }/models/transcription_available_callback_spec.rb (52%) rename spec/{unit => }/models/transcription_list_spec.rb (82%) rename spec/{unit => }/models/transcription_metadata_spec.rb (68%) rename spec/{unit => }/models/transcription_spec.rb (75%) rename spec/{unit => }/models/transfer_answer_callback_spec.rb (54%) rename spec/{unit => }/models/transfer_complete_callback_spec.rb (53%) rename spec/{unit => }/models/transfer_disconnect_callback_spec.rb (52%) rename spec/{unit => }/models/update_call_recording_spec.rb (82%) rename spec/{unit => }/models/update_call_spec.rb (57%) rename spec/{unit => }/models/update_conference_member_spec.rb (72%) rename spec/{unit => }/models/update_conference_spec.rb (59%) rename spec/{unit => }/models/verify_code_request_spec.rb (68%) rename spec/{unit => }/models/verify_code_response_spec.rb (82%) rename spec/{unit => }/models/voice_api_error_spec.rb (70%) rename spec/{unit => }/models/voice_code_response_spec.rb (82%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d8b80d12..0b1894e8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,5 @@ # Global rule: -* @Bandwidth/dx \ No newline at end of file +* @Bandwidth/band-swi @Bandwidth/band-swi-github-repo-admin + +# SWI as reviewers on catalog files +.bandwidth @Bandwidth/band-swi diff --git a/.github/actions/deploy/Dockerfile b/.github/actions/deploy/Dockerfile deleted file mode 100644 index a120746d..00000000 --- a/.github/actions/deploy/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Container image that runs your code -FROM ruby:latest - -# Copies your code file from your action repository to the filesystem path `/` of the container -COPY entrypoint.sh /entrypoint.sh - -#Make entrypoint.sh exacutable -RUN chmod +x /entrypoint.sh - -# Code file to execute when the docker container starts up (`entrypoint.sh`) -ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/deploy/action.yml b/.github/actions/deploy/action.yml deleted file mode 100644 index 6b866b4b..00000000 --- a/.github/actions/deploy/action.yml +++ /dev/null @@ -1,6 +0,0 @@ -# action.yml -name: "Deploy" -description: "Deploys the ruby sdk to Rubygems" -runs: - using: "docker" - image: "Dockerfile" diff --git a/.github/actions/deploy/entrypoint.sh b/.github/actions/deploy/entrypoint.sh deleted file mode 100644 index 3fc4ff22..00000000 --- a/.github/actions/deploy/entrypoint.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -mkdir ~/.gem #Rubygems needs this directory for auth -echo "---\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials #The file to store rubygems auth. Must be in this format -chmod 0600 ~/.gem/credentials #Rubygems expects this permissions -gem build *.gemspec -gem push *.gem -k rubygems diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c77f3b61..e2683002 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,48 +7,7 @@ on: jobs: deploy: - name: Deploy to Rubygems - if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.0" - - - name: Install Packages - run: bundle install - - - name: Test - env: - BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} - BW_USERNAME: ${{ secrets.BW_USERNAME }} - BW_PASSWORD: ${{ secrets.BW_PASSWORD }} - 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 }} - BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} - run: rake - - - name: Deploy to Rubygems - uses: ./.github/actions/deploy - env: - RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} - - - uses: Bandwidth/build-notify-slack-action@v1.0.0 - if: always() - with: - job-status: ${{ job.status }} - slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} - slack-channel: ${{ secrets.SLACK_CHANNEL }} - - deploy_pre_release: - name: Deploy OpenAPI Generator Client Pre-Release to Rubygems - if: ${{ github.event.release.prerelease && github.event.release.target_commitish == 'feature/openapi-generator-sdk' }} + name: Deploy SDK to Rubygems # TODO: Decide on putting env vars in vault after we decide on mocking integration tests runs-on: ubuntu-latest env: BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} @@ -71,12 +30,12 @@ jobs: steps: - name: Set Release Version - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV - - - name: Check Release Tag Format run: | + RELEASE_VERSION=${GITHUB_REF#refs/tags/v} re=[0-9]+\.[0-9]+\.[0-9]+\.pre\.beta\.[0-9]+\.?[0-9]*\.?[0-9]* - if ! [[ $RELEASE_VERSION =~ $re ]]; then + if [[ $RELEASE_VERSION =~ $re ]]; then + echo "GEM_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV + else echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+\.[0-9]+\.[0-9]+\.pre\.beta\.[0-9]+\.?[0-9]*\.?[0-9]*)' echo $RELEASE_VERSION echo 'Please update your tag to match the expected regex pattern' @@ -85,22 +44,24 @@ jobs: - name: Checkout uses: actions/checkout@v3 - with: - ref: feature/openapi-generator-sdk - name: Setup Ruby uses: ruby/setup-ruby@v1 with: ruby-version: "3.0" - - name: Install Packages - run: bundle install - - - name: Test - run: rake + - name: Install Packages and Test + run: | + bundle install + rake - name: Deploy to Rubygems - uses: ./.github/actions/deploy + run: | + mkdir ~/.gem + echo "---\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials + chmod 0600 ~/.gem/credentials + gem build *.gemspec + gem push *.gem -k rubygems env: RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-nightly.yml index 4eeeba57..8156c54a 100644 --- a/.github/workflows/test-nightly.yml +++ b/.github/workflows/test-nightly.yml @@ -1,4 +1,4 @@ -name: Test Main and Feature Branch Nightly +name: Test Main Branch Nightly on: schedule: @@ -44,12 +44,13 @@ jobs: ruby-version: ${{ matrix.ruby-version }} - name: Install Packages and Test - env: - RUBY_VERSION: ${{ matrix.ruby-version }} - OPERATING_SYSTEM: ${{ matrix.os }} run: | bundle install rake + env: + RUBY_VERSION: ${{ matrix.ruby-version }} + OPERATING_SYSTEM: ${{ matrix.os }} + GEM_VERSION: "11.0.0" notify_for_failures: name: Notify for Failures diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index c6536f1f..85e8eb59 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -41,9 +41,10 @@ jobs: ruby-version: ${{ matrix.ruby-version }} - name: Install Packages and Test - env: - RUBY_VERSION: ${{ matrix.ruby-version }} - OPERATING_SYSTEM: ${{ matrix.os }} run: | bundle install rake + env: + RUBY_VERSION: ${{ matrix.ruby-version }} + OPERATING_SYSTEM: ${{ matrix.os }} + GEM_VERSION: "11.0.0" diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml new file mode 100644 index 00000000..4696c84b --- /dev/null +++ b/.github/workflows/update-sdk.yml @@ -0,0 +1,109 @@ +name: Update SDK + +on: + schedule: + - cron: "0 14 * * 2" + workflow_dispatch: + +jobs: + update-sdk: + name: Update SDK if Necessary + runs-on: ${{ fromJSON(vars.SWI_GLORG_UBUNTU_2204) }} + outputs: + generate: ${{ steps.compare.outputs.generate }} + permissions: + id-token: write + contents: write + steps: + - name: Get Github and Jira Tokens from Vault + uses: Bandwidth/vault-provider-action@v1 + with: + secrets: | + workloads/prod/software_infra::secrets:dx-github-token:dx-github-token@1::DX_GITHUB_TOKEN + workloads/prod/software_infra::secrets:SDLC-Enforcer-Prod:JIRA_TOKEN@9::JIRA_TOKEN + workloads/prod/software_infra::secrets:SDLC-Enforcer-Prod:JIRA_USERNAME@9::JIRA_USERNAME + + - name: Checkout + uses: actions/checkout@v3 + + - name: Combine Product Specs + uses: Bandwidth/api-specs-combine-action@v1.0.0 + with: + token: ${{ env.DX_GITHUB_TOKEN }} + + - name: Determine if a New SDK is Needed + id: compare + run: | + if cmp -s "bandwidth.yml" "api-specs/bandwidth.yml"; then :; else mv -f api-specs/bandwidth.yml bandwidth.yml; rm -r -f api-specs; echo "generate=true" >> $GITHUB_OUTPUT; fi + + - name: Create JIRA Card for SDK Update + if: ${{ steps.compare.outputs.generate == 'true' }} + id: jira + run: | + JIRA_KEY=$(jq -r '.key' <<< $(curl -s -u $JIRA_USERNAME:$JIRA_TOKEN \ + -X POST https://415a76a1898d1ab9952165e173353bb1.m.pipedream.net \ + -H "Content-Type: application/json" \ + --data-binary @- << EOF + { + "fields": { + "project": { + "key": "SWI" + }, + "summary": "[$LANGUAGE] Update SDK for New Spec Version", + "description": "Prepare the $LANGUAGE SDK for release based on the latest spec changes.", + "assignee": { + "id": "$ASSIGNEE" + }, + "issuetype": { + "name": "Story" + }, + "customfield_12108": "$LANGUAGE SDK is ready for release. Tests are created/updated if need be.", + "customfield_10205": "SWI-1876", + "components": [{ + "name": "Client SDKs" + }] + } + } + EOF + )) + echo "jira-key=$JIRA_KEY" >> $GITHUB_OUTPUT + env: + LANGUAGE: Ruby + ASSIGNEE: 611c2f1740168700691bcc2b + + - name: Build SDK + id: build + if: ${{ startsWith(steps.jira.outputs.jira-key, 'SWI') }} + uses: Bandwidth/generate-sdk-action@v3.0.0 + with: + branch-name: ${{ steps.jira.outputs.jira-key }} + token: ${{ env.DX_GITHUB_TOKEN }} + openapi-generator-version: 6.5.0 + language: ruby + config: ./openapi-config.yml + + - name: Setup Ruby + if: steps.build.outputs.changes + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.0" + + - name: Clean SDK + if: steps.build.outputs.changes + run: | + bundle install + rubocop -A + git add . + git commit -m "Clean SDK using Rubocop" + git push origin ${{ steps.jira.outputs.jira-key }} + env: + GEM_VERSION: "11.0.0" + + - name: Open Pull Request + if: steps.build.outputs.changes + run: | + sudo apt update + sudo apt-get install -y hub + hub pull-request -b Bandwidth:main -h Bandwidth:${{ steps.jira.outputs.jira-key }} -m '${{ steps.jira.outputs.jira-key }} Update SDK Based on Recent Spec Changes' -m 'Auto-generated by Update SDK Workflow' + env: + GITHUB_TOKEN: ${{ env.DX_GITHUB_TOKEN }} diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 77119879..9ba780b9 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -2,5 +2,7 @@ # Generated by openapi-generator https://github.com/openapitools/openapi-generator /spec/spec_helper.rb +/spec/configuration_spec.rb +/spec/api_client_spec.rb Rakefile .gitignore diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 10807bd7..42a68b5f 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -51,6 +51,7 @@ docs/MFAApi.md docs/MachineDetectionCompleteCallback.md docs/MachineDetectionConfiguration.md docs/MachineDetectionModeEnum.md +docs/MachineDetectionResult.md docs/Media.md docs/MediaApi.md docs/Message.md @@ -156,6 +157,7 @@ lib/bandwidth-sdk/models/lookup_status_enum.rb lib/bandwidth-sdk/models/machine_detection_complete_callback.rb lib/bandwidth-sdk/models/machine_detection_configuration.rb lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +lib/bandwidth-sdk/models/machine_detection_result.rb lib/bandwidth-sdk/models/media.rb lib/bandwidth-sdk/models/message.rb lib/bandwidth-sdk/models/message_delivered_callback.rb @@ -201,100 +203,3 @@ lib/bandwidth-sdk/models/verify_code_response.rb lib/bandwidth-sdk/models/voice_api_error.rb lib/bandwidth-sdk/models/voice_code_response.rb lib/bandwidth-sdk/version.rb -spec/api/calls_api_spec.rb -spec/api/conferences_api_spec.rb -spec/api/media_api_spec.rb -spec/api/messages_api_spec.rb -spec/api/mfa_api_spec.rb -spec/api/phone_number_lookup_api_spec.rb -spec/api/recordings_api_spec.rb -spec/api/statistics_api_spec.rb -spec/api_client_spec.rb -spec/configuration_spec.rb -spec/models/account_statistics_spec.rb -spec/models/answer_callback_spec.rb -spec/models/bridge_complete_callback_spec.rb -spec/models/bridge_target_complete_callback_spec.rb -spec/models/call_direction_enum_spec.rb -spec/models/call_recording_metadata_spec.rb -spec/models/call_state_enum_spec.rb -spec/models/call_state_spec.rb -spec/models/callback_method_enum_spec.rb -spec/models/code_request_spec.rb -spec/models/conference_completed_callback_spec.rb -spec/models/conference_created_callback_spec.rb -spec/models/conference_member_exit_callback_spec.rb -spec/models/conference_member_join_callback_spec.rb -spec/models/conference_member_spec.rb -spec/models/conference_recording_available_callback_spec.rb -spec/models/conference_recording_metadata_spec.rb -spec/models/conference_redirect_callback_spec.rb -spec/models/conference_spec.rb -spec/models/conference_state_enum_spec.rb -spec/models/create_call_response_spec.rb -spec/models/create_call_spec.rb -spec/models/create_lookup_response_spec.rb -spec/models/create_message_request_error_spec.rb -spec/models/deferred_result_spec.rb -spec/models/disconnect_callback_spec.rb -spec/models/diversion_spec.rb -spec/models/dtmf_callback_spec.rb -spec/models/field_error_spec.rb -spec/models/file_format_enum_spec.rb -spec/models/gather_callback_spec.rb -spec/models/inbound_message_callback_message_spec.rb -spec/models/inbound_message_callback_spec.rb -spec/models/initiate_callback_spec.rb -spec/models/list_message_direction_enum_spec.rb -spec/models/list_message_item_spec.rb -spec/models/lookup_request_spec.rb -spec/models/lookup_result_spec.rb -spec/models/lookup_status_enum_spec.rb -spec/models/lookup_status_spec.rb -spec/models/machine_detection_complete_callback_spec.rb -spec/models/machine_detection_configuration_spec.rb -spec/models/machine_detection_mode_enum_spec.rb -spec/models/media_spec.rb -spec/models/message_delivered_callback_message_spec.rb -spec/models/message_delivered_callback_spec.rb -spec/models/message_direction_enum_spec.rb -spec/models/message_failed_callback_message_spec.rb -spec/models/message_failed_callback_spec.rb -spec/models/message_request_spec.rb -spec/models/message_sending_callback_message_spec.rb -spec/models/message_sending_callback_spec.rb -spec/models/message_spec.rb -spec/models/message_status_enum_spec.rb -spec/models/message_type_enum_spec.rb -spec/models/messages_list_spec.rb -spec/models/messaging_code_response_spec.rb -spec/models/messaging_request_error_spec.rb -spec/models/mfa_forbidden_request_error_spec.rb -spec/models/mfa_request_error_spec.rb -spec/models/mfa_unauthorized_request_error_spec.rb -spec/models/page_info_spec.rb -spec/models/priority_enum_spec.rb -spec/models/recording_available_callback_spec.rb -spec/models/recording_complete_callback_spec.rb -spec/models/recording_state_enum_spec.rb -spec/models/redirect_callback_spec.rb -spec/models/redirect_method_enum_spec.rb -spec/models/stir_shaken_spec.rb -spec/models/tag_spec.rb -spec/models/tn_lookup_request_error_spec.rb -spec/models/transcribe_recording_spec.rb -spec/models/transcription_available_callback_spec.rb -spec/models/transcription_list_spec.rb -spec/models/transcription_metadata_spec.rb -spec/models/transcription_spec.rb -spec/models/transfer_answer_callback_spec.rb -spec/models/transfer_complete_callback_spec.rb -spec/models/transfer_disconnect_callback_spec.rb -spec/models/update_call_recording_spec.rb -spec/models/update_call_spec.rb -spec/models/update_conference_member_spec.rb -spec/models/update_conference_spec.rb -spec/models/verify_code_request_spec.rb -spec/models/verify_code_response_spec.rb -spec/models/voice_api_error_spec.rb -spec/models/voice_code_response_spec.rb diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index c0be8a79..4be2c727 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.4.0 \ No newline at end of file +6.5.0 \ No newline at end of file diff --git a/Gemfile b/Gemfile index c2e3127c..757cdcf7 100644 --- a/Gemfile +++ b/Gemfile @@ -5,5 +5,5 @@ gemspec group :development, :test do gem 'rake', '~> 13.0.1' gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' + gem 'rubocop', '~> 1.52.0' end diff --git a/README.md b/README.md index dfa39759..a0fa1b38 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # bandwidth-sdk -[![Test](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test.yml) +[![Gem Version](https://badge.fury.io/rb/bandwidth-sdk.svg)](https://badge.fury.io/rb/bandwidth-sdk) +[![Tests](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test-nightly.yml/badge.svg)](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test-nightly.yml) +[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop) | **OS** | **Ruby** | @@ -77,8 +79,8 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::CallsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+19195554321', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.com/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call +account_id = '9900000' # String | Your Bandwidth Account ID. +create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+19195554321', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.example/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call begin #Create Call @@ -178,6 +180,7 @@ Class | Method | HTTP request | Description - [Bandwidth::MachineDetectionCompleteCallback](docs/MachineDetectionCompleteCallback.md) - [Bandwidth::MachineDetectionConfiguration](docs/MachineDetectionConfiguration.md) - [Bandwidth::MachineDetectionModeEnum](docs/MachineDetectionModeEnum.md) + - [Bandwidth::MachineDetectionResult](docs/MachineDetectionResult.md) - [Bandwidth::Media](docs/Media.md) - [Bandwidth::Message](docs/Message.md) - [Bandwidth::MessageDeliveredCallback](docs/MessageDeliveredCallback.md) @@ -227,6 +230,7 @@ Class | Method | HTTP request | Description ## Documentation for Authorization +Authentication schemes defined for the API: ### Basic - **Type**: HTTP basic authentication diff --git a/Rakefile b/Rakefile index 37e0ead6..c0c3a363 100644 --- a/Rakefile +++ b/Rakefile @@ -8,7 +8,10 @@ begin desc 'Run Only Unit Tests' RSpec::Core::RakeTask.new(:unit) do |t| - t.pattern = './spec/unit/**/*_spec.rb' + t.pattern = './spec/api/**/*_spec.rb' + end + RSpec::Core::RakeTask.new(:unit) do |t| + t.pattern = './spec/models/**/*_spec.rb' end desc 'Run Only Integration Tests' @@ -16,6 +19,11 @@ begin t.pattern = './spec/integration/*_spec.rb' end + desc 'Run Only Client Unit Tests' + RSpec::Core::RakeTask.new(:client) do |t| + t.pattern = './spec/*_spec.rb' + end + task default: :spec rescue LoadError # no rspec available diff --git a/bandwidth-sdk.gemspec b/bandwidth-sdk.gemspec index 39c3de64..e0ab4ea7 100644 --- a/bandwidth-sdk.gemspec +++ b/bandwidth-sdk.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/bandwidth.yml b/bandwidth.yml index 5813c9ff..8eb60077 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -167,6 +167,7 @@ paths: - $ref: '#/components/parameters/errorCode' - $ref: '#/components/parameters/fromDateTime' - $ref: '#/components/parameters/toDateTime' + - $ref: '#/components/parameters/campaignId' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/pageToken' - $ref: '#/components/parameters/limit' @@ -241,7 +242,7 @@ paths: approximately in order, but exact ordering is not guaranteed. operationId: createCall parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' requestBody: $ref: '#/components/requestBodies/createCallRequest' responses: @@ -282,7 +283,7 @@ paths: 7 days, you will get an HTTP 404 response. operationId: getCallState parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' responses: '200': @@ -312,13 +313,13 @@ paths: BXML document. operationId: updateCall parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' requestBody: $ref: '#/components/requestBodies/updateCallRequest' responses: '200': - description: Call Successfully Modified + description: Call was successfully modified. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -346,13 +347,13 @@ paths: description: Interrupts and replaces an active call's BXML document. operationId: updateCallBxml parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' requestBody: $ref: '#/components/requestBodies/updateCallBxmlRequest' responses: '204': - description: Call BXML Successfully Replaced + description: Call BXML was successfully replaced. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -388,7 +389,7 @@ paths: of conference records. operationId: listConferences parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/name' - $ref: '#/components/parameters/minCreatedTime' - $ref: '#/components/parameters/maxCreatedTime' @@ -422,7 +423,7 @@ paths: description: Returns information about the specified conference. operationId: getConference parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' responses: '200': @@ -450,13 +451,13 @@ paths: description: Update the conference state. operationId: updateConference parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' requestBody: $ref: '#/components/requestBodies/updateConferenceRequest' responses: '204': - description: Conference successfully modified + description: Conference was successfully modified. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -482,13 +483,13 @@ paths: description: Update the conference BXML document. operationId: updateConferenceBxml parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' requestBody: $ref: '#/components/requestBodies/updateConferenceBxmlRequest' responses: '204': - description: Conference successfully modified + description: Conference successfully modified. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -514,7 +515,7 @@ paths: description: Returns information about the specified conference member. operationId: getConferenceMember parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' - $ref: '#/components/parameters/memberId' responses: @@ -543,14 +544,14 @@ paths: description: Updates settings for a particular conference member. operationId: updateConferenceMember parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' - $ref: '#/components/parameters/memberId' requestBody: $ref: '#/components/requestBodies/updateConferenceMemberRequest' responses: '204': - description: Conference member successfully modified + description: Conference member was successfully modified. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -578,7 +579,7 @@ paths: took place during the specified conference. operationId: listConferenceRecordings parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' responses: '200': @@ -608,7 +609,7 @@ paths: description: Returns metadata for the specified recording. operationId: getConferenceRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' - $ref: '#/components/parameters/recordingId' responses: @@ -639,7 +640,7 @@ paths: description: Downloads the specified recording file. operationId: downloadConferenceRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' - $ref: '#/components/parameters/recordingId' responses: @@ -679,7 +680,7 @@ paths: empty if no recordings match the specified criteria. operationId: listAccountCallRecordings parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/to' - $ref: '#/components/parameters/from' - $ref: '#/components/parameters/minStartTime' @@ -712,13 +713,13 @@ paths: description: Pause or resume a recording on an active phone call. operationId: updateCallRecordingState parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' requestBody: $ref: '#/components/requestBodies/updateCallRecordingRequest' responses: '200': - description: Recording state successfully modified + description: Recording state was successfully modified. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -746,7 +747,7 @@ paths: that took place during the specified call. operationId: listCallRecordings parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' responses: '200': @@ -776,7 +777,7 @@ paths: description: Returns metadata for the specified recording. operationId: getCallRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: @@ -813,12 +814,12 @@ paths: irreversible, can take an additional 24 to 48 hours. operationId: deleteRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: '204': - description: Recording Deleted + description: Recording was deleted. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -844,7 +845,7 @@ paths: description: Downloads the specified recording. operationId: downloadCallRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: @@ -873,12 +874,12 @@ paths: description: Deletes the specified recording's media. operationId: deleteRecordingMedia parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: '204': - description: The recording media was successfully deleted + description: The recording media was successfully deleted. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -918,7 +919,7 @@ paths: item. operationId: getCallTranscription parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: @@ -953,14 +954,14 @@ paths: less than 4 hours. operationId: transcribeCallRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' requestBody: $ref: '#/components/requestBodies/transcribeRecordingRequest' responses: '204': - description: Transcription successfully requested + description: Transcription was successfully requested. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -991,12 +992,12 @@ paths: can take an additional 24 to 48 hours. operationId: deleteCallTranscription parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: '204': - description: The transcription was successfully deleted + description: The transcription was successfully deleted. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -1022,7 +1023,7 @@ paths: description: Returns details about the current state of the account. operationId: getStatistics parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' responses: '200': $ref: '#/components/responses/getStatisticsResponse' @@ -1051,7 +1052,7 @@ paths: description: Send an MFA Code via a phone call. operationId: generateVoiceCode parameters: - - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/accountId' requestBody: $ref: '#/components/requestBodies/codeRequest' responses: @@ -1076,7 +1077,7 @@ paths: description: Send an MFA code via text message (SMS). operationId: generateMessagingCode parameters: - - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/accountId' requestBody: $ref: '#/components/requestBodies/codeRequest' responses: @@ -1099,7 +1100,7 @@ paths: description: Verify a previously sent MFA code. operationId: verifyCode parameters: - - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/accountId' requestBody: $ref: '#/components/requestBodies/codeVerify' responses: @@ -1124,7 +1125,7 @@ paths: tags: - Phone Number Lookup parameters: - - $ref: '#/components/parameters/accountId3' + - $ref: '#/components/parameters/accountId' requestBody: $ref: '#/components/requestBodies/createLookupRequest' responses: @@ -1153,7 +1154,7 @@ paths: tags: - Phone Number Lookup parameters: - - $ref: '#/components/parameters/accountId3' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/requestId' responses: '200': @@ -1175,7 +1176,10 @@ components: schemas: priorityEnum: type: string - description: The priority specified by the user. + description: |- + The priority specified by the user. + + Not supported on MMS. enum: - default - high @@ -1310,6 +1314,11 @@ components: description: The campaign class of the message if it has one. nullable: true example: T + campaignId: + type: string + description: The campaign ID of the message if it has one. + nullable: true + example: CJEUMDK pageInfo: title: PageInfo type: object @@ -1515,6 +1524,8 @@ components: automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. + + Not supported on MMS. example: '2021-02-01T11:29:18-05:00' inboundMessageCallback: description: Inbound Message Callback @@ -1534,68 +1545,71 @@ components: type: string example: Incoming message received message: - type: object - properties: - id: - type: string - example: 1661365814859loidf7mcwd4qacn7 - owner: - type: string - example: '+15553332222' - applicationId: - type: string - example: 93de2206-9669-4e07-948d-329f4b722ee2 - time: - type: string - format: date-time - example: 2016-09-14T18:20:16.000Z - segmentCount: - type: integer - example: 1 - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - uniqueItems: true - type: array - items: - type: string - example: - - '+15552223333' - from: - type: string - example: '+15553332222' - text: - type: string - example: Hello world - tag: - type: string - example: custom string - media: - type: array - items: - type: string - format: uri - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png - priority: - $ref: '#/components/schemas/priorityEnum' - required: - - id - - owner - - applicationId - - time - - segmentCount - - direction - - to - - from - - text + $ref: '#/components/schemas/inboundMessageCallbackMessage' required: - time - type - to - description - message + inboundMessageCallbackMessage: + description: Inbound Message Callback Message Schema + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string + example: Hello world + tag: + type: string + example: custom string + media: + type: array + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text messageSendingCallback: type: object description: Message Sending Callback @@ -1614,70 +1628,73 @@ components: type: string example: Message is sending to carrier message: - type: object - properties: - id: - type: string - example: 1661365814859loidf7mcwd4qacn7 - owner: - type: string - example: '+15553332222' - applicationId: - type: string - example: 93de2206-9669-4e07-948d-329f4b722ee2 - time: - type: string - format: date-time - example: 2016-09-14T18:20:16.000Z - segmentCount: - type: integer - example: 1 - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - uniqueItems: true - type: array - items: - type: string - example: - - '+15552223333' - from: - type: string - example: '+15553332222' - text: - type: string - example: '' - tag: - type: string - example: custom string - media: - type: array - items: - type: string - format: uri - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png - priority: - $ref: '#/components/schemas/priorityEnum' - required: - - id - - owner - - applicationId - - time - - segmentCount - - direction - - to - - from - - text - - media - - priority + $ref: '#/components/schemas/messageSendingCallbackMessage' required: - time - type - to - description - message + messageSendingCallbackMessage: + description: Message Sending Callback Message Schema + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string + example: Hello world + tag: + type: string + example: custom string + media: + type: array + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text + - media + - priority messageDeliveredCallback: description: Message Delivered Callback type: object @@ -1696,69 +1713,72 @@ components: type: string example: Message delivered to carrier. message: - type: object - properties: - id: - type: string - example: 1661365814859loidf7mcwd4qacn7 - owner: - type: string - example: '+15553332222' - applicationId: - type: string - example: 93de2206-9669-4e07-948d-329f4b722ee2 - time: - type: string - format: date-time - example: 2016-09-14T18:20:16.000Z - segmentCount: - type: integer - example: 1 - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - uniqueItems: true - type: array - items: - type: string - example: - - '+15552223333' - from: - type: string - example: '+15553332222' - text: - type: string - example: '' - tag: - type: string - example: custom string - media: - type: array - items: - type: string - format: uri - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png - priority: - $ref: '#/components/schemas/priorityEnum' - required: - - id - - owner - - applicationId - - time - - segmentCount - - direction - - to - - from - - text - - tag + $ref: '#/components/schemas/messageDeliveredCallbackMessage' required: - time - type - to - description - message + messageDeliveredCallbackMessage: + description: Message Delivered Callback Message Schema + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string + example: Hello world + tag: + type: string + example: custom string + media: + type: array + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text + - tag messageFailedCallback: description: Message Failed Callback type: object @@ -1777,64 +1797,7 @@ components: type: string example: rejected-unallocated-from-number message: - type: object - properties: - id: - type: string - example: 1661365814859loidf7mcwd4qacn7 - owner: - type: string - example: '+15553332222' - applicationId: - type: string - example: 93de2206-9669-4e07-948d-329f4b722ee2 - time: - type: string - format: date-time - example: 2016-09-14T18:20:16.000Z - segmentCount: - type: integer - example: 1 - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - uniqueItems: true - type: array - items: - type: string - example: - - '+15552223333' - from: - type: string - example: '+15553332222' - text: - type: string - example: '' - tag: - type: string - example: custom string - media: - type: array - items: - type: string - format: uri - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png - priority: - $ref: '#/components/schemas/priorityEnum' - required: - - id - - owner - - applicationId - - time - - segmentCount - - direction - - to - - from - - text - - tag - - priority + $ref: '#/components/schemas/messageFailedCallbackMessage' errorCode: type: integer example: 9902 @@ -1845,6 +1808,66 @@ components: - description - message - errorCode + messageFailedCallbackMessage: + description: Message Failed Callback Message Schema + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string + example: Hello world + tag: + type: string + example: custom string + media: + type: array + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text + - tag + - priority callbackMethodEnum: type: string nullable: true @@ -1867,7 +1890,7 @@ components: The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.

Not allowed if `state` is - `completed` + `completed`. example: POST recordingStateEnum: type: string @@ -1880,18 +1903,21 @@ components: `paused` to pause an active recording `recording` to resume a paused recording + example: paused callDirectionEnum: type: string enum: - inbound - outbound description: The direction of the call. + example: inbound fileFormatEnum: type: string enum: - mp3 - wav - description: The format that the recording is stored in + description: The format that the recording is stored in. + example: wav callStateEnum: nullable: true type: string @@ -1909,6 +1935,7 @@ components: unanswered inbound call + example: completed conferenceStateEnum: nullable: true type: string @@ -1918,7 +1945,8 @@ components: - completed description: >- Setting the conference state to `completed` ends the conference and - ejects all members + ejects all members. + example: completed machineDetectionModeEnum: type: string default: async @@ -1934,6 +1962,7 @@ components: complete and will include its result. + example: async createCall: type: object required: @@ -1944,9 +1973,11 @@ components: properties: to: type: string - description: |- + description: >- The destination to call (must be an E.164 formatted number - (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.com`)). + + (e.g. `+15555551212`) or a SIP URI (e.g. + `sip:user@server.example`)). example: '+19195551234' from: type: string @@ -1962,7 +1993,7 @@ components: nullable: true type: string example: >- - eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ=;encoding=base64 + eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64 description: >- A comma-separated list of 'User-To-User' headers to be sent @@ -1996,9 +2027,9 @@ components: call. - Must use `https` if specifying `username` and `password` + Must use `https` if specifying `username` and `password`. maxLength: 2048 - example: https://www.myCallbackServer.com/webhooks/answer + example: https://www.myCallbackServer.example/webhooks/answer answerMethod: $ref: '#/components/schemas/callbackMethodEnum' username: @@ -2024,9 +2055,9 @@ components: Must use `https` if specifying `fallbackUsername` and - `fallbackPassword` + `fallbackPassword`. maxLength: 2048 - example: https://www.myFallbackServer.com/webhooks/answer + example: https://www.myFallbackServer.example/webhooks/answer answerFallbackMethod: $ref: '#/components/schemas/callbackMethodEnum' fallbackUsername: @@ -2050,6 +2081,7 @@ components: href='/docs/voice/webhooks/disconnect'>Disconnect event to when the call ends. This event does not expect a BXML response. maxLength: 2048 + example: https://www.myCallbackServer.example/webhooks/disconnect disconnectMethod: $ref: '#/components/schemas/callbackMethodEnum' callTimeout: @@ -2069,6 +2101,7 @@ components: minimum: 1 maximum: 300 default: 30 + example: 30 callbackTimeout: nullable: true type: number @@ -2083,6 +2116,7 @@ components: minimum: 1 maximum: 25 default: 15 + example: 15 machineDetection: $ref: '#/components/schemas/machineDetectionConfiguration' priority: @@ -2108,6 +2142,7 @@ components: takes precedence over a priority 2 call. + example: 5 tag: nullable: true type: string @@ -2124,7 +2159,8 @@ components: Max length 256 characters. - maximum: 256 + maxLength: 256 + example: arbitrary text here createCallResponse: type: object required: @@ -2145,31 +2181,31 @@ components: accountId: type: string example: '9900000' - description: The bandwidth account ID associated with the call + description: The bandwidth account ID associated with the call. callId: type: string example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - description: Programmable Voice API Call ID + description: Programmable Voice API Call ID. to: type: string example: '+19195551234' - description: Recipient of the outgoing call + description: Recipient of the outgoing call. from: type: string example: '+19195554321' - description: Phone number that created the outbound call + description: Phone number that created the outbound call. enqueuedTime: nullable: true type: string format: date-time - description: Time the call was accepted into the queue + description: The time at which the call was accepted into the queue. example: '2022-06-16T13:15:07.160Z' callUrl: type: string format: uri example: >- https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - description: The URL to update call state + description: The URL to update this call's state. callTimeout: type: number format: double @@ -2188,13 +2224,13 @@ components: nullable: true type: string example: My custom tag value - description: Custom tag value + description: Custom tag value. answerMethod: $ref: '#/components/schemas/callbackMethodEnum' answerUrl: type: string format: uri - example: https://myServer.com/bandwidth/webhooks/answer + example: https://myServer.example/bandwidth/webhooks/answer description: URL to deliver the `answer` event webhook. answerFallbackMethod: $ref: '#/components/schemas/callbackMethodEnum' @@ -2202,7 +2238,7 @@ components: nullable: true type: string format: uri - example: https://myFallbackServer.com/bandwidth/webhooks/answer + example: https://myFallbackServer.example/bandwidth/webhooks/answer description: Fallback URL to deliver the `answer` event webhook. disconnectMethod: $ref: '#/components/schemas/callbackMethodEnum' @@ -2210,7 +2246,7 @@ components: nullable: true type: string format: uri - example: https://myServer.com/bandwidth/webhooks/disconnect + example: https://myServer.example/bandwidth/webhooks/disconnect description: URL to deliver the `disconnect` event webhook. username: type: string @@ -2238,8 +2274,7 @@ components: example: mySecretPassword1! priority: nullable: true - type: number - format: integer + type: integer example: 5 description: The priority of this call over other calls from your account. callState: @@ -2268,7 +2303,7 @@ components: type: string description: >- The phone number that received the call, in E.164 format (e.g. - +15555555555), or if the call was to a SIP URI, the SIP URI + +15555555555), or if the call was to a SIP URI, the SIP URI. example: '+19195551234' from: type: string @@ -2323,7 +2358,7 @@ components: More information: [Understanding - STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken) + STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). additionalProperties: type: string example: @@ -2449,7 +2484,7 @@ components: nullable: true type: string format: uri - example: https://myServer.com/bandwidth/webhooks/redirect + example: https://myServer.example/bandwidth/webhooks/redirect redirectMethod: $ref: '#/components/schemas/redirectMethodEnum' username: @@ -2470,8 +2505,8 @@ components: format: uri description: |- A fallback url which, if provided, will be used to retry the - redirect callback delivery in case `redirectUrl` fails to respond - example: https://myFallbackServer.com/bandwidth/webhooks/redirect + redirect callback delivery in case `redirectUrl` fails to respond. + example: https://myFallbackServer.example/bandwidth/webhooks/redirect redirectFallbackMethod: $ref: '#/components/schemas/redirectMethodEnum' fallbackUsername: @@ -2505,7 +2540,7 @@ components: Not allowed if `state` is `completed`. - maximum: 256 + maxLength: 256 example: My Custom Tag updateCallRecording: type: object @@ -2571,11 +2606,11 @@ components: properties: id: type: string - description: The Bandwidth-generated conference ID + description: The Bandwidth-generated conference ID. example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 name: type: string - description: The name of the conference, as specified by your application + description: The name of the conference, as specified by your application. example: my-conference-name createdTime: type: string @@ -2593,7 +2628,7 @@ components: type: string format: uri description: The URL to send the conference-related events. - example: https://myServer.com/bandwidth/webhooks/conferenceEvent + example: https://myServer.example/bandwidth/webhooks/conferenceEvent conferenceEventMethod: $ref: '#/components/schemas/callbackMethodEnum' tag: @@ -2612,7 +2647,7 @@ components: 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) + endpoint](/apis/voice#tag/Conferences/operation/listConferences). updateConference: type: object properties: @@ -2629,8 +2664,8 @@ components: event which will provide new BXML. Not allowed if `state` is `completed`, - but required if `state` is `active` - example: https://myServer.com/bandwidth/webhooks/conferenceRedirect + but required if `state` is `active`. + example: https://myServer.example/bandwidth/webhooks/conferenceRedirect redirectMethod: $ref: '#/components/schemas/redirectMethodEnum' username: @@ -2656,7 +2691,8 @@ components: respond. Not allowed if `state` is `completed`. - example: https://myFallbackServer.com/bandwidth/webhooks/conferenceRedirect + example: >- + https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect redirectFallbackMethod: $ref: '#/components/schemas/redirectMethodEnum' fallbackUsername: @@ -2899,7 +2935,7 @@ components: type: string format: uri maxLength: 2048 - example: https://myServer.com/bandwidth/webhooks/machineDetectionComplete + example: https://myServer.example/bandwidth/webhooks/machineDetectionComplete callbackMethod: $ref: '#/components/schemas/callbackMethodEnum' username: @@ -2927,7 +2963,7 @@ components: to respond maxLength: 2048 example: >- - https://myFallbackServer.com/bandwidth/webhooks/machineDetectionComplete + https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete fallbackMethod: $ref: '#/components/schemas/callbackMethodEnum' fallbackUsername: @@ -2959,7 +2995,7 @@ components: and password fields for authorization. - example: https://myServer.com/bandwidth/webhooks/transcriptionAvailable + example: https://myServer.example/bandwidth/webhooks/transcriptionAvailable callbackMethod: $ref: '#/components/schemas/callbackMethodEnum' username: @@ -2991,6 +3027,16 @@ components: between 1 and 25. example: 5.5 + detectLanguage: + type: boolean + nullable: true + description: >- + A boolean value to indicate that the recording may not be in + English, and the transcription service will need to detect the + dominant language the recording is in and transcribe accordingly. + Current supported languages are English, French, and Spanish. + default: false + example: true transcriptionList: type: object properties: @@ -3979,7 +4025,7 @@ components: example: 4642074b-7b58-478b-96e4-3a60955c6765 nullable: true machineDetectionResult: - type: string + type: object description: >- (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async @@ -4553,7 +4599,7 @@ components: description: Too Many Requests headers: Retry-After: - description: When you should try your request again + description: When you should try your request again. schema: type: string content: @@ -4870,6 +4916,14 @@ components: example: 2022-09-14T18:20:16.000Z schema: type: string + campaignId: + in: query + name: campaignId + required: false + description: The campaign ID of the message. + example: CJEUMDK + schema: + type: string sort: in: query name: sort @@ -4898,21 +4952,13 @@ components: schema: type: integer example: 50 - accountId1: - name: accountId - in: path - required: true - schema: - type: string - description: Your Bandwidth Account ID - example: '9900000' callId: name: callId in: path required: true schema: type: string - description: Programmable Voice API Call ID + description: Programmable Voice API Call ID. example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 recordingId: name: recordingId @@ -4920,7 +4966,7 @@ components: required: true schema: type: string - description: Programmable Voice API Recording ID + description: Programmable Voice API Recording ID. example: r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 conferenceId: name: conferenceId @@ -4928,7 +4974,7 @@ components: required: true schema: type: string - description: Programmable Voice API Conference ID + description: Programmable Voice API Conference ID. example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 memberId: name: memberId @@ -4936,7 +4982,7 @@ components: required: true schema: type: string - description: Programmable Voice API Conference Member ID + description: Programmable Voice API Conference Member ID. example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 to: name: to @@ -5024,23 +5070,6 @@ 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. - accountId2: - name: accountId - description: Bandwidth Account ID with Voice service enabled. - in: path - required: true - style: simple - explode: false - schema: - type: string - accountId3: - name: accountId - in: path - required: true - schema: - type: string - description: The ID of the Bandwidth account that the user belongs to. - example: '9900000' requestId: name: requestId in: path @@ -5271,7 +5300,7 @@ components: value: |- - + updateCallRecordingRequest: required: true @@ -5395,10 +5424,10 @@ components: callbackTimeout: 15 tag: My custom tag value answerMethod: POST - answerUrl: https://myServer.com/bandwidth/webhooks/answer + answerUrl: https://myServer.example/bandwidth/webhooks/answer answerFallbackMethod: POST disconnectMethod: POST - disconnectUrl: https://myServer.com/bandwidth/webhooks/disconnect + disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect username: mySecretUsername password: '*****' fallbackUsername: mySecretUsername @@ -5411,54 +5440,54 @@ components: name: my-conference-name createdTime: '2022-06-17T22:19:40.375Z' completedTime: '2022-06-17T22:20:00.000Z' - conferenceEventUrl: https://myServer.com/bandwidth/webhooks/conferenceEvent + conferenceEventUrl: https://myServer.example/bandwidth/webhooks/conferenceEvent conferenceEventMethod: POST tag: my custom tag voiceBadRequestErrorExample: summary: Example of a Bad Request (400) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceUnauthorizedErrorExample: summary: Example of an Unauthorized (401) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceForbiddenErrorExample: summary: Example of a Forbidden (403) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceNotFoundErrorExample: summary: Example of a Not Found (404) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceNotAllowedErrorExample: summary: Example of a Not Allowed (405) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceConflictErrorExample: summary: Example of a Conflict (409) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceUnsupportedMediaTypeErrorExample: summary: Example of an Unsupported Media Type (415) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceTooManyRequestsErrorExample: summary: Example of a Too Many Requests (429) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceInternalServerErrorExample: summary: Example of an Internal Server (500) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' singleNumberRequestExample: summary: Example Number Lookup Request for One Number value: diff --git a/custom_templates/Gemfile.mustache b/custom_templates/Gemfile.mustache new file mode 100644 index 00000000..757cdcf7 --- /dev/null +++ b/custom_templates/Gemfile.mustache @@ -0,0 +1,9 @@ +source 'https://rubygems.org' + +gemspec + +group :development, :test do + gem 'rake', '~> 13.0.1' + gem 'pry-byebug' + gem 'rubocop', '~> 1.52.0' +end diff --git a/custom_templates/README.mustache b/custom_templates/README.mustache new file mode 100644 index 00000000..85e5b50b --- /dev/null +++ b/custom_templates/README.mustache @@ -0,0 +1,170 @@ +# {{gemName}} + +[![Gem Version](https://badge.fury.io/rb/bandwidth-sdk.svg)](https://badge.fury.io/rb/bandwidth-sdk) +[![Tests](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test-nightly.yml/badge.svg)](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test-nightly.yml) +[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop) + + +| **OS** | **Ruby** | +|:---:|:---:| +| Windows 2019 | 2.7, 3.0, 3.1, 3.2 | +| Windows 2022 | 2.7, 3.0, 3.1, 3.2 | +| Ubuntu 20.04 | 2.7, 3.0, 3.1, 3.2 | +| Ubuntu 22.04 | 2.7, 3.0, 3.1, 3.2 | + +{{moduleName}} - the Ruby gem for the {{appName}} + +{{#appDescriptionWithNewLines}} +{{{.}}} +{{/appDescriptionWithNewLines}} + +This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- Package version: {{gemVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Installation + +### Build a gem + +To build the Ruby code into a gem: + +```shell +gem build {{{gemName}}}.gemspec +``` + +Then either install the gem locally: + +```shell +gem install ./{{{gemName}}}-{{{gemVersion}}}.gem +``` + +(for development, run `gem install --dev ./{{{gemName}}}-{{{gemVersion}}}.gem` to install the development dependencies) + +or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). + +Finally add this to the Gemfile: + + gem '{{{gemName}}}', '~> {{{gemVersion}}}' + +### Install from Git + +If the Ruby gem is hosted at a git repository: https://{{gitHost}}/{{gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}, then add the following in the Gemfile: + + gem '{{{gemName}}}', :git => 'https://{{gitHost}}/{{gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}.git' + +### Include the Ruby code directly + +Include the Ruby code directly using `-I` as follows: + +```shell +ruby -Ilib script.rb +``` + +## Getting Started + +Please follow the [installation](#installation) procedure and then run the following code: + +```ruby +# Load the gem +require '{{{gemName}}}' +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}} +# Setup authorization +{{{moduleName}}}.configure do |config|{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + # Configure HTTP basic authorization: {{{name}}} + config.username = 'YOUR_USERNAME' + config.password = 'YOUR_PASSWORD'{{/isBasicBasic}}{{#isBasicBearer}} + # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} + config.access_token = 'YOUR_BEARER_TOKEN' + # Configure a proc to get access tokens in lieu of the static access_token configuration + config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } {{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + # Configure API key authorization: {{{name}}} + config.api_key['{{{name}}}'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['{{{name}}}'] = 'Bearer'{{/isApiKey}}{{#isOAuth}} + # Configure OAuth2 access token for authorization: {{{name}}} + config.access_token = 'YOUR ACCESS TOKEN' + # Configure a proc to get access tokens in lieu of the static access_token configuration + config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } {{/isOAuth}} + {{#isFaraday}} + # Configure faraday connection + config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' } + {{/isFaraday}} +{{/authMethods}}end +{{/hasAuthMethods}} + +api_instance = {{{moduleName}}}::{{{classname}}}.new +{{#requiredParams}} +{{{paramName}}} = {{{vendorExtensions.x-ruby-example}}} # {{{dataType}}} | {{{description}}} +{{/requiredParams}} +{{#optionalParams}} +{{#-first}} +opts = { +{{/-first}} + {{{paramName}}}: {{{vendorExtensions.x-ruby-example}}}{{^-last}},{{/-last}} # {{{dataType}}} | {{{description}}} +{{#-last}} +} +{{/-last}} +{{/optionalParams}} + +begin +{{#summary}} #{{{.}}} +{{/summary}} {{#returnType}}result = {{/returnType}}api_instance.{{{operationId}}}{{#hasParams}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}){{/hasParams}}{{#returnType}} + p result{{/returnType}} +rescue {{{moduleName}}}::ApiError => e + puts "Exception when calling {{classname}}->{{{operationId}}}: #{e}" +end +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}::{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{{summary}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation for Models + +{{#models}}{{#model}} - [{{moduleName}}::{{classname}}]({{modelDocPath}}{{classname}}.md) +{{/model}}{{/models}} + +## Documentation for Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} +### {{name}} + +{{#isApiKey}} + +- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}}{{#isBasicBearer}}- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}}{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{/isBasic}} +{{#isOAuth}} + +- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} diff --git a/custom_templates/gem.mustache b/custom_templates/gem.mustache new file mode 100644 index 00000000..ed66ea55 --- /dev/null +++ b/custom_templates/gem.mustache @@ -0,0 +1,99 @@ +=begin +{{> api_info}} +=end + +# Common files +require '{{gemName}}/api_client' +require '{{gemName}}/api_error' +require '{{gemName}}/version' +require '{{gemName}}/configuration' + +# Models +{{^useAutoload}} +{{#models}} +{{#model}} +{{^parent}} +require '{{gemName}}/{{modelPackage}}/{{classFilename}}' +{{/parent}} +{{/model}} +{{/models}} +{{#models}} +{{#model}} +{{#parent}} +require '{{gemName}}/{{modelPackage}}/{{classFilename}}' +{{/parent}} +{{/model}} +{{/models}} +{{/useAutoload}} +{{#useAutoload}} +{{#models}} +{{#model}} +{{moduleName}}.autoload :{{classname}}, '{{gemName}}/{{modelPackage}}/{{classFilename}}' +{{/model}} +{{/models}} +{{/useAutoload}} + +# BXML +require 'bandwidth-sdk/models/bxml/root' +require 'bandwidth-sdk/models/bxml/bxml' +require 'bandwidth-sdk/models/bxml/response' +require 'bandwidth-sdk/models/bxml/verb' +require 'bandwidth-sdk/models/bxml/nestable_verb' +require 'bandwidth-sdk/models/bxml/verbs/bridge' +require 'bandwidth-sdk/models/bxml/verbs/conference' +require 'bandwidth-sdk/models/bxml/verbs/custom_param' +require 'bandwidth-sdk/models/bxml/verbs/forward' +require 'bandwidth-sdk/models/bxml/verbs/gather' +require 'bandwidth-sdk/models/bxml/verbs/hangup' +require 'bandwidth-sdk/models/bxml/verbs/pause_recording' +require 'bandwidth-sdk/models/bxml/verbs/pause' +require 'bandwidth-sdk/models/bxml/verbs/phone_number' +require 'bandwidth-sdk/models/bxml/verbs/play_audio' +require 'bandwidth-sdk/models/bxml/verbs/record' +require 'bandwidth-sdk/models/bxml/verbs/redirect' +require 'bandwidth-sdk/models/bxml/verbs/resume_recording' +require 'bandwidth-sdk/models/bxml/verbs/ring' +require 'bandwidth-sdk/models/bxml/verbs/send_dtmf' +require 'bandwidth-sdk/models/bxml/verbs/sip_uri' +require 'bandwidth-sdk/models/bxml/verbs/speak_sentence' +require 'bandwidth-sdk/models/bxml/verbs/start_gather' +require 'bandwidth-sdk/models/bxml/verbs/start_recording' +require 'bandwidth-sdk/models/bxml/verbs/start_stream' +require 'bandwidth-sdk/models/bxml/verbs/start_transcription' +require 'bandwidth-sdk/models/bxml/verbs/stop_gather' +require 'bandwidth-sdk/models/bxml/verbs/stop_recording' +require 'bandwidth-sdk/models/bxml/verbs/stop_stream' +require 'bandwidth-sdk/models/bxml/verbs/stop_transcription' +require 'bandwidth-sdk/models/bxml/verbs/stream_param' +require 'bandwidth-sdk/models/bxml/verbs/tag' +require 'bandwidth-sdk/models/bxml/verbs/transfer' + +# APIs +{{#apiInfo}} +{{#apis}} +{{^useAutoload}} +require '{{importPath}}' +{{/useAutoload}} +{{#useAutoload}} +{{moduleName}}.autoload :{{classname}}, '{{importPath}}' +{{/useAutoload}} +{{/apis}} +{{/apiInfo}} + +module {{moduleName}} + class << self + # Customize default settings for the SDK using block. + # {{moduleName}}.configure do |config| + # config.username = "xxx" + # config.password = "xxx" + # end + # If no block given, return the default Configuration object. + def configure + if block_given? + yield(Configuration.default) + else + Configuration.default + end + end + end +end diff --git a/custom_templates/gemspec.mustache b/custom_templates/gemspec.mustache new file mode 100644 index 00000000..5442f71b --- /dev/null +++ b/custom_templates/gemspec.mustache @@ -0,0 +1,37 @@ +# -*- encoding: utf-8 -*- + +=begin +{{> api_info}} +=end + +$:.push File.expand_path("../lib", __FILE__) +require "{{gemName}}/version" + +Gem::Specification.new do |s| + s.name = "{{gemName}}{{^gemName}}{{{appName}}}{{/gemName}}" + s.version = {{moduleName}}::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["{{gemAuthor}}{{^gemAuthor}}OpenAPI-Generator{{/gemAuthor}}"] + s.email = ["{{gemAuthorEmail}}{{^gemAuthorEmail}}{{infoEmail}}{{/gemAuthorEmail}}"] + s.homepage = "{{gemHomepage}}{{^gemHomepage}}https://openapi-generator.tech{{/gemHomepage}}" + s.summary = "{{gemSummary}}{{^gemSummary}}{{{appName}}} Ruby Gem{{/gemSummary}}" + s.description = "{{gemDescription}}{{^gemDescription}}{{{appDescription}}}{{^appDescription}}{{{appName}}} Ruby Gem{{/appDescription}}{{/gemDescription}}" + s.license = "{{{gemLicense}}}{{^gemLicense}}Unlicense{{/gemLicense}}" + s.required_ruby_version = "{{{gemRequiredRubyVersion}}}{{^gemRequiredRubyVersion}}>= 2.7{{/gemRequiredRubyVersion}}" + + {{#isFaraday}} + s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0' + s.add_runtime_dependency 'faraday-multipart' + {{/isFaraday}} + {{^isFaraday}} + s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' + {{/isFaraday}} + s.add_runtime_dependency 'ox', '~> 2.4' + + s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' + + s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } + s.test_files = `find spec/*`.split("\n") + s.executables = [] + s.require_paths = ["lib"] +end diff --git a/custom_templates/version.mustache b/custom_templates/version.mustache new file mode 100644 index 00000000..ae35b81c --- /dev/null +++ b/custom_templates/version.mustache @@ -0,0 +1,7 @@ +=begin +{{> api_info}} +=end + +module {{moduleName}} + VERSION = ENV.fetch("GEM_VERSION") +end diff --git a/docs/AnswerCallback.md b/docs/AnswerCallback.md index 81d8d416..26ba9d9c 100644 --- a/docs/AnswerCallback.md +++ b/docs/AnswerCallback.md @@ -17,7 +17,7 @@ | **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | | **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | | **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | -| **machine_detection_result** | **String** | (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete | [optional] | +| **machine_detection_result** | [**MachineDetectionResult**](MachineDetectionResult.md) | | [optional] | ## Example diff --git a/docs/CallState.md b/docs/CallState.md index 536c71d9..4c4240e3 100644 --- a/docs/CallState.md +++ b/docs/CallState.md @@ -8,11 +8,11 @@ | **account_id** | **String** | The account id associated with the call. | [optional] | | **call_id** | **String** | The programmable voice API call ID. | [optional] | | **parent_call_id** | **String** | The A-leg call id, set only if this call is the B-leg of a [`<Transfer>`](/docs/voice/bxml/transfer). | [optional] | -| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI | [optional] | +| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI. | [optional] | | **from** | **String** | The phone number that made the call, in E.164 format (e.g. +15555555555). | [optional] | | **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] | | **state** | **String** | The current state of the call. Current possible values are `queued`, `initiated`, `answered` and `disconnected`. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] | -| **stir_shaken** | **Hash<String, String>** | For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken) | [optional] | +| **stir_shaken** | **Hash<String, String>** | For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). | [optional] | | **identity** | **String** | The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header. | [optional] | | **enqueued_time** | **Time** | The time this call was placed in queue. | [optional] | | **start_time** | **Time** | The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue. | [optional] | diff --git a/docs/CallsApi.md b/docs/CallsApi.md index 48a9cbb3..36c7f190 100644 --- a/docs/CallsApi.md +++ b/docs/CallsApi.md @@ -31,8 +31,8 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::CallsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+19195554321', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.com/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call +account_id = '9900000' # String | Your Bandwidth Account ID. +create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+19195554321', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.example/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call begin # Create Call @@ -65,7 +65,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | | **create_call** | [**CreateCall**](CreateCall.md) | JSON object containing information to create an outbound call | | ### Return type @@ -103,8 +103,8 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::CallsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. begin # Get Call State Information @@ -137,8 +137,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | ### Return type @@ -175,8 +175,8 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::CallsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. update_call = Bandwidth::UpdateCall.new # UpdateCall | JSON object containing information to redirect an existing call to a new BXML document begin @@ -209,8 +209,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | | **update_call** | [**UpdateCall**](UpdateCall.md) | JSON object containing information to redirect an existing call to a new BXML document | | ### Return type @@ -248,8 +248,8 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::CallsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. body = ' This is a test sentence. @@ -285,8 +285,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | | **body** | **String** | | | ### Return type diff --git a/docs/Conference.md b/docs/Conference.md index bbc8cc09..5ca36db6 100644 --- a/docs/Conference.md +++ b/docs/Conference.md @@ -4,14 +4,14 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | The Bandwidth-generated conference ID | [optional] | -| **name** | **String** | The name of the conference, as specified by your application | [optional] | +| **id** | **String** | The Bandwidth-generated conference ID. | [optional] | +| **name** | **String** | The name of the conference, as specified by your application. | [optional] | | **created_time** | **Time** | The time the conference was initiated, in ISO 8601 format. | [optional] | | **completed_time** | **Time** | The time the conference was terminated, in ISO 8601 format. | [optional] | | **conference_event_url** | **String** | The URL to send the conference-related events. | [optional] | | **conference_event_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] | | **tag** | **String** | The custom string attached to the conference that will be sent with callbacks. | [optional] | -| **active_members** | [**Array<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] | +| **active_members** | [**Array<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] | ## Example @@ -23,7 +23,7 @@ instance = Bandwidth::Conference.new( name: my-conference-name, created_time: 2022-06-17T22:19:40.375Z, completed_time: 2022-06-17T22:20Z, - conference_event_url: https://myServer.com/bandwidth/webhooks/conferenceEvent, + conference_event_url: https://myServer.example/bandwidth/webhooks/conferenceEvent, conference_event_method: null, tag: my custom tag, active_members: null diff --git a/docs/ConferencesApi.md b/docs/ConferencesApi.md index af0c8c84..e8b0945b 100644 --- a/docs/ConferencesApi.md +++ b/docs/ConferencesApi.md @@ -36,9 +36,9 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::ConferencesApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID -recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID +account_id = '9900000' # String | Your Bandwidth Account ID. +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID. +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID. begin # Download Conference Recording @@ -71,9 +71,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **conference_id** | **String** | Programmable Voice API Conference ID | | -| **recording_id** | **String** | Programmable Voice API Recording ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **conference_id** | **String** | Programmable Voice API Conference ID. | | +| **recording_id** | **String** | Programmable Voice API Recording ID. | | ### Return type @@ -110,8 +110,8 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::ConferencesApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID +account_id = '9900000' # String | Your Bandwidth Account ID. +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID. begin # Get Conference Information @@ -144,8 +144,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **conference_id** | **String** | Programmable Voice API Conference ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **conference_id** | **String** | Programmable Voice API Conference ID. | | ### Return type @@ -182,9 +182,9 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::ConferencesApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID -member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Conference Member ID +account_id = '9900000' # String | Your Bandwidth Account ID. +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID. +member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Conference Member ID. begin # Get Conference Member @@ -217,9 +217,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **conference_id** | **String** | Programmable Voice API Conference ID | | -| **member_id** | **String** | Programmable Voice API Conference Member ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **conference_id** | **String** | Programmable Voice API Conference ID. | | +| **member_id** | **String** | Programmable Voice API Conference Member ID. | | ### Return type @@ -256,9 +256,9 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::ConferencesApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID -recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID +account_id = '9900000' # String | Your Bandwidth Account ID. +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID. +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID. begin # Get Conference Recording Information @@ -291,9 +291,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **conference_id** | **String** | Programmable Voice API Conference ID | | -| **recording_id** | **String** | Programmable Voice API Recording ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **conference_id** | **String** | Programmable Voice API Conference ID. | | +| **recording_id** | **String** | Programmable Voice API Recording ID. | | ### Return type @@ -330,8 +330,8 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::ConferencesApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID +account_id = '9900000' # String | Your Bandwidth Account ID. +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID. begin # Get Conference Recordings @@ -364,8 +364,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **conference_id** | **String** | Programmable Voice API Conference ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **conference_id** | **String** | Programmable Voice API Conference ID. | | ### Return type @@ -402,7 +402,7 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::ConferencesApi.new -account_id = '9900000' # String | Your Bandwidth Account ID +account_id = '9900000' # String | Your Bandwidth Account ID. opts = { name: 'my-custom-name', # String | Filter results by the `name` field. min_created_time: '2022-06-21T19:13:21Z', # String | Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). @@ -442,7 +442,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | | **name** | **String** | Filter results by the `name` field. | [optional] | | **min_created_time** | **String** | Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). | [optional] | | **max_created_time** | **String** | Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). | [optional] | @@ -484,8 +484,8 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::ConferencesApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID +account_id = '9900000' # String | Your Bandwidth Account ID. +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID. update_conference = Bandwidth::UpdateConference.new # UpdateConference | begin @@ -518,8 +518,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **conference_id** | **String** | Programmable Voice API Conference ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **conference_id** | **String** | Programmable Voice API Conference ID. | | | **update_conference** | [**UpdateConference**](UpdateConference.md) | | | ### Return type @@ -557,8 +557,8 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::ConferencesApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID +account_id = '9900000' # String | Your Bandwidth Account ID. +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID. body = ' @@ -594,8 +594,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **conference_id** | **String** | Programmable Voice API Conference ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **conference_id** | **String** | Programmable Voice API Conference ID. | | | **body** | **String** | | | ### Return type @@ -633,9 +633,9 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::ConferencesApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID -member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Conference Member ID +account_id = '9900000' # String | Your Bandwidth Account ID. +conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID. +member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Conference Member ID. update_conference_member = Bandwidth::UpdateConferenceMember.new # UpdateConferenceMember | begin @@ -668,9 +668,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **conference_id** | **String** | Programmable Voice API Conference ID | | -| **member_id** | **String** | Programmable Voice API Conference Member ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **conference_id** | **String** | Programmable Voice API Conference ID. | | +| **member_id** | **String** | Programmable Voice API Conference Member ID. | | | **update_conference_member** | [**UpdateConferenceMember**](UpdateConferenceMember.md) | | | ### Return type diff --git a/docs/CreateCall.md b/docs/CreateCall.md index 8e7d7750..9f8fda7e 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -4,15 +4,15 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **to** | **String** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.com`)). | | +| **to** | **String** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | | | **from** | **String** | 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`). | | | **uui** | **String** | 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** | **String** | The id of the application associated with the `from` number. | | -| **answer_url** | **String** | 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_url** | **String** | 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][default to 'POST'] | | **username** | **String** | Basic auth username. | [optional] | | **password** | **String** | Basic auth password. | [optional] | -| **answer_fallback_url** | **String** | 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_url** | **String** | 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][default to 'POST'] | | **fallback_username** | **String** | Basic auth username. | [optional] | | **fallback_password** | **String** | Basic auth password. | [optional] | @@ -32,23 +32,23 @@ require 'bandwidth-sdk' instance = Bandwidth::CreateCall.new( to: +19195551234, from: +19195554321, - uui: eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ=;encoding=base64, + uui: eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64, application_id: 1234-qwer-5679-tyui, - answer_url: https://www.myCallbackServer.com/webhooks/answer, + answer_url: https://www.myCallbackServer.example/webhooks/answer, answer_method: null, username: mySecretUsername, password: mySecretPassword1!, - answer_fallback_url: https://www.myFallbackServer.com/webhooks/answer, + answer_fallback_url: https://www.myFallbackServer.example/webhooks/answer, answer_fallback_method: null, fallback_username: mySecretUsername, fallback_password: mySecretPassword1!, - disconnect_url: null, + disconnect_url: https://www.myCallbackServer.example/webhooks/disconnect, disconnect_method: null, - call_timeout: null, - callback_timeout: null, + call_timeout: 30, + callback_timeout: 15, machine_detection: null, - priority: null, - tag: null + priority: 5, + tag: arbitrary text here ) ``` diff --git a/docs/CreateCallResponse.md b/docs/CreateCallResponse.md index e76e6599..e6412103 100644 --- a/docs/CreateCallResponse.md +++ b/docs/CreateCallResponse.md @@ -5,15 +5,15 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **application_id** | **String** | The id of the application associated with the `from` number. | | -| **account_id** | **String** | The bandwidth account ID associated with the call | | -| **call_id** | **String** | Programmable Voice API Call ID | | -| **to** | **String** | Recipient of the outgoing call | | -| **from** | **String** | Phone number that created the outbound call | | -| **enqueued_time** | **Time** | Time the call was accepted into the queue | [optional] | -| **call_url** | **String** | The URL to update call state | | +| **account_id** | **String** | The bandwidth account ID associated with the call. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | +| **to** | **String** | Recipient of the outgoing call. | | +| **from** | **String** | Phone number that created the outbound call. | | +| **enqueued_time** | **Time** | The time at which the call was accepted into the queue. | [optional] | +| **call_url** | **String** | The URL to update this call's state. | | | **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** | **String** | Custom tag value | [optional] | +| **tag** | **String** | Custom tag value. | [optional] | | **answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [default to 'POST'] | | **answer_url** | **String** | URL to deliver the `answer` event webhook. | | | **answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] | @@ -24,7 +24,7 @@ | **password** | **String** | Basic auth password. | [optional] | | **fallback_username** | **String** | Basic auth username. | [optional] | | **fallback_password** | **String** | Basic auth password. | [optional] | -| **priority** | **Float** | The priority of this call over other calls from your account. | [optional] | +| **priority** | **Integer** | The priority of this call over other calls from your account. | [optional] | ## Example @@ -43,11 +43,11 @@ instance = Bandwidth::CreateCallResponse.new( callback_timeout: 15, tag: My custom tag value, answer_method: null, - answer_url: https://myServer.com/bandwidth/webhooks/answer, + answer_url: https://myServer.example/bandwidth/webhooks/answer, answer_fallback_method: null, - answer_fallback_url: https://myFallbackServer.com/bandwidth/webhooks/answer, + answer_fallback_url: https://myFallbackServer.example/bandwidth/webhooks/answer, disconnect_method: null, - disconnect_url: https://myServer.com/bandwidth/webhooks/disconnect, + disconnect_url: https://myServer.example/bandwidth/webhooks/disconnect, username: mySecretUsername, password: mySecretPassword1!, fallback_username: mySecretUsername, diff --git a/docs/ListMessageItem.md b/docs/ListMessageItem.md index c78ae363..7e26c432 100644 --- a/docs/ListMessageItem.md +++ b/docs/ListMessageItem.md @@ -20,6 +20,7 @@ | **attachment_count** | **Integer** | The number of attachments the message has. | [optional] | | **recipient_count** | **Integer** | The number of recipients the message has. | [optional] | | **campaign_class** | **String** | The campaign class of the message if it has one. | [optional] | +| **campaign_id** | **String** | The campaign ID of the message if it has one. | [optional] | ## Example @@ -42,7 +43,8 @@ instance = Bandwidth::ListMessageItem.new( message_length: 18, attachment_count: 1, recipient_count: 1, - campaign_class: T + campaign_class: T, + campaign_id: CJEUMDK ) ``` diff --git a/docs/MFAApi.md b/docs/MFAApi.md index 4e626261..bef6c1fb 100644 --- a/docs/MFAApi.md +++ b/docs/MFAApi.md @@ -30,7 +30,7 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::MFAApi.new -account_id = 'account_id_example' # String | Bandwidth Account ID with Voice service enabled. +account_id = '9900000' # String | Your Bandwidth Account ID. code_request = Bandwidth::CodeRequest.new({to: '+19195551234', from: '+19195554321', application_id: '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', message: 'Your temporary {NAME} {SCOPE} code is {CODE}', digits: 6}) # CodeRequest | MFA code request body. begin @@ -64,7 +64,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Bandwidth Account ID with Voice service enabled. | | +| **account_id** | **String** | Your Bandwidth Account ID. | | | **code_request** | [**CodeRequest**](CodeRequest.md) | MFA code request body. | | ### Return type @@ -102,7 +102,7 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::MFAApi.new -account_id = 'account_id_example' # String | Bandwidth Account ID with Voice service enabled. +account_id = '9900000' # String | Your Bandwidth Account ID. code_request = Bandwidth::CodeRequest.new({to: '+19195551234', from: '+19195554321', application_id: '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', message: 'Your temporary {NAME} {SCOPE} code is {CODE}', digits: 6}) # CodeRequest | MFA code request body. begin @@ -136,7 +136,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Bandwidth Account ID with Voice service enabled. | | +| **account_id** | **String** | Your Bandwidth Account ID. | | | **code_request** | [**CodeRequest**](CodeRequest.md) | MFA code request body. | | ### Return type @@ -174,7 +174,7 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::MFAApi.new -account_id = 'account_id_example' # String | Bandwidth Account ID with Voice service enabled. +account_id = '9900000' # String | Your Bandwidth Account ID. verify_code_request = Bandwidth::VerifyCodeRequest.new({to: '+19195551234', expiration_time_in_minutes: 3, code: '123456'}) # VerifyCodeRequest | MFA code verify request body. begin @@ -208,7 +208,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Bandwidth Account ID with Voice service enabled. | | +| **account_id** | **String** | Your Bandwidth Account ID. | | | **verify_code_request** | [**VerifyCodeRequest**](VerifyCodeRequest.md) | MFA code verify request body. | | ### Return type diff --git a/docs/MachineDetectionCompleteCallback.md b/docs/MachineDetectionCompleteCallback.md index fc7e364c..3ed62de6 100644 --- a/docs/MachineDetectionCompleteCallback.md +++ b/docs/MachineDetectionCompleteCallback.md @@ -17,7 +17,7 @@ | **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] | | **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] | | **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | -| **machine_detection_result** | **String** | (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete | [optional] | +| **machine_detection_result** | [**MachineDetectionResult**](MachineDetectionResult.md) | | [optional] | ## Example diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md index 58f11dfa..737b3da4 100644 --- a/docs/MachineDetectionConfiguration.md +++ b/docs/MachineDetectionConfiguration.md @@ -33,11 +33,11 @@ instance = Bandwidth::MachineDetectionConfiguration.new( speech_end_threshold: 5, machine_speech_end_threshold: 5, delay_result: false, - callback_url: https://myServer.com/bandwidth/webhooks/machineDetectionComplete, + callback_url: https://myServer.example/bandwidth/webhooks/machineDetectionComplete, callback_method: null, username: mySecretUsername, password: mySecretPassword1!, - fallback_url: https://myFallbackServer.com/bandwidth/webhooks/machineDetectionComplete, + fallback_url: https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete, fallback_method: null, fallback_username: mySecretUsername, fallback_password: mySecretPassword1! diff --git a/docs/MachineDetectionResult.md b/docs/MachineDetectionResult.md new file mode 100644 index 00000000..f349841d --- /dev/null +++ b/docs/MachineDetectionResult.md @@ -0,0 +1,20 @@ +# Bandwidth::MachineDetectionResult + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **value** | **String** | Possible values are answering-machine, human, silence, timeout, or error. | [optional] | +| **duration** | **String** | The amount of time it took to determine the result. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::MachineDetectionResult.new( + value: answering-machine, + duration: PT4.9891287S +) +``` + diff --git a/docs/MessageDeliveredCallbackMessage.md b/docs/MessageDeliveredCallbackMessage.md index 39db1c6f..197d583d 100644 --- a/docs/MessageDeliveredCallbackMessage.md +++ b/docs/MessageDeliveredCallbackMessage.md @@ -31,7 +31,7 @@ instance = Bandwidth::MessageDeliveredCallbackMessage.new( direction: null, to: ["+15552223333"], from: +15553332222, - text: , + text: Hello world, tag: custom string, media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority: null diff --git a/docs/MessageFailedCallbackMessage.md b/docs/MessageFailedCallbackMessage.md index e82397d6..7716c6a9 100644 --- a/docs/MessageFailedCallbackMessage.md +++ b/docs/MessageFailedCallbackMessage.md @@ -31,7 +31,7 @@ instance = Bandwidth::MessageFailedCallbackMessage.new( direction: null, to: ["+15552223333"], from: +15553332222, - text: , + text: Hello world, tag: custom string, media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority: null diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md index 515cc54b..d5f64c2e 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -11,7 +11,7 @@ | **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] | | **tag** | **String** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | -| **expiration** | **Time** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. | [optional] | +| **expiration** | **Time** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] | ## Example diff --git a/docs/MessageSendingCallbackMessage.md b/docs/MessageSendingCallbackMessage.md index 507e6e6e..79b530aa 100644 --- a/docs/MessageSendingCallbackMessage.md +++ b/docs/MessageSendingCallbackMessage.md @@ -31,7 +31,7 @@ instance = Bandwidth::MessageSendingCallbackMessage.new( direction: null, to: ["+15552223333"], from: +15553332222, - text: , + text: Hello world, tag: custom string, media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority: null diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md index 2c6bbe96..cfa72b67 100644 --- a/docs/MessagesApi.md +++ b/docs/MessagesApi.md @@ -113,6 +113,7 @@ opts = { error_code: 9902, # Integer | The error code of the message. from_date_time: '2022-09-14T18:20:16.000Z', # String | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. to_date_time: '2022-09-14T18:20:16.000Z', # String | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + campaign_id: 'CJEUMDK', # String | The campaign ID of the message. sort: 'sourceTn:desc', # String | The field and direction to sort by combined with a colon. Direction is either asc or desc. page_token: 'gdEewhcJLQRB5', # String | A base64 encoded value used for pagination of results. limit: 50 # Integer | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. @@ -160,6 +161,7 @@ end | **error_code** | **Integer** | The error code of the message. | [optional] | | **from_date_time** | **String** | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | | **to_date_time** | **String** | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | +| **campaign_id** | **String** | The campaign ID of the message. | [optional] | | **sort** | **String** | The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional] | | **page_token** | **String** | A base64 encoded value used for pagination of results. | [optional] | | **limit** | **Integer** | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] | diff --git a/docs/PhoneNumberLookupApi.md b/docs/PhoneNumberLookupApi.md index 297ab2dd..52a9d1cb 100644 --- a/docs/PhoneNumberLookupApi.md +++ b/docs/PhoneNumberLookupApi.md @@ -29,7 +29,7 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::PhoneNumberLookupApi.new -account_id = '9900000' # String | The ID of the Bandwidth account that the user belongs to. +account_id = '9900000' # String | Your Bandwidth Account ID. lookup_request = Bandwidth::LookupRequest.new({tns: ['tns_example']}) # LookupRequest | Phone number lookup request. begin @@ -63,7 +63,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | The ID of the Bandwidth account that the user belongs to. | | +| **account_id** | **String** | Your Bandwidth Account ID. | | | **lookup_request** | [**LookupRequest**](LookupRequest.md) | Phone number lookup request. | | ### Return type @@ -101,7 +101,7 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::PhoneNumberLookupApi.new -account_id = '9900000' # String | The ID of the Bandwidth account that the user belongs to. +account_id = '9900000' # String | Your Bandwidth Account ID. request_id = '004223a0-8b17-41b1-bf81-20732adf5590' # String | The phone number lookup request ID from Bandwidth. begin @@ -135,7 +135,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | The ID of the Bandwidth account that the user belongs to. | | +| **account_id** | **String** | Your Bandwidth Account ID. | | | **request_id** | **String** | The phone number lookup request ID from Bandwidth. | | ### Return type diff --git a/docs/RecordingsApi.md b/docs/RecordingsApi.md index 9148367b..7faa3d73 100644 --- a/docs/RecordingsApi.md +++ b/docs/RecordingsApi.md @@ -37,9 +37,9 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::RecordingsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID -recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID. begin # Delete Transcription @@ -71,9 +71,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | -| **recording_id** | **String** | Programmable Voice API Recording ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | +| **recording_id** | **String** | Programmable Voice API Recording ID. | | ### Return type @@ -110,9 +110,9 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::RecordingsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID -recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID. begin # Delete Recording @@ -144,9 +144,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | -| **recording_id** | **String** | Programmable Voice API Recording ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | +| **recording_id** | **String** | Programmable Voice API Recording ID. | | ### Return type @@ -183,9 +183,9 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::RecordingsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID -recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID. begin # Delete Recording Media @@ -217,9 +217,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | -| **recording_id** | **String** | Programmable Voice API Recording ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | +| **recording_id** | **String** | Programmable Voice API Recording ID. | | ### Return type @@ -256,9 +256,9 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::RecordingsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID -recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID. begin # Download Recording @@ -291,9 +291,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | -| **recording_id** | **String** | Programmable Voice API Recording ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | +| **recording_id** | **String** | Programmable Voice API Recording ID. | | ### Return type @@ -330,9 +330,9 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::RecordingsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID -recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID. begin # Get Call Recording @@ -365,9 +365,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | -| **recording_id** | **String** | Programmable Voice API Recording ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | +| **recording_id** | **String** | Programmable Voice API Recording ID. | | ### Return type @@ -404,9 +404,9 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::RecordingsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID -recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID. begin # Get Transcription @@ -439,9 +439,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | -| **recording_id** | **String** | Programmable Voice API Recording ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | +| **recording_id** | **String** | Programmable Voice API Recording ID. | | ### Return type @@ -478,7 +478,7 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::RecordingsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID +account_id = '9900000' # String | Your Bandwidth Account ID. opts = { to: '%2b19195551234', # String | Filter results by the `to` field. from: '%2b19195554321', # String | Filter results by the `from` field. @@ -517,7 +517,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | | **to** | **String** | Filter results by the `to` field. | [optional] | | **from** | **String** | Filter results by the `from` field. | [optional] | | **min_start_time** | **String** | Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). | [optional] | @@ -558,8 +558,8 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::RecordingsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. begin # List Call Recordings @@ -592,8 +592,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | ### Return type @@ -630,9 +630,9 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::RecordingsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID -recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. +recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID. transcribe_recording = Bandwidth::TranscribeRecording.new # TranscribeRecording | begin @@ -665,9 +665,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | -| **recording_id** | **String** | Programmable Voice API Recording ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | +| **recording_id** | **String** | Programmable Voice API Recording ID. | | | **transcribe_recording** | [**TranscribeRecording**](TranscribeRecording.md) | | | ### Return type @@ -705,8 +705,8 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::RecordingsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID -call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID +account_id = '9900000' # String | Your Bandwidth Account ID. +call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID. update_call_recording = Bandwidth::UpdateCallRecording.new({state: Bandwidth::RecordingStateEnum::PAUSED}) # UpdateCallRecording | begin @@ -739,8 +739,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | -| **call_id** | **String** | Programmable Voice API Call ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **call_id** | **String** | Programmable Voice API Call ID. | | | **update_call_recording** | [**UpdateCallRecording**](UpdateCallRecording.md) | | | ### Return type diff --git a/docs/StatisticsApi.md b/docs/StatisticsApi.md index d186fb64..8809fd44 100644 --- a/docs/StatisticsApi.md +++ b/docs/StatisticsApi.md @@ -28,7 +28,7 @@ Bandwidth.configure do |config| end api_instance = Bandwidth::StatisticsApi.new -account_id = '9900000' # String | Your Bandwidth Account ID +account_id = '9900000' # String | Your Bandwidth Account ID. begin # Get Account Statistics @@ -61,7 +61,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **account_id** | **String** | Your Bandwidth Account ID | | +| **account_id** | **String** | Your Bandwidth Account ID. | | ### Return type diff --git a/docs/TranscribeRecording.md b/docs/TranscribeRecording.md index 35daa8b0..de2ab0f9 100644 --- a/docs/TranscribeRecording.md +++ b/docs/TranscribeRecording.md @@ -10,6 +10,7 @@ | **password** | **String** | Basic auth password. | [optional] | | **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | | **callback_timeout** | **Float** | This is the timeout (in seconds) to use when delivering the webhook to `callbackUrl`. Can be any numeric value (including decimals) between 1 and 25. | [optional][default to 15] | +| **detect_language** | **Boolean** | A boolean value to indicate that the recording may not be in English, and the transcription service will need to detect the dominant language the recording is in and transcribe accordingly. Current supported languages are English, French, and Spanish. | [optional][default to false] | ## Example @@ -17,12 +18,13 @@ require 'bandwidth-sdk' instance = Bandwidth::TranscribeRecording.new( - callback_url: https://myServer.com/bandwidth/webhooks/transcriptionAvailable, + callback_url: https://myServer.example/bandwidth/webhooks/transcriptionAvailable, callback_method: null, username: mySecretUsername, password: mySecretPassword1!, tag: exampleTag, - callback_timeout: 5.5 + callback_timeout: 5.5, + detect_language: true ) ``` diff --git a/docs/UpdateCall.md b/docs/UpdateCall.md index 67c07d8d..f8f4a16f 100644 --- a/docs/UpdateCall.md +++ b/docs/UpdateCall.md @@ -9,7 +9,7 @@ | **redirect_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional][default to 'POST'] | | **username** | **String** | Basic auth username. | [optional] | | **password** | **String** | Basic auth password. | [optional] | -| **redirect_fallback_url** | **String** | A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond | [optional] | +| **redirect_fallback_url** | **String** | 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][default to 'POST'] | | **fallback_username** | **String** | Basic auth username. | [optional] | | **fallback_password** | **String** | Basic auth password. | [optional] | @@ -22,11 +22,11 @@ require 'bandwidth-sdk' instance = Bandwidth::UpdateCall.new( state: null, - redirect_url: https://myServer.com/bandwidth/webhooks/redirect, + redirect_url: https://myServer.example/bandwidth/webhooks/redirect, redirect_method: null, username: mySecretUsername, password: mySecretPassword1!, - redirect_fallback_url: https://myFallbackServer.com/bandwidth/webhooks/redirect, + redirect_fallback_url: https://myFallbackServer.example/bandwidth/webhooks/redirect, redirect_fallback_method: null, fallback_username: mySecretUsername, fallback_password: mySecretPassword1!, diff --git a/docs/UpdateConference.md b/docs/UpdateConference.md index e4cb22f5..9843a89d 100644 --- a/docs/UpdateConference.md +++ b/docs/UpdateConference.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **status** | [**ConferenceStateEnum**](ConferenceStateEnum.md) | | [optional][default to 'active'] | -| **redirect_url** | **String** | 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_url** | **String** | 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][default to 'POST'] | | **username** | **String** | Basic auth username. | [optional] | | **password** | **String** | Basic auth password. | [optional] | @@ -21,11 +21,11 @@ require 'bandwidth-sdk' instance = Bandwidth::UpdateConference.new( status: null, - redirect_url: https://myServer.com/bandwidth/webhooks/conferenceRedirect, + redirect_url: https://myServer.example/bandwidth/webhooks/conferenceRedirect, redirect_method: null, username: mySecretUsername, password: mySecretPassword1!, - redirect_fallback_url: https://myFallbackServer.com/bandwidth/webhooks/conferenceRedirect, + redirect_fallback_url: https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect, redirect_fallback_method: null, fallback_username: mySecretUsername, fallback_password: mySecretPassword1! diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index e62e7295..e2b3caf6 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -60,6 +60,7 @@ require 'bandwidth-sdk/models/machine_detection_complete_callback' require 'bandwidth-sdk/models/machine_detection_configuration' require 'bandwidth-sdk/models/machine_detection_mode_enum' +require 'bandwidth-sdk/models/machine_detection_result' require 'bandwidth-sdk/models/media' require 'bandwidth-sdk/models/message' require 'bandwidth-sdk/models/message_delivered_callback' diff --git a/lib/bandwidth-sdk/api/calls_api.rb b/lib/bandwidth-sdk/api/calls_api.rb index afa882ca..d9c5e439 100644 --- a/lib/bandwidth-sdk/api/calls_api.rb +++ b/lib/bandwidth-sdk/api/calls_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -21,7 +21,7 @@ def initialize(api_client = ApiClient.default) end # Create Call # Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. Please note: Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed. - # @param account_id [String] Your Bandwidth Account ID + # @param account_id [String] Your Bandwidth Account ID. # @param create_call [CreateCall] JSON object containing information to create an outbound call # @param [Hash] opts the optional parameters # @return [CreateCallResponse] @@ -32,7 +32,7 @@ def create_call(account_id, create_call, opts = {}) # Create Call # Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. <b>Please note:</b> Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed. - # @param account_id [String] Your Bandwidth Account ID + # @param account_id [String] Your Bandwidth Account ID. # @param create_call [CreateCall] JSON object containing information to create an outbound call # @param [Hash] opts the optional parameters # @return [Array<(CreateCallResponse, Integer, Hash)>] CreateCallResponse data, response status code and response headers @@ -61,7 +61,7 @@ def create_call_with_http_info(account_id, create_call, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -95,8 +95,8 @@ def create_call_with_http_info(account_id, create_call, opts = {}) # Get Call State Information # Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: 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 HTTP 404 response. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. # @param [Hash] opts the optional parameters # @return [CallState] def get_call_state(account_id, call_id, opts = {}) @@ -106,8 +106,8 @@ def get_call_state(account_id, call_id, opts = {}) # Get Call State Information # Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: 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 HTTP 404 response. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. # @param [Hash] opts the optional parameters # @return [Array<(CallState, Integer, Hash)>] CallState data, response status code and response headers def get_call_state_with_http_info(account_id, call_id, opts = {}) @@ -164,8 +164,8 @@ def get_call_state_with_http_info(account_id, call_id, opts = {}) # Update Call # Interrupts and redirects a call to a different URL that should return a BXML document. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. # @param update_call [UpdateCall] JSON object containing information to redirect an existing call to a new BXML document # @param [Hash] opts the optional parameters # @return [nil] @@ -176,8 +176,8 @@ def update_call(account_id, call_id, update_call, opts = {}) # Update Call # Interrupts and redirects a call to a different URL that should return a BXML document. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. # @param update_call [UpdateCall] JSON object containing information to redirect an existing call to a new BXML document # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -210,7 +210,7 @@ def update_call_with_http_info(account_id, call_id, update_call, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -244,8 +244,8 @@ def update_call_with_http_info(account_id, call_id, update_call, opts = {}) # Update Call BXML # Interrupts and replaces an active call's BXML document. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. # @param body [String] # @param [Hash] opts the optional parameters # @return [nil] @@ -256,8 +256,8 @@ def update_call_bxml(account_id, call_id, body, opts = {}) # Update Call BXML # Interrupts and replaces an active call's BXML document. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. # @param body [String] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -290,7 +290,7 @@ def update_call_bxml_with_http_info(account_id, call_id, body, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/xml']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters diff --git a/lib/bandwidth-sdk/api/conferences_api.rb b/lib/bandwidth-sdk/api/conferences_api.rb index fcb16920..6f396982 100644 --- a/lib/bandwidth-sdk/api/conferences_api.rb +++ b/lib/bandwidth-sdk/api/conferences_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -21,9 +21,9 @@ def initialize(api_client = ApiClient.default) end # Download Conference Recording # Downloads the specified recording file. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [File] def download_conference_recording(account_id, conference_id, recording_id, opts = {}) @@ -33,9 +33,9 @@ def download_conference_recording(account_id, conference_id, recording_id, opts # Download Conference Recording # Downloads the specified recording file. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers def download_conference_recording_with_http_info(account_id, conference_id, recording_id, opts = {}) @@ -96,8 +96,8 @@ def download_conference_recording_with_http_info(account_id, conference_id, reco # Get Conference Information # Returns information about the specified conference. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. # @param [Hash] opts the optional parameters # @return [Conference] def get_conference(account_id, conference_id, opts = {}) @@ -107,8 +107,8 @@ def get_conference(account_id, conference_id, opts = {}) # Get Conference Information # Returns information about the specified conference. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. # @param [Hash] opts the optional parameters # @return [Array<(Conference, Integer, Hash)>] Conference data, response status code and response headers def get_conference_with_http_info(account_id, conference_id, opts = {}) @@ -165,9 +165,9 @@ def get_conference_with_http_info(account_id, conference_id, opts = {}) # Get Conference Member # Returns information about the specified conference member. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID - # @param member_id [String] Programmable Voice API Conference Member ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. + # @param member_id [String] Programmable Voice API Conference Member ID. # @param [Hash] opts the optional parameters # @return [ConferenceMember] def get_conference_member(account_id, conference_id, member_id, opts = {}) @@ -177,9 +177,9 @@ def get_conference_member(account_id, conference_id, member_id, opts = {}) # Get Conference Member # Returns information about the specified conference member. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID - # @param member_id [String] Programmable Voice API Conference Member ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. + # @param member_id [String] Programmable Voice API Conference Member ID. # @param [Hash] opts the optional parameters # @return [Array<(ConferenceMember, Integer, Hash)>] ConferenceMember data, response status code and response headers def get_conference_member_with_http_info(account_id, conference_id, member_id, opts = {}) @@ -240,9 +240,9 @@ def get_conference_member_with_http_info(account_id, conference_id, member_id, o # Get Conference Recording Information # Returns metadata for the specified recording. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [ConferenceRecordingMetadata] def get_conference_recording(account_id, conference_id, recording_id, opts = {}) @@ -252,9 +252,9 @@ def get_conference_recording(account_id, conference_id, recording_id, opts = {}) # Get Conference Recording Information # Returns metadata for the specified recording. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [Array<(ConferenceRecordingMetadata, Integer, Hash)>] ConferenceRecordingMetadata data, response status code and response headers def get_conference_recording_with_http_info(account_id, conference_id, recording_id, opts = {}) @@ -315,8 +315,8 @@ def get_conference_recording_with_http_info(account_id, conference_id, recording # Get Conference Recordings # Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. # @param [Hash] opts the optional parameters # @return [Array] def list_conference_recordings(account_id, conference_id, opts = {}) @@ -326,8 +326,8 @@ def list_conference_recordings(account_id, conference_id, opts = {}) # Get Conference Recordings # Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def list_conference_recordings_with_http_info(account_id, conference_id, opts = {}) @@ -384,7 +384,7 @@ def list_conference_recordings_with_http_info(account_id, conference_id, opts = # Get Conferences # Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences 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 conference records. - # @param account_id [String] Your Bandwidth Account ID + # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters # @option opts [String] :name Filter results by the `name` field. # @option opts [String] :min_created_time Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). @@ -399,7 +399,7 @@ def list_conferences(account_id, opts = {}) # Get Conferences # Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences 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 conference records. - # @param account_id [String] Your Bandwidth Account ID + # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters # @option opts [String] :name Filter results by the `name` field. # @option opts [String] :min_created_time Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). @@ -470,8 +470,8 @@ def list_conferences_with_http_info(account_id, opts = {}) # Update Conference # Update the conference state. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. # @param update_conference [UpdateConference] # @param [Hash] opts the optional parameters # @return [nil] @@ -482,8 +482,8 @@ def update_conference(account_id, conference_id, update_conference, opts = {}) # Update Conference # Update the conference state. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. # @param update_conference [UpdateConference] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -516,7 +516,7 @@ def update_conference_with_http_info(account_id, conference_id, update_conferenc # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -550,8 +550,8 @@ def update_conference_with_http_info(account_id, conference_id, update_conferenc # Update Conference BXML # Update the conference BXML document. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. # @param body [String] # @param [Hash] opts the optional parameters # @return [nil] @@ -562,8 +562,8 @@ def update_conference_bxml(account_id, conference_id, body, opts = {}) # Update Conference BXML # Update the conference BXML document. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. # @param body [String] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -596,7 +596,7 @@ def update_conference_bxml_with_http_info(account_id, conference_id, body, opts # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/xml']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -630,9 +630,9 @@ def update_conference_bxml_with_http_info(account_id, conference_id, body, opts # Update Conference Member # Updates settings for a particular conference member. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID - # @param member_id [String] Programmable Voice API Conference Member ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. + # @param member_id [String] Programmable Voice API Conference Member ID. # @param update_conference_member [UpdateConferenceMember] # @param [Hash] opts the optional parameters # @return [nil] @@ -643,9 +643,9 @@ def update_conference_member(account_id, conference_id, member_id, update_confer # Update Conference Member # Updates settings for a particular conference member. - # @param account_id [String] Your Bandwidth Account ID - # @param conference_id [String] Programmable Voice API Conference ID - # @param member_id [String] Programmable Voice API Conference Member ID + # @param account_id [String] Your Bandwidth Account ID. + # @param conference_id [String] Programmable Voice API Conference ID. + # @param member_id [String] Programmable Voice API Conference Member ID. # @param update_conference_member [UpdateConferenceMember] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -682,7 +682,7 @@ def update_conference_member_with_http_info(account_id, conference_id, member_id # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters diff --git a/lib/bandwidth-sdk/api/media_api.rb b/lib/bandwidth-sdk/api/media_api.rb index 0acc1bd1..f7a698cb 100644 --- a/lib/bandwidth-sdk/api/media_api.rb +++ b/lib/bandwidth-sdk/api/media_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -275,7 +275,7 @@ def upload_media_with_http_info(account_id, media_id, body, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json', 'application/ogg', 'application/pdf', 'application/rtf', 'application/zip', 'application/x-tar', 'application/xml', 'application/gzip', 'application/x-bzip2', 'application/x-gzip', 'application/smil', 'application/javascript', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/flac', 'audio/webm', 'audio/wav', 'audio/amr', 'audio/3gpp', 'image/bmp', 'image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/svg+xml', 'image/tiff', 'image/webp', 'image/x-icon', 'text/css', 'text/csv', 'text/calendar', 'text/plain', 'text/javascript', 'text/vcard', 'text/vnd.wap.wml', 'text/xml', 'video/avi', 'video/mp4', 'video/mpeg', 'video/ogg', 'video/quicktime', 'video/webm', 'video/x-ms-wmv']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end header_params[:'Content-Type'] = opts[:'content_type'] if !opts[:'content_type'].nil? header_params[:'Cache-Control'] = opts[:'cache_control'] if !opts[:'cache_control'].nil? diff --git a/lib/bandwidth-sdk/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb index 88c36a4a..56de282b 100644 --- a/lib/bandwidth-sdk/api/messages_api.rb +++ b/lib/bandwidth-sdk/api/messages_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -61,7 +61,7 @@ def create_message_with_http_info(account_id, message_request, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -107,6 +107,7 @@ def create_message_with_http_info(account_id, message_request, opts = {}) # @option opts [Integer] :error_code The error code of the message. # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :campaign_id The campaign ID of the message. # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. # @option opts [String] :page_token A base64 encoded value used for pagination of results. # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. @@ -130,6 +131,7 @@ def list_messages(account_id, opts = {}) # @option opts [Integer] :error_code The error code of the message. # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :campaign_id The campaign ID of the message. # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. # @option opts [String] :page_token A base64 encoded value used for pagination of results. # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. @@ -157,6 +159,7 @@ def list_messages_with_http_info(account_id, opts = {}) query_params[:'errorCode'] = opts[:'error_code'] if !opts[:'error_code'].nil? query_params[:'fromDateTime'] = opts[:'from_date_time'] if !opts[:'from_date_time'].nil? query_params[:'toDateTime'] = opts[:'to_date_time'] if !opts[:'to_date_time'].nil? + query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? diff --git a/lib/bandwidth-sdk/api/mfa_api.rb b/lib/bandwidth-sdk/api/mfa_api.rb index dbca5a9f..b274830f 100644 --- a/lib/bandwidth-sdk/api/mfa_api.rb +++ b/lib/bandwidth-sdk/api/mfa_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -21,7 +21,7 @@ def initialize(api_client = ApiClient.default) end # Messaging Authentication Code # Send an MFA code via text message (SMS). - # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param account_id [String] Your Bandwidth Account ID. # @param code_request [CodeRequest] MFA code request body. # @param [Hash] opts the optional parameters # @return [MessagingCodeResponse] @@ -32,7 +32,7 @@ def generate_messaging_code(account_id, code_request, opts = {}) # Messaging Authentication Code # Send an MFA code via text message (SMS). - # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param account_id [String] Your Bandwidth Account ID. # @param code_request [CodeRequest] MFA code request body. # @param [Hash] opts the optional parameters # @return [Array<(MessagingCodeResponse, Integer, Hash)>] MessagingCodeResponse data, response status code and response headers @@ -61,7 +61,7 @@ def generate_messaging_code_with_http_info(account_id, code_request, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -95,7 +95,7 @@ def generate_messaging_code_with_http_info(account_id, code_request, opts = {}) # Voice Authentication Code # Send an MFA Code via a phone call. - # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param account_id [String] Your Bandwidth Account ID. # @param code_request [CodeRequest] MFA code request body. # @param [Hash] opts the optional parameters # @return [VoiceCodeResponse] @@ -106,7 +106,7 @@ def generate_voice_code(account_id, code_request, opts = {}) # Voice Authentication Code # Send an MFA Code via a phone call. - # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param account_id [String] Your Bandwidth Account ID. # @param code_request [CodeRequest] MFA code request body. # @param [Hash] opts the optional parameters # @return [Array<(VoiceCodeResponse, Integer, Hash)>] VoiceCodeResponse data, response status code and response headers @@ -135,7 +135,7 @@ def generate_voice_code_with_http_info(account_id, code_request, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -169,7 +169,7 @@ def generate_voice_code_with_http_info(account_id, code_request, opts = {}) # Verify Authentication Code # Verify a previously sent MFA code. - # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param account_id [String] Your Bandwidth Account ID. # @param verify_code_request [VerifyCodeRequest] MFA code verify request body. # @param [Hash] opts the optional parameters # @return [VerifyCodeResponse] @@ -180,7 +180,7 @@ def verify_code(account_id, verify_code_request, opts = {}) # Verify Authentication Code # Verify a previously sent MFA code. - # @param account_id [String] Bandwidth Account ID with Voice service enabled. + # @param account_id [String] Your Bandwidth Account ID. # @param verify_code_request [VerifyCodeRequest] MFA code verify request body. # @param [Hash] opts the optional parameters # @return [Array<(VerifyCodeResponse, Integer, Hash)>] VerifyCodeResponse data, response status code and response headers @@ -209,7 +209,7 @@ def verify_code_with_http_info(account_id, verify_code_request, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters diff --git a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb index 32600c02..a7cdc355 100644 --- a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +++ b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -21,7 +21,7 @@ def initialize(api_client = ApiClient.default) end # Create Lookup # Create a Phone Number Lookup Request. - # @param account_id [String] The ID of the Bandwidth account that the user belongs to. + # @param account_id [String] Your Bandwidth Account ID. # @param lookup_request [LookupRequest] Phone number lookup request. # @param [Hash] opts the optional parameters # @return [CreateLookupResponse] @@ -32,7 +32,7 @@ def create_lookup(account_id, lookup_request, opts = {}) # Create Lookup # Create a Phone Number Lookup Request. - # @param account_id [String] The ID of the Bandwidth account that the user belongs to. + # @param account_id [String] Your Bandwidth Account ID. # @param lookup_request [LookupRequest] Phone number lookup request. # @param [Hash] opts the optional parameters # @return [Array<(CreateLookupResponse, Integer, Hash)>] CreateLookupResponse data, response status code and response headers @@ -61,7 +61,7 @@ def create_lookup_with_http_info(account_id, lookup_request, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -95,7 +95,7 @@ def create_lookup_with_http_info(account_id, lookup_request, opts = {}) # Get Lookup Request Status # Get an existing Phone Number Lookup Request. - # @param account_id [String] The ID of the Bandwidth account that the user belongs to. + # @param account_id [String] Your Bandwidth Account ID. # @param request_id [String] The phone number lookup request ID from Bandwidth. # @param [Hash] opts the optional parameters # @return [LookupStatus] @@ -106,7 +106,7 @@ def get_lookup_status(account_id, request_id, opts = {}) # Get Lookup Request Status # Get an existing Phone Number Lookup Request. - # @param account_id [String] The ID of the Bandwidth account that the user belongs to. + # @param account_id [String] Your Bandwidth Account ID. # @param request_id [String] The phone number lookup request ID from Bandwidth. # @param [Hash] opts the optional parameters # @return [Array<(LookupStatus, Integer, Hash)>] LookupStatus data, response status code and response headers diff --git a/lib/bandwidth-sdk/api/recordings_api.rb b/lib/bandwidth-sdk/api/recordings_api.rb index c1d8797d..bbce395a 100644 --- a/lib/bandwidth-sdk/api/recordings_api.rb +++ b/lib/bandwidth-sdk/api/recordings_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -21,9 +21,9 @@ def initialize(api_client = ApiClient.default) end # Delete Transcription # 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 [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [nil] def delete_call_transcription(account_id, call_id, recording_id, opts = {}) @@ -33,9 +33,9 @@ def delete_call_transcription(account_id, call_id, recording_id, opts = {}) # Delete Transcription # 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 [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_call_transcription_with_http_info(account_id, call_id, recording_id, opts = {}) @@ -96,9 +96,9 @@ def delete_call_transcription_with_http_info(account_id, call_id, recording_id, # Delete Recording # 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 [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [nil] def delete_recording(account_id, call_id, recording_id, opts = {}) @@ -108,9 +108,9 @@ def delete_recording(account_id, call_id, recording_id, opts = {}) # Delete Recording # 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 [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_recording_with_http_info(account_id, call_id, recording_id, opts = {}) @@ -171,9 +171,9 @@ def delete_recording_with_http_info(account_id, call_id, recording_id, opts = {} # Delete Recording Media # Deletes the specified recording's media. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [nil] def delete_recording_media(account_id, call_id, recording_id, opts = {}) @@ -183,9 +183,9 @@ def delete_recording_media(account_id, call_id, recording_id, opts = {}) # Delete Recording Media # Deletes the specified recording's media. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_recording_media_with_http_info(account_id, call_id, recording_id, opts = {}) @@ -246,9 +246,9 @@ def delete_recording_media_with_http_info(account_id, call_id, recording_id, opt # Download Recording # Downloads the specified recording. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [File] def download_call_recording(account_id, call_id, recording_id, opts = {}) @@ -258,9 +258,9 @@ def download_call_recording(account_id, call_id, recording_id, opts = {}) # Download Recording # Downloads the specified recording. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers def download_call_recording_with_http_info(account_id, call_id, recording_id, opts = {}) @@ -321,9 +321,9 @@ def download_call_recording_with_http_info(account_id, call_id, recording_id, op # Get Call Recording # Returns metadata for the specified recording. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [CallRecordingMetadata] def get_call_recording(account_id, call_id, recording_id, opts = {}) @@ -333,9 +333,9 @@ def get_call_recording(account_id, call_id, recording_id, opts = {}) # Get Call Recording # Returns metadata for the specified recording. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [Array<(CallRecordingMetadata, Integer, Hash)>] CallRecordingMetadata data, response status code and response headers def get_call_recording_with_http_info(account_id, call_id, recording_id, opts = {}) @@ -396,9 +396,9 @@ def get_call_recording_with_http_info(account_id, call_id, recording_id, opts = # 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. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [TranscriptionList] def get_call_transcription(account_id, call_id, recording_id, opts = {}) @@ -408,9 +408,9 @@ def get_call_transcription(account_id, call_id, recording_id, opts = {}) # 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 [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/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 [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [Array<(TranscriptionList, Integer, Hash)>] TranscriptionList data, response status code and response headers def get_call_transcription_with_http_info(account_id, call_id, recording_id, opts = {}) @@ -471,7 +471,7 @@ def get_call_transcription_with_http_info(account_id, call_id, recording_id, opt # Get Call Recordings # Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria. - # @param account_id [String] Your Bandwidth Account ID + # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters # @option opts [String] :to Filter results by the `to` field. # @option opts [String] :from Filter results by the `from` field. @@ -485,7 +485,7 @@ def list_account_call_recordings(account_id, opts = {}) # Get Call Recordings # Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria. - # @param account_id [String] Your Bandwidth Account ID + # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters # @option opts [String] :to Filter results by the `to` field. # @option opts [String] :from Filter results by the `from` field. @@ -546,8 +546,8 @@ def list_account_call_recordings_with_http_info(account_id, opts = {}) # List Call Recordings # Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. # @param [Hash] opts the optional parameters # @return [Array] def list_call_recordings(account_id, call_id, opts = {}) @@ -557,8 +557,8 @@ def list_call_recordings(account_id, call_id, opts = {}) # List Call Recordings # Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def list_call_recordings_with_http_info(account_id, call_id, opts = {}) @@ -615,9 +615,9 @@ def list_call_recordings_with_http_info(account_id, call_id, opts = {}) # Create Transcription Request # Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param transcribe_recording [TranscribeRecording] # @param [Hash] opts the optional parameters # @return [nil] @@ -628,9 +628,9 @@ def transcribe_call_recording(account_id, call_id, recording_id, transcribe_reco # Create Transcription Request # Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID - # @param recording_id [String] Programmable Voice API Recording ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. + # @param recording_id [String] Programmable Voice API Recording ID. # @param transcribe_recording [TranscribeRecording] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -667,7 +667,7 @@ def transcribe_call_recording_with_http_info(account_id, call_id, recording_id, # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -701,8 +701,8 @@ def transcribe_call_recording_with_http_info(account_id, call_id, recording_id, # Update Recording # Pause or resume a recording on an active phone call. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. # @param update_call_recording [UpdateCallRecording] # @param [Hash] opts the optional parameters # @return [nil] @@ -713,8 +713,8 @@ def update_call_recording_state(account_id, call_id, update_call_recording, opts # Update Recording # Pause or resume a recording on an active phone call. - # @param account_id [String] Your Bandwidth Account ID - # @param call_id [String] Programmable Voice API Call ID + # @param account_id [String] Your Bandwidth Account ID. + # @param call_id [String] Programmable Voice API Call ID. # @param update_call_recording [UpdateCallRecording] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -747,7 +747,7 @@ def update_call_recording_state_with_http_info(account_id, call_id, update_call_ # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters diff --git a/lib/bandwidth-sdk/api/statistics_api.rb b/lib/bandwidth-sdk/api/statistics_api.rb index 57adf8d2..a74d64e1 100644 --- a/lib/bandwidth-sdk/api/statistics_api.rb +++ b/lib/bandwidth-sdk/api/statistics_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -21,7 +21,7 @@ def initialize(api_client = ApiClient.default) end # Get Account Statistics # Returns details about the current state of the account. - # @param account_id [String] Your Bandwidth Account ID + # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters # @return [AccountStatistics] def get_statistics(account_id, opts = {}) @@ -31,7 +31,7 @@ def get_statistics(account_id, opts = {}) # Get Account Statistics # Returns details about the current state of the account. - # @param account_id [String] Your Bandwidth Account ID + # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters # @return [Array<(AccountStatistics, Integer, Hash)>] AccountStatistics data, response status code and response headers def get_statistics_with_http_info(account_id, opts = {}) diff --git a/lib/bandwidth-sdk/api_client.rb b/lib/bandwidth-sdk/api_client.rb index 55feb181..374eaaa9 100644 --- a/lib/bandwidth-sdk/api_client.rb +++ b/lib/bandwidth-sdk/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/api_error.rb b/lib/bandwidth-sdk/api_error.rb index c57fdc9a..f78c9947 100644 --- a/lib/bandwidth-sdk/api_error.rb +++ b/lib/bandwidth-sdk/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/configuration.rb b/lib/bandwidth-sdk/configuration.rb index acd84420..5130c52e 100644 --- a/lib/bandwidth-sdk/configuration.rb +++ b/lib/bandwidth-sdk/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -224,8 +224,8 @@ def api_key_with_prefix(param_name, param_alias = nil) # Gets access_token using access_token_getter or uses the static access_token def access_token_with_refresh - return access_token if access_token_getter.nil? - access_token_getter.call + return access_token if access_token_getter.nil? + access_token_getter.call end # Gets Basic Auth token string diff --git a/lib/bandwidth-sdk/models/account_statistics.rb b/lib/bandwidth-sdk/models/account_statistics.rb index f911ed11..8179002e 100644 --- a/lib/bandwidth-sdk/models/account_statistics.rb +++ b/lib/bandwidth-sdk/models/account_statistics.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -224,7 +224,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/answer_callback.rb b/lib/bandwidth-sdk/models/answer_callback.rb index 1cd02565..57e92815 100644 --- a/lib/bandwidth-sdk/models/answer_callback.rb +++ b/lib/bandwidth-sdk/models/answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -54,7 +54,6 @@ class AnswerCallback # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. attr_accessor :tag - # (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete attr_accessor :machine_detection_result class EnumAttributeValidator @@ -120,7 +119,7 @@ def self.openapi_types :'start_time' => :'Time', :'answer_time' => :'Time', :'tag' => :'String', - :'machine_detection_result' => :'String' + :'machine_detection_result' => :'MachineDetectionResult' } end @@ -370,7 +369,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/bridge_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_complete_callback.rb index 331540e6..b86c9a5b 100644 --- a/lib/bandwidth-sdk/models/bridge_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -391,7 +391,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb index e33ee139..16860dce 100644 --- a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -359,7 +359,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/bxml/bxml.rb b/lib/bandwidth-sdk/models/bxml/bxml.rb index f33160c3..0383ed7d 100644 --- a/lib/bandwidth-sdk/models/bxml/bxml.rb +++ b/lib/bandwidth-sdk/models/bxml/bxml.rb @@ -6,7 +6,7 @@ class Bxml # Initializer # @param nested_verbs [Array] XML element children. Defaults to an empty array. def initialize(nested_verbs = []) - super(tag='Bxml', nested_verbs) + super(tag = 'Bxml', nested_verbs) end end end diff --git a/lib/bandwidth-sdk/models/bxml/nestable_verb.rb b/lib/bandwidth-sdk/models/bxml/nestable_verb.rb index 8d380e4a..a5b1aa07 100644 --- a/lib/bandwidth-sdk/models/bxml/nestable_verb.rb +++ b/lib/bandwidth-sdk/models/bxml/nestable_verb.rb @@ -42,9 +42,8 @@ def generate_xml end end - return root + root end - end end end diff --git a/lib/bandwidth-sdk/models/bxml/response.rb b/lib/bandwidth-sdk/models/bxml/response.rb index 174509bd..195c2887 100644 --- a/lib/bandwidth-sdk/models/bxml/response.rb +++ b/lib/bandwidth-sdk/models/bxml/response.rb @@ -6,7 +6,7 @@ class Response # Initializer # @param nested_verbs [Array] XML element children. Defaults to an empty array. def initialize(nested_verbs = []) - super(tag='Response', nested_verbs) + super(tag = 'Response', nested_verbs) end end end diff --git a/lib/bandwidth-sdk/models/bxml/root.rb b/lib/bandwidth-sdk/models/bxml/root.rb index c171a868..9d32884d 100644 --- a/lib/bandwidth-sdk/models/bxml/root.rb +++ b/lib/bandwidth-sdk/models/bxml/root.rb @@ -27,7 +27,7 @@ def generate_xml root << verb.generate_xml end xml << root - return xml + xml end # Add a verb to the nested verbs array @@ -40,7 +40,7 @@ def add_verb(nested_verbs) # @return [String] The XML response in string format. def to_bxml bxml = Ox.dump(generate_xml) - return bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>')} + bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>') } end end end diff --git a/lib/bandwidth-sdk/models/bxml/verb.rb b/lib/bandwidth-sdk/models/bxml/verb.rb index 03853462..3c90e473 100644 --- a/lib/bandwidth-sdk/models/bxml/verb.rb +++ b/lib/bandwidth-sdk/models/bxml/verb.rb @@ -38,13 +38,13 @@ def generate_xml end end - return root + root end # Return BXML representaion of this element # @return [String] The XML element in string format. def to_bxml - return Ox.dump(generate_xml) + Ox.dump(generate_xml) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/conference.rb b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb index 21467422..1b79c950 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/conference.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb @@ -28,4 +28,3 @@ def initialize(name, attributes = {}) end end end - diff --git a/lib/bandwidth-sdk/models/bxml/verbs/gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb index 451d330c..41d4ff33 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb @@ -31,7 +31,7 @@ def initialize(audio_verbs = [], attributes = {}) # @return [String] The XML response in string format. def to_bxml bxml = Ox.dump(generate_xml) - return bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>')} + bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>') } end # Add audio verb/s to the nested verbs array diff --git a/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb index 20cfac35..934ec567 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb @@ -20,7 +20,7 @@ def initialize(text, attributes = {}) # @return [String] The XML response in string format. def to_bxml bxml = Ox.dump(generate_xml) - return bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>')} + bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>') } end end end diff --git a/lib/bandwidth-sdk/models/call_direction_enum.rb b/lib/bandwidth-sdk/models/call_direction_enum.rb index 99e202e1..b5d4913d 100644 --- a/lib/bandwidth-sdk/models/call_direction_enum.rb +++ b/lib/bandwidth-sdk/models/call_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/call_recording_metadata.rb b/lib/bandwidth-sdk/models/call_recording_metadata.rb index f57f3961..10a93a08 100644 --- a/lib/bandwidth-sdk/models/call_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/call_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -405,7 +405,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/call_state.rb b/lib/bandwidth-sdk/models/call_state.rb index a8bb28db..1c3dd149 100644 --- a/lib/bandwidth-sdk/models/call_state.rb +++ b/lib/bandwidth-sdk/models/call_state.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -27,7 +27,7 @@ class CallState # The A-leg call id, set only if this call is the B-leg of a [``](/docs/voice/bxml/transfer). attr_accessor :parent_call_id - # The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI + # The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI. attr_accessor :to # The phone number that made the call, in E.164 format (e.g. +15555555555). @@ -38,7 +38,7 @@ class CallState # The current state of the call. Current possible values are `queued`, `initiated`, `answered` and `disconnected`. Additional states may be added in the future, so your application must be tolerant of unknown values. attr_accessor :state - # For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken) + # For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). attr_accessor :stir_shaken # The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header. @@ -417,7 +417,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/call_state_enum.rb b/lib/bandwidth-sdk/models/call_state_enum.rb index 7a2bc37d..5671ca9b 100644 --- a/lib/bandwidth-sdk/models/call_state_enum.rb +++ b/lib/bandwidth-sdk/models/call_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/callback_method_enum.rb b/lib/bandwidth-sdk/models/callback_method_enum.rb index a020b306..270ba6be 100644 --- a/lib/bandwidth-sdk/models/callback_method_enum.rb +++ b/lib/bandwidth-sdk/models/callback_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/code_request.rb b/lib/bandwidth-sdk/models/code_request.rb index bb640dcd..ca5bc4b1 100644 --- a/lib/bandwidth-sdk/models/code_request.rb +++ b/lib/bandwidth-sdk/models/code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -421,7 +421,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/conference.rb b/lib/bandwidth-sdk/models/conference.rb index aed5bc33..49e842be 100644 --- a/lib/bandwidth-sdk/models/conference.rb +++ b/lib/bandwidth-sdk/models/conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -15,10 +15,10 @@ module Bandwidth class Conference - # The Bandwidth-generated conference ID + # The Bandwidth-generated conference ID. attr_accessor :id - # The name of the conference, as specified by your application + # The name of the conference, as specified by your application. attr_accessor :name # The time the conference was initiated, in ISO 8601 format. @@ -35,7 +35,7 @@ class Conference # The custom string attached to the conference that will be sent with callbacks. attr_accessor :tag - # 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) + # 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). attr_accessor :active_members class EnumAttributeValidator @@ -314,7 +314,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/conference_completed_callback.rb b/lib/bandwidth-sdk/models/conference_completed_callback.rb index 5d7dfab8..8122d9ef 100644 --- a/lib/bandwidth-sdk/models/conference_completed_callback.rb +++ b/lib/bandwidth-sdk/models/conference_completed_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -256,7 +256,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/conference_created_callback.rb b/lib/bandwidth-sdk/models/conference_created_callback.rb index 5c571956..97acf102 100644 --- a/lib/bandwidth-sdk/models/conference_created_callback.rb +++ b/lib/bandwidth-sdk/models/conference_created_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -256,7 +256,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/conference_member.rb b/lib/bandwidth-sdk/models/conference_member.rb index 7d3c9fea..21d99121 100644 --- a/lib/bandwidth-sdk/models/conference_member.rb +++ b/lib/bandwidth-sdk/models/conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -267,7 +267,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb index d3e8aa76..a1e0fbfc 100644 --- a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -286,7 +286,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/conference_member_join_callback.rb b/lib/bandwidth-sdk/models/conference_member_join_callback.rb index 68e9e036..4280fd41 100644 --- a/lib/bandwidth-sdk/models/conference_member_join_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_join_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -286,7 +286,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb index 67187040..ecf69bd5 100644 --- a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -368,7 +368,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/conference_recording_metadata.rb b/lib/bandwidth-sdk/models/conference_recording_metadata.rb index bbd037cb..ce7db7af 100644 --- a/lib/bandwidth-sdk/models/conference_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/conference_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -336,7 +336,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/conference_redirect_callback.rb b/lib/bandwidth-sdk/models/conference_redirect_callback.rb index a88d5f45..e22e745a 100644 --- a/lib/bandwidth-sdk/models/conference_redirect_callback.rb +++ b/lib/bandwidth-sdk/models/conference_redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -256,7 +256,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/conference_state_enum.rb b/lib/bandwidth-sdk/models/conference_state_enum.rb index 75b2e8f8..c4a7c846 100644 --- a/lib/bandwidth-sdk/models/conference_state_enum.rb +++ b/lib/bandwidth-sdk/models/conference_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/create_call.rb b/lib/bandwidth-sdk/models/create_call.rb index 61b698d6..e58fcb08 100644 --- a/lib/bandwidth-sdk/models/create_call.rb +++ b/lib/bandwidth-sdk/models/create_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -15,7 +15,7 @@ module Bandwidth class CreateCall - # The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.com`)). + # The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). attr_accessor :to # 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`). @@ -27,7 +27,7 @@ class CreateCall # The id of the application associated with the `from` number. attr_accessor :application_id - # 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` + # 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`. attr_accessor :answer_url attr_accessor :answer_method @@ -38,7 +38,7 @@ class CreateCall # Basic auth password. attr_accessor :password - # 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` + # 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`. attr_accessor :answer_fallback_url attr_accessor :answer_fallback_method @@ -341,6 +341,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "priority", must be greater than or equal to 1.') end + if !@tag.nil? && @tag.to_s.length > 256 + invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 256.') + end + invalid_properties end @@ -364,6 +368,7 @@ def valid? return false if !@callback_timeout.nil? && @callback_timeout < 1 return false if !@priority.nil? && @priority > 5 return false if !@priority.nil? && @priority < 1 + return false if !@tag.nil? && @tag.to_s.length > 256 true end @@ -486,6 +491,10 @@ def priority=(priority) # Custom attribute writer method with validation # @param [Object] tag Value to be assigned def tag=(tag) + if !tag.nil? && tag.to_s.length > 256 + fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 256.' + end + @tag = tag end @@ -645,7 +654,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/create_call_response.rb b/lib/bandwidth-sdk/models/create_call_response.rb index 1606f372..57b03e1f 100644 --- a/lib/bandwidth-sdk/models/create_call_response.rb +++ b/lib/bandwidth-sdk/models/create_call_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -18,22 +18,22 @@ class CreateCallResponse # The id of the application associated with the `from` number. attr_accessor :application_id - # The bandwidth account ID associated with the call + # The bandwidth account ID associated with the call. attr_accessor :account_id - # Programmable Voice API Call ID + # Programmable Voice API Call ID. attr_accessor :call_id - # Recipient of the outgoing call + # Recipient of the outgoing call. attr_accessor :to - # Phone number that created the outbound call + # Phone number that created the outbound call. attr_accessor :from - # Time the call was accepted into the queue + # The time at which the call was accepted into the queue. attr_accessor :enqueued_time - # The URL to update call state + # The URL to update this call's state. attr_accessor :call_url # The timeout (in seconds) for the callee to answer the call after it starts ringing. @@ -42,7 +42,7 @@ class CreateCallResponse # This is the timeout (in seconds) to use when delivering webhooks for the call. attr_accessor :callback_timeout - # Custom tag value + # Custom tag value. attr_accessor :tag attr_accessor :answer_method @@ -152,7 +152,7 @@ def self.openapi_types :'password' => :'String', :'fallback_username' => :'String', :'fallback_password' => :'String', - :'priority' => :'Float' + :'priority' => :'Integer' } end @@ -546,7 +546,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/create_lookup_response.rb b/lib/bandwidth-sdk/models/create_lookup_response.rb index c01d7399..377dd43b 100644 --- a/lib/bandwidth-sdk/models/create_lookup_response.rb +++ b/lib/bandwidth-sdk/models/create_lookup_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -246,7 +246,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/create_message_request_error.rb b/lib/bandwidth-sdk/models/create_message_request_error.rb index 97a555b4..06082141 100644 --- a/lib/bandwidth-sdk/models/create_message_request_error.rb +++ b/lib/bandwidth-sdk/models/create_message_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -243,7 +243,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/deferred_result.rb b/lib/bandwidth-sdk/models/deferred_result.rb index 34eb3b44..cf160dd1 100644 --- a/lib/bandwidth-sdk/models/deferred_result.rb +++ b/lib/bandwidth-sdk/models/deferred_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -222,7 +222,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/disconenct_callback.rb b/lib/bandwidth-sdk/models/disconenct_callback.rb index 1af058a7..5578eb0f 100644 --- a/lib/bandwidth-sdk/models/disconenct_callback.rb +++ b/lib/bandwidth-sdk/models/disconenct_callback.rb @@ -401,7 +401,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/disconnect_callback.rb b/lib/bandwidth-sdk/models/disconnect_callback.rb index 709d5e07..38c2d5df 100644 --- a/lib/bandwidth-sdk/models/disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/disconnect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -401,7 +401,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/diversion.rb b/lib/bandwidth-sdk/models/diversion.rb index c9a9c1a1..7eca346f 100644 --- a/lib/bandwidth-sdk/models/diversion.rb +++ b/lib/bandwidth-sdk/models/diversion.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -274,7 +274,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/dtmf_callback.rb b/lib/bandwidth-sdk/models/dtmf_callback.rb index d219ba28..0a47cc40 100644 --- a/lib/bandwidth-sdk/models/dtmf_callback.rb +++ b/lib/bandwidth-sdk/models/dtmf_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -399,7 +399,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/field_error.rb b/lib/bandwidth-sdk/models/field_error.rb index 876d2fd1..925a67c3 100644 --- a/lib/bandwidth-sdk/models/field_error.rb +++ b/lib/bandwidth-sdk/models/field_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -224,7 +224,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/file_format_enum.rb b/lib/bandwidth-sdk/models/file_format_enum.rb index 6a03c2a8..6ff3c424 100644 --- a/lib/bandwidth-sdk/models/file_format_enum.rb +++ b/lib/bandwidth-sdk/models/file_format_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/gather_callback.rb b/lib/bandwidth-sdk/models/gather_callback.rb index 629e0c5b..85712493 100644 --- a/lib/bandwidth-sdk/models/gather_callback.rb +++ b/lib/bandwidth-sdk/models/gather_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -409,7 +409,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/inbound_message_callback.rb b/lib/bandwidth-sdk/models/inbound_message_callback.rb index 8e6d7e26..7151f2ee 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -275,7 +275,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb index 6cb22057..718f48e2 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -14,6 +14,7 @@ require 'time' module Bandwidth + # Inbound Message Callback Message Schema class InboundMessageCallbackMessage attr_accessor :id @@ -393,7 +394,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/initiate_callback.rb b/lib/bandwidth-sdk/models/initiate_callback.rb index 917d552f..cc6196f5 100644 --- a/lib/bandwidth-sdk/models/initiate_callback.rb +++ b/lib/bandwidth-sdk/models/initiate_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -344,7 +344,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/list_message_direction_enum.rb b/lib/bandwidth-sdk/models/list_message_direction_enum.rb index af6c902d..c27dd165 100644 --- a/lib/bandwidth-sdk/models/list_message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/list_message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/list_message_item.rb b/lib/bandwidth-sdk/models/list_message_item.rb index 19d17c4a..788f143d 100644 --- a/lib/bandwidth-sdk/models/list_message_item.rb +++ b/lib/bandwidth-sdk/models/list_message_item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -60,6 +60,9 @@ class ListMessageItem # The campaign class of the message if it has one. attr_accessor :campaign_class + # The campaign ID of the message if it has one. + attr_accessor :campaign_id + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -100,7 +103,8 @@ def self.attribute_map :'message_length' => :'messageLength', :'attachment_count' => :'attachmentCount', :'recipient_count' => :'recipientCount', - :'campaign_class' => :'campaignClass' + :'campaign_class' => :'campaignClass', + :'campaign_id' => :'campaignId' } end @@ -127,7 +131,8 @@ def self.openapi_types :'message_length' => :'Integer', :'attachment_count' => :'Integer', :'recipient_count' => :'Integer', - :'campaign_class' => :'String' + :'campaign_class' => :'String', + :'campaign_id' => :'String' } end @@ -138,7 +143,8 @@ def self.openapi_nullable :'message_size', :'attachment_count', :'recipient_count', - :'campaign_class' + :'campaign_class', + :'campaign_id' ]) end @@ -220,6 +226,10 @@ def initialize(attributes = {}) if attributes.key?(:'campaign_class') self.campaign_class = attributes[:'campaign_class'] end + + if attributes.key?(:'campaign_id') + self.campaign_id = attributes[:'campaign_id'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -255,7 +265,8 @@ def ==(o) message_length == o.message_length && attachment_count == o.attachment_count && recipient_count == o.recipient_count && - campaign_class == o.campaign_class + campaign_class == o.campaign_class && + campaign_id == o.campaign_id end # @see the `==` method @@ -267,7 +278,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [message_id, account_id, source_tn, destination_tn, message_status, message_direction, message_type, segment_count, error_code, receive_time, carrier_name, message_size, message_length, attachment_count, recipient_count, campaign_class].hash + [message_id, account_id, source_tn, destination_tn, message_status, message_direction, message_type, segment_count, error_code, receive_time, carrier_name, message_size, message_length, attachment_count, recipient_count, campaign_class, campaign_id].hash end # Builds the object from hash @@ -388,7 +399,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/lookup_request.rb b/lib/bandwidth-sdk/models/lookup_request.rb index ae53d6e6..32816f65 100644 --- a/lib/bandwidth-sdk/models/lookup_request.rb +++ b/lib/bandwidth-sdk/models/lookup_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -221,7 +221,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/lookup_result.rb b/lib/bandwidth-sdk/models/lookup_result.rb index 8a48c789..8daf5811 100644 --- a/lib/bandwidth-sdk/models/lookup_result.rb +++ b/lib/bandwidth-sdk/models/lookup_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -295,7 +295,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/lookup_status.rb b/lib/bandwidth-sdk/models/lookup_status.rb index f28cc929..0cde0b18 100644 --- a/lib/bandwidth-sdk/models/lookup_status.rb +++ b/lib/bandwidth-sdk/models/lookup_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -270,7 +270,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/lookup_status_enum.rb b/lib/bandwidth-sdk/models/lookup_status_enum.rb index f072637f..551dcbb1 100644 --- a/lib/bandwidth-sdk/models/lookup_status_enum.rb +++ b/lib/bandwidth-sdk/models/lookup_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb index ccfa56dd..d547a398 100644 --- a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +++ b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -54,7 +54,6 @@ class MachineDetectionCompleteCallback # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. attr_accessor :tag - # (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete attr_accessor :machine_detection_result class EnumAttributeValidator @@ -120,7 +119,7 @@ def self.openapi_types :'start_time' => :'Time', :'answer_time' => :'Time', :'tag' => :'String', - :'machine_detection_result' => :'String' + :'machine_detection_result' => :'MachineDetectionResult' } end @@ -370,7 +369,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/machine_detection_configuration.rb b/lib/bandwidth-sdk/models/machine_detection_configuration.rb index 132c538b..c1387aab 100644 --- a/lib/bandwidth-sdk/models/machine_detection_configuration.rb +++ b/lib/bandwidth-sdk/models/machine_detection_configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -494,7 +494,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb index 802fe3cd..e710f175 100644 --- a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +++ b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/machine_detection_result.rb b/lib/bandwidth-sdk/models/machine_detection_result.rb new file mode 100644 index 00000000..c363568d --- /dev/null +++ b/lib/bandwidth-sdk/models/machine_detection_result.rb @@ -0,0 +1,229 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete + class MachineDetectionResult + # Possible values are answering-machine, human, silence, timeout, or error. + attr_accessor :value + + # The amount of time it took to determine the result. + attr_accessor :duration + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'value' => :'value', + :'duration' => :'duration' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'value' => :'String', + :'duration' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MachineDetectionResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MachineDetectionResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + value == o.value && + duration == o.duration + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [value, duration].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/bandwidth-sdk/models/media.rb b/lib/bandwidth-sdk/models/media.rb index 9aa24732..c2f7abee 100644 --- a/lib/bandwidth-sdk/models/media.rb +++ b/lib/bandwidth-sdk/models/media.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -231,7 +231,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/message.rb b/lib/bandwidth-sdk/models/message.rb index d303fc1c..e305ae24 100644 --- a/lib/bandwidth-sdk/models/message.rb +++ b/lib/bandwidth-sdk/models/message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -370,7 +370,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/message_delivered_callback.rb b/lib/bandwidth-sdk/models/message_delivered_callback.rb index 752fb90e..6a268f8b 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -275,7 +275,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb index 4b06606c..b33f941f 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -14,6 +14,7 @@ require 'time' module Bandwidth + # Message Delivered Callback Message Schema class MessageDeliveredCallbackMessage attr_accessor :id @@ -398,7 +399,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/message_direction_enum.rb b/lib/bandwidth-sdk/models/message_direction_enum.rb index 965101fb..fc8e6e78 100644 --- a/lib/bandwidth-sdk/models/message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/message_failed_callback.rb b/lib/bandwidth-sdk/models/message_failed_callback.rb index 6a625401..7ce6b4ba 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -289,7 +289,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/message_failed_callback_message.rb b/lib/bandwidth-sdk/models/message_failed_callback_message.rb index d4a02732..fb96be91 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -14,6 +14,7 @@ require 'time' module Bandwidth + # Message Failed Callback Message Schema class MessageFailedCallbackMessage attr_accessor :id @@ -403,7 +404,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/message_request.rb b/lib/bandwidth-sdk/models/message_request.rb index e8c9b852..b0ea2ee6 100644 --- a/lib/bandwidth-sdk/models/message_request.rb +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -35,7 +35,7 @@ class MessageRequest attr_accessor :priority - # A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. + # A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. attr_accessor :expiration class EnumAttributeValidator @@ -349,7 +349,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/message_sending_callback.rb b/lib/bandwidth-sdk/models/message_sending_callback.rb index 9ae222b8..05ba3534 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -275,7 +275,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/message_sending_callback_message.rb b/lib/bandwidth-sdk/models/message_sending_callback_message.rb index a0dd2f68..a44fd681 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -14,6 +14,7 @@ require 'time' module Bandwidth + # Message Sending Callback Message Schema class MessageSendingCallbackMessage attr_accessor :id @@ -403,7 +404,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/message_status_enum.rb b/lib/bandwidth-sdk/models/message_status_enum.rb index 6d28b8d4..b01d6701 100644 --- a/lib/bandwidth-sdk/models/message_status_enum.rb +++ b/lib/bandwidth-sdk/models/message_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/message_type_enum.rb b/lib/bandwidth-sdk/models/message_type_enum.rb index 7275033b..df3739f1 100644 --- a/lib/bandwidth-sdk/models/message_type_enum.rb +++ b/lib/bandwidth-sdk/models/message_type_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/messages_list.rb b/lib/bandwidth-sdk/models/messages_list.rb index 7f296a0e..e77933c9 100644 --- a/lib/bandwidth-sdk/models/messages_list.rb +++ b/lib/bandwidth-sdk/models/messages_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -234,7 +234,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/messaging_code_response.rb b/lib/bandwidth-sdk/models/messaging_code_response.rb index 5d3c6a0b..4de4545f 100644 --- a/lib/bandwidth-sdk/models/messaging_code_response.rb +++ b/lib/bandwidth-sdk/models/messaging_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -214,7 +214,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/messaging_request_error.rb b/lib/bandwidth-sdk/models/messaging_request_error.rb index ea01bf8b..9435cf16 100644 --- a/lib/bandwidth-sdk/models/messaging_request_error.rb +++ b/lib/bandwidth-sdk/models/messaging_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -232,7 +232,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb index e5ee3b65..5fbf0b4b 100644 --- a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -214,7 +214,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/mfa_request_error.rb b/lib/bandwidth-sdk/models/mfa_request_error.rb index d04bc73d..3bcc54ed 100644 --- a/lib/bandwidth-sdk/models/mfa_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -224,7 +224,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb index 17cde720..10d28dd4 100644 --- a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -214,7 +214,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/page_info.rb b/lib/bandwidth-sdk/models/page_info.rb index 794dbbe5..38d644bd 100644 --- a/lib/bandwidth-sdk/models/page_info.rb +++ b/lib/bandwidth-sdk/models/page_info.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -244,7 +244,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/priority_enum.rb b/lib/bandwidth-sdk/models/priority_enum.rb index 2e7f81a8..ff61ccef 100644 --- a/lib/bandwidth-sdk/models/priority_enum.rb +++ b/lib/bandwidth-sdk/models/priority_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/recording_available_callback.rb b/lib/bandwidth-sdk/models/recording_available_callback.rb index c6e3209b..30097cb0 100644 --- a/lib/bandwidth-sdk/models/recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -448,7 +448,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/recording_complete_callback.rb b/lib/bandwidth-sdk/models/recording_complete_callback.rb index 2a02da71..31dd1ecc 100644 --- a/lib/bandwidth-sdk/models/recording_complete_callback.rb +++ b/lib/bandwidth-sdk/models/recording_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -449,7 +449,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/recording_state_enum.rb b/lib/bandwidth-sdk/models/recording_state_enum.rb index f55244d0..7eddc212 100644 --- a/lib/bandwidth-sdk/models/recording_state_enum.rb +++ b/lib/bandwidth-sdk/models/recording_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/redirect_callback.rb b/lib/bandwidth-sdk/models/redirect_callback.rb index 894710b1..bed4bace 100644 --- a/lib/bandwidth-sdk/models/redirect_callback.rb +++ b/lib/bandwidth-sdk/models/redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -389,7 +389,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/redirect_method_enum.rb b/lib/bandwidth-sdk/models/redirect_method_enum.rb index 1ba4176c..eed11b06 100644 --- a/lib/bandwidth-sdk/models/redirect_method_enum.rb +++ b/lib/bandwidth-sdk/models/redirect_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end diff --git a/lib/bandwidth-sdk/models/stir_shaken.rb b/lib/bandwidth-sdk/models/stir_shaken.rb index 1ec06f5c..449873ff 100644 --- a/lib/bandwidth-sdk/models/stir_shaken.rb +++ b/lib/bandwidth-sdk/models/stir_shaken.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -234,7 +234,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/tag.rb b/lib/bandwidth-sdk/models/tag.rb index fec73411..92a0edf6 100644 --- a/lib/bandwidth-sdk/models/tag.rb +++ b/lib/bandwidth-sdk/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -222,7 +222,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb index b43d53e2..9a15ba74 100644 --- a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +++ b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -214,7 +214,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/transcribe_recording.rb b/lib/bandwidth-sdk/models/transcribe_recording.rb index 93dd4228..9cf464e7 100644 --- a/lib/bandwidth-sdk/models/transcribe_recording.rb +++ b/lib/bandwidth-sdk/models/transcribe_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -32,6 +32,9 @@ class TranscribeRecording # This is the timeout (in seconds) to use when delivering the webhook to `callbackUrl`. Can be any numeric value (including decimals) between 1 and 25. attr_accessor :callback_timeout + # A boolean value to indicate that the recording may not be in English, and the transcription service will need to detect the dominant language the recording is in and transcribe accordingly. Current supported languages are English, French, and Spanish. + attr_accessor :detect_language + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -62,7 +65,8 @@ def self.attribute_map :'username' => :'username', :'password' => :'password', :'tag' => :'tag', - :'callback_timeout' => :'callbackTimeout' + :'callback_timeout' => :'callbackTimeout', + :'detect_language' => :'detectLanguage' } end @@ -79,7 +83,8 @@ def self.openapi_types :'username' => :'String', :'password' => :'String', :'tag' => :'String', - :'callback_timeout' => :'Float' + :'callback_timeout' => :'Float', + :'detect_language' => :'Boolean' } end @@ -90,7 +95,8 @@ def self.openapi_nullable :'username', :'password', :'tag', - :'callback_timeout' + :'callback_timeout', + :'detect_language' ]) end @@ -136,6 +142,12 @@ def initialize(attributes = {}) else self.callback_timeout = 15 end + + if attributes.key?(:'detect_language') + self.detect_language = attributes[:'detect_language'] + else + self.detect_language = false + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -215,7 +227,8 @@ def ==(o) username == o.username && password == o.password && tag == o.tag && - callback_timeout == o.callback_timeout + callback_timeout == o.callback_timeout && + detect_language == o.detect_language end # @see the `==` method @@ -227,7 +240,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [callback_url, callback_method, username, password, tag, callback_timeout].hash + [callback_url, callback_method, username, password, tag, callback_timeout, detect_language].hash end # Builds the object from hash @@ -348,7 +361,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/transcription.rb b/lib/bandwidth-sdk/models/transcription.rb index 31c8eef2..ce20b294 100644 --- a/lib/bandwidth-sdk/models/transcription.rb +++ b/lib/bandwidth-sdk/models/transcription.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -224,7 +224,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/transcription_available_callback.rb b/lib/bandwidth-sdk/models/transcription_available_callback.rb index 600175f0..604c243a 100644 --- a/lib/bandwidth-sdk/models/transcription_available_callback.rb +++ b/lib/bandwidth-sdk/models/transcription_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -437,7 +437,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/transcription_list.rb b/lib/bandwidth-sdk/models/transcription_list.rb index 4c5d28a1..21bf91d6 100644 --- a/lib/bandwidth-sdk/models/transcription_list.rb +++ b/lib/bandwidth-sdk/models/transcription_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -215,7 +215,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/transcription_metadata.rb b/lib/bandwidth-sdk/models/transcription_metadata.rb index 97ccd20c..9004130f 100644 --- a/lib/bandwidth-sdk/models/transcription_metadata.rb +++ b/lib/bandwidth-sdk/models/transcription_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -245,7 +245,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/transfer_answer_callback.rb b/lib/bandwidth-sdk/models/transfer_answer_callback.rb index cb86dde4..86af37fb 100644 --- a/lib/bandwidth-sdk/models/transfer_answer_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -379,7 +379,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/transfer_complete_callback.rb b/lib/bandwidth-sdk/models/transfer_complete_callback.rb index 9ddc2bba..ecc9909b 100644 --- a/lib/bandwidth-sdk/models/transfer_complete_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -411,7 +411,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb index b1227953..d1c14b42 100644 --- a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -431,7 +431,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/update_call.rb b/lib/bandwidth-sdk/models/update_call.rb index 85b0f7e7..7139de5e 100644 --- a/lib/bandwidth-sdk/models/update_call.rb +++ b/lib/bandwidth-sdk/models/update_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -28,7 +28,7 @@ class UpdateCall # Basic auth password. attr_accessor :password - # A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond + # A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond. attr_accessor :redirect_fallback_url attr_accessor :redirect_fallback_method @@ -199,6 +199,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "fallback_password", the character length must be smaller than or equal to 1024.') end + if !@tag.nil? && @tag.to_s.length > 256 + invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 256.') + end + invalid_properties end @@ -209,6 +213,7 @@ def valid? return false if !@password.nil? && @password.to_s.length > 1024 return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 return false if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 + return false if !@tag.nil? && @tag.to_s.length > 256 true end @@ -255,6 +260,10 @@ def fallback_password=(fallback_password) # Custom attribute writer method with validation # @param [Object] tag Value to be assigned def tag=(tag) + if !tag.nil? && tag.to_s.length > 256 + fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 256.' + end + @tag = tag end @@ -405,7 +414,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/update_call_recording.rb b/lib/bandwidth-sdk/models/update_call_recording.rb index b7303af5..ce44c013 100644 --- a/lib/bandwidth-sdk/models/update_call_recording.rb +++ b/lib/bandwidth-sdk/models/update_call_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -240,7 +240,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/update_conference.rb b/lib/bandwidth-sdk/models/update_conference.rb index 170efb70..a2c321c9 100644 --- a/lib/bandwidth-sdk/models/update_conference.rb +++ b/lib/bandwidth-sdk/models/update_conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -17,7 +17,7 @@ module Bandwidth class UpdateConference attr_accessor :status - # 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` + # 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`. attr_accessor :redirect_url attr_accessor :redirect_method @@ -388,7 +388,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/update_conference_member.rb b/lib/bandwidth-sdk/models/update_conference_member.rb index 641e18de..85ef734b 100644 --- a/lib/bandwidth-sdk/models/update_conference_member.rb +++ b/lib/bandwidth-sdk/models/update_conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -237,7 +237,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/verify_code_request.rb b/lib/bandwidth-sdk/models/verify_code_request.rb index eace3f2b..1b69bc9d 100644 --- a/lib/bandwidth-sdk/models/verify_code_request.rb +++ b/lib/bandwidth-sdk/models/verify_code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -336,7 +336,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/verify_code_response.rb b/lib/bandwidth-sdk/models/verify_code_response.rb index 5d53c3f5..537f6f2b 100644 --- a/lib/bandwidth-sdk/models/verify_code_response.rb +++ b/lib/bandwidth-sdk/models/verify_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -214,7 +214,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/voice_api_error.rb b/lib/bandwidth-sdk/models/voice_api_error.rb index c30cbc77..426b37ae 100644 --- a/lib/bandwidth-sdk/models/voice_api_error.rb +++ b/lib/bandwidth-sdk/models/voice_api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -232,7 +232,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/models/voice_code_response.rb b/lib/bandwidth-sdk/models/voice_code_response.rb index d19aba3f..36d1cd16 100644 --- a/lib/bandwidth-sdk/models/voice_code_response.rb +++ b/lib/bandwidth-sdk/models/voice_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end @@ -214,7 +214,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/bandwidth-sdk/version.rb b/lib/bandwidth-sdk/version.rb index 0c910fe2..6ff7a18f 100644 --- a/lib/bandwidth-sdk/version.rb +++ b/lib/bandwidth-sdk/version.rb @@ -6,10 +6,10 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.5.0 =end module Bandwidth - VERSION = '11.0.0.pre.beta.1.1' + VERSION = ENV.fetch("GEM_VERSION") end diff --git a/openapi-config.yml b/openapi-config.yml index c4fa47e0..c19e56ee 100644 --- a/openapi-config.yml +++ b/openapi-config.yml @@ -9,3 +9,4 @@ gemSummary: Bandwidth Ruby SDK gemVersion: 11.0.0 library: faraday moduleName: Bandwidth +templateDir: custom_templates diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 00000000..a3883a34 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "6.5.0" + } +} diff --git a/spec/unit/api/calls_api_spec.rb b/spec/api/calls_api_spec.rb similarity index 76% rename from spec/unit/api/calls_api_spec.rb rename to spec/api/calls_api_spec.rb index 65a8247d..03269930 100644 --- a/spec/unit/api/calls_api_spec.rb +++ b/spec/api/calls_api_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' # Unit tests for Bandwidth::CallsApi @@ -35,54 +35,54 @@ # unit tests for create_call # Create Call # Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. <b>Please note:</b> Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed. - # @param account_id Your Bandwidth Account ID + # @param account_id Your Bandwidth Account ID. # @param create_call JSON object containing information to create an outbound call # @param [Hash] opts the optional parameters # @return [CreateCallResponse] describe 'create_call test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for get_call_state # Get Call State Information # Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: 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 HTTP 404 response. - # @param account_id Your Bandwidth Account ID - # @param call_id Programmable Voice API Call ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. # @param [Hash] opts the optional parameters # @return [CallState] describe 'get_call_state test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for update_call # Update Call # Interrupts and redirects a call to a different URL that should return a BXML document. - # @param account_id Your Bandwidth Account ID - # @param call_id Programmable Voice API Call ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. # @param update_call JSON object containing information to redirect an existing call to a new BXML document # @param [Hash] opts the optional parameters # @return [nil] describe 'update_call test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for update_call_bxml # Update Call BXML # Interrupts and replaces an active call's BXML document. - # @param account_id Your Bandwidth Account ID - # @param call_id Programmable Voice API Call ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. # @param body # @param [Hash] opts the optional parameters # @return [nil] describe 'update_call_bxml test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/api/conferences_api_spec.rb b/spec/api/conferences_api_spec.rb similarity index 69% rename from spec/unit/api/conferences_api_spec.rb rename to spec/api/conferences_api_spec.rb index 8c2704b4..50be2b84 100644 --- a/spec/unit/api/conferences_api_spec.rb +++ b/spec/api/conferences_api_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' # Unit tests for Bandwidth::ConferencesApi @@ -35,75 +35,75 @@ # unit tests for download_conference_recording # Download Conference Recording # Downloads the specified recording file. - # @param account_id Your Bandwidth Account ID - # @param conference_id Programmable Voice API Conference ID - # @param recording_id Programmable Voice API Recording ID + # @param account_id Your Bandwidth Account ID. + # @param conference_id Programmable Voice API Conference ID. + # @param recording_id Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [File] describe 'download_conference_recording test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for get_conference # Get Conference Information # Returns information about the specified conference. - # @param account_id Your Bandwidth Account ID - # @param conference_id Programmable Voice API Conference ID + # @param account_id Your Bandwidth Account ID. + # @param conference_id Programmable Voice API Conference ID. # @param [Hash] opts the optional parameters # @return [Conference] describe 'get_conference test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for get_conference_member # Get Conference Member # Returns information about the specified conference member. - # @param account_id Your Bandwidth Account ID - # @param conference_id Programmable Voice API Conference ID - # @param member_id Programmable Voice API Conference Member ID + # @param account_id Your Bandwidth Account ID. + # @param conference_id Programmable Voice API Conference ID. + # @param member_id Programmable Voice API Conference Member ID. # @param [Hash] opts the optional parameters # @return [ConferenceMember] describe 'get_conference_member test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for get_conference_recording # Get Conference Recording Information # Returns metadata for the specified recording. - # @param account_id Your Bandwidth Account ID - # @param conference_id Programmable Voice API Conference ID - # @param recording_id Programmable Voice API Recording ID + # @param account_id Your Bandwidth Account ID. + # @param conference_id Programmable Voice API Conference ID. + # @param recording_id Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [ConferenceRecordingMetadata] describe 'get_conference_recording test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for list_conference_recordings # Get Conference Recordings # Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. - # @param account_id Your Bandwidth Account ID - # @param conference_id Programmable Voice API Conference ID + # @param account_id Your Bandwidth Account ID. + # @param conference_id Programmable Voice API Conference ID. # @param [Hash] opts the optional parameters # @return [Array] describe 'list_conference_recordings test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for list_conferences # Get Conferences # Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences 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 conference records. - # @param account_id Your Bandwidth Account ID + # @param account_id Your Bandwidth Account ID. # @param [Hash] opts the optional parameters # @option opts [String] :name Filter results by the `name` field. # @option opts [String] :min_created_time Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). @@ -113,50 +113,50 @@ # @return [Array] describe 'list_conferences test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for update_conference # Update Conference # Update the conference state. - # @param account_id Your Bandwidth Account ID - # @param conference_id Programmable Voice API Conference ID + # @param account_id Your Bandwidth Account ID. + # @param conference_id Programmable Voice API Conference ID. # @param update_conference # @param [Hash] opts the optional parameters # @return [nil] describe 'update_conference test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for update_conference_bxml # Update Conference BXML # Update the conference BXML document. - # @param account_id Your Bandwidth Account ID - # @param conference_id Programmable Voice API Conference ID + # @param account_id Your Bandwidth Account ID. + # @param conference_id Programmable Voice API Conference ID. # @param body # @param [Hash] opts the optional parameters # @return [nil] describe 'update_conference_bxml test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for update_conference_member # Update Conference Member # Updates settings for a particular conference member. - # @param account_id Your Bandwidth Account ID - # @param conference_id Programmable Voice API Conference ID - # @param member_id Programmable Voice API Conference Member ID + # @param account_id Your Bandwidth Account ID. + # @param conference_id Programmable Voice API Conference ID. + # @param member_id Programmable Voice API Conference Member ID. # @param update_conference_member # @param [Hash] opts the optional parameters # @return [nil] describe 'update_conference_member test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/api/media_api_spec.rb b/spec/api/media_api_spec.rb similarity index 86% rename from spec/unit/api/media_api_spec.rb rename to spec/api/media_api_spec.rb index bcce6825..550cdf49 100644 --- a/spec/unit/api/media_api_spec.rb +++ b/spec/api/media_api_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' # Unit tests for Bandwidth::MediaApi @@ -41,7 +41,7 @@ # @return [nil] describe 'delete_media test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -54,7 +54,7 @@ # @return [File] describe 'get_media test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -67,7 +67,7 @@ # @return [Array] describe 'list_media test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -83,7 +83,7 @@ # @return [nil] describe 'upload_media test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/api/messages_api_spec.rb b/spec/api/messages_api_spec.rb similarity index 92% rename from spec/unit/api/messages_api_spec.rb rename to spec/api/messages_api_spec.rb index cfab1b53..c9846a39 100644 --- a/spec/unit/api/messages_api_spec.rb +++ b/spec/api/messages_api_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' # Unit tests for Bandwidth::MessagesApi @@ -41,7 +41,7 @@ # @return [Message] describe 'create_message test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -60,13 +60,14 @@ # @option opts [Integer] :error_code The error code of the message. # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :campaign_id The campaign ID of the message. # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. # @option opts [String] :page_token A base64 encoded value used for pagination of results. # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. # @return [MessagesList] describe 'list_messages test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/api/mfa_api_spec.rb b/spec/api/mfa_api_spec.rb similarity index 73% rename from spec/unit/api/mfa_api_spec.rb rename to spec/api/mfa_api_spec.rb index 8a91d522..9d688c03 100644 --- a/spec/unit/api/mfa_api_spec.rb +++ b/spec/api/mfa_api_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' # Unit tests for Bandwidth::MFAApi @@ -35,39 +35,39 @@ # unit tests for generate_messaging_code # Messaging Authentication Code # Send an MFA code via text message (SMS). - # @param account_id Bandwidth Account ID with Voice service enabled. + # @param account_id Your Bandwidth Account ID. # @param code_request MFA code request body. # @param [Hash] opts the optional parameters # @return [MessagingCodeResponse] describe 'generate_messaging_code test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for generate_voice_code # Voice Authentication Code # Send an MFA Code via a phone call. - # @param account_id Bandwidth Account ID with Voice service enabled. + # @param account_id Your Bandwidth Account ID. # @param code_request MFA code request body. # @param [Hash] opts the optional parameters # @return [VoiceCodeResponse] describe 'generate_voice_code test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for verify_code # Verify Authentication Code # Verify a previously sent MFA code. - # @param account_id Bandwidth Account ID with Voice service enabled. + # @param account_id Your Bandwidth Account ID. # @param verify_code_request MFA code verify request body. # @param [Hash] opts the optional parameters # @return [VerifyCodeResponse] describe 'verify_code test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/api/phone_number_lookup_api_spec.rb b/spec/api/phone_number_lookup_api_spec.rb similarity index 76% rename from spec/unit/api/phone_number_lookup_api_spec.rb rename to spec/api/phone_number_lookup_api_spec.rb index 3c65d73f..0d736f05 100644 --- a/spec/unit/api/phone_number_lookup_api_spec.rb +++ b/spec/api/phone_number_lookup_api_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' # Unit tests for Bandwidth::PhoneNumberLookupApi @@ -35,26 +35,26 @@ # unit tests for create_lookup # Create Lookup # Create a Phone Number Lookup Request. - # @param account_id The ID of the Bandwidth account that the user belongs to. + # @param account_id Your Bandwidth Account ID. # @param lookup_request Phone number lookup request. # @param [Hash] opts the optional parameters # @return [CreateLookupResponse] describe 'create_lookup test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for get_lookup_status # Get Lookup Request Status # Get an existing Phone Number Lookup Request. - # @param account_id The ID of the Bandwidth account that the user belongs to. + # @param account_id Your Bandwidth Account ID. # @param request_id The phone number lookup request ID from Bandwidth. # @param [Hash] opts the optional parameters # @return [LookupStatus] describe 'get_lookup_status test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/api/recordings_api_spec.rb b/spec/api/recordings_api_spec.rb similarity index 69% rename from spec/unit/api/recordings_api_spec.rb rename to spec/api/recordings_api_spec.rb index 8b3158c8..7fdecc26 100644 --- a/spec/unit/api/recordings_api_spec.rb +++ b/spec/api/recordings_api_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' # Unit tests for Bandwidth::RecordingsApi @@ -35,91 +35,91 @@ # unit tests for delete_call_transcription # Delete Transcription # 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 - # @param call_id Programmable Voice API Call ID - # @param recording_id Programmable Voice API Recording ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. + # @param recording_id Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [nil] describe 'delete_call_transcription test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for delete_recording # Delete Recording # 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 - # @param call_id Programmable Voice API Call ID - # @param recording_id Programmable Voice API Recording ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. + # @param recording_id Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [nil] describe 'delete_recording test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for delete_recording_media # Delete Recording Media # Deletes the specified recording's media. - # @param account_id Your Bandwidth Account ID - # @param call_id Programmable Voice API Call ID - # @param recording_id Programmable Voice API Recording ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. + # @param recording_id Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [nil] describe 'delete_recording_media test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for download_call_recording # Download Recording # Downloads the specified recording. - # @param account_id Your Bandwidth Account ID - # @param call_id Programmable Voice API Call ID - # @param recording_id Programmable Voice API Recording ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. + # @param recording_id Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [File] describe 'download_call_recording test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for get_call_recording # Get Call Recording # Returns metadata for the specified recording. - # @param account_id Your Bandwidth Account ID - # @param call_id Programmable Voice API Call ID - # @param recording_id Programmable Voice API Recording ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. + # @param recording_id Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [CallRecordingMetadata] describe 'get_call_recording test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for get_call_transcription # 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 [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/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 - # @param call_id Programmable Voice API Call ID - # @param recording_id Programmable Voice API Recording ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. + # @param recording_id Programmable Voice API Recording ID. # @param [Hash] opts the optional parameters # @return [TranscriptionList] describe 'get_call_transcription test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for list_account_call_recordings # Get Call Recordings # Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria. - # @param account_id Your Bandwidth Account ID + # @param account_id Your Bandwidth Account ID. # @param [Hash] opts the optional parameters # @option opts [String] :to Filter results by the `to` field. # @option opts [String] :from Filter results by the `from` field. @@ -128,49 +128,49 @@ # @return [Array] describe 'list_account_call_recordings test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for list_call_recordings # List Call Recordings # Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. - # @param account_id Your Bandwidth Account ID - # @param call_id Programmable Voice API Call ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. # @param [Hash] opts the optional parameters # @return [Array] describe 'list_call_recordings test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for transcribe_call_recording # Create Transcription Request # Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. - # @param account_id Your Bandwidth Account ID - # @param call_id Programmable Voice API Call ID - # @param recording_id Programmable Voice API Recording ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. + # @param recording_id Programmable Voice API Recording ID. # @param transcribe_recording # @param [Hash] opts the optional parameters # @return [nil] describe 'transcribe_call_recording test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for update_call_recording_state # Update Recording # Pause or resume a recording on an active phone call. - # @param account_id Your Bandwidth Account ID - # @param call_id Programmable Voice API Call ID + # @param account_id Your Bandwidth Account ID. + # @param call_id Programmable Voice API Call ID. # @param update_call_recording # @param [Hash] opts the optional parameters # @return [nil] describe 'update_call_recording_state test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/api/statistics_api_spec.rb b/spec/api/statistics_api_spec.rb similarity index 82% rename from spec/unit/api/statistics_api_spec.rb rename to spec/api/statistics_api_spec.rb index 65f2e793..2ebf95b1 100644 --- a/spec/unit/api/statistics_api_spec.rb +++ b/spec/api/statistics_api_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' # Unit tests for Bandwidth::StatisticsApi @@ -35,12 +35,12 @@ # unit tests for get_statistics # Get Account Statistics # Returns details about the current state of the account. - # @param account_id Your Bandwidth Account ID + # @param account_id Your Bandwidth Account ID. # @param [Hash] opts the optional parameters # @return [AccountStatistics] describe 'get_statistics test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb new file mode 100644 index 00000000..e771c6a2 --- /dev/null +++ b/spec/api_client_spec.rb @@ -0,0 +1,223 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0 + +=end + + + +describe Bandwidth::ApiClient do + context 'initialization' do + context 'URL stuff' do + context 'host' do + it 'removes http from host' do + Bandwidth.configure { |c| c.host = 'http://example.com' } + expect(Bandwidth::Configuration.default.host).to eq('example.com') + end + + it 'removes https from host' do + Bandwidth.configure { |c| c.host = 'https://wookiee.com' } + expect(Bandwidth::ApiClient.default.config.host).to eq('wookiee.com') + end + + it 'removes trailing path from host' do + Bandwidth.configure { |c| c.host = 'hobo.com/v4' } + expect(Bandwidth::Configuration.default.host).to eq('hobo.com') + end + end + + context 'base_path' do + it "prepends a slash to base_path" do + Bandwidth.configure { |c| c.base_path = 'v4/dog' } + expect(Bandwidth::Configuration.default.base_path).to eq('/v4/dog') + end + + it "doesn't prepend a slash if one is already there" do + Bandwidth.configure { |c| c.base_path = '/v4/dog' } + expect(Bandwidth::Configuration.default.base_path).to eq('/v4/dog') + end + + it "ends up as a blank string if nil" do + Bandwidth.configure { |c| c.base_path = nil } + expect(Bandwidth::Configuration.default.base_path).to eq('') + end + end + end + end + + + describe 'proxy in #build_connection' do + let(:config) { Bandwidth::Configuration.new } + let(:api_client) { Bandwidth::ApiClient.new(config) } + let(:proxy_uri) { URI('http://example.org:8080') } + + it 'defaults to nil' do + expect(Bandwidth::Configuration.default.proxy).to be_nil + expect(config.proxy).to be_nil + + connection = api_client.build_connection + expect(connection.proxy_for_request('/test')).to be_nil + end + + it 'can be customized with a string' do + config.proxy = proxy_uri.to_s + + connection = api_client.build_connection + configured_proxy = connection.proxy_for_request('/test') + + expect(configured_proxy).not_to be_nil + expect(configured_proxy.uri.to_s).to eq proxy_uri.to_s + end + + it 'can be customized with a hash' do + config.proxy = { uri: proxy_uri } + + connection = api_client.build_connection + configured_proxy = connection.proxy_for_request('/test') + + expect(configured_proxy).not_to be_nil + expect(configured_proxy.uri).to eq proxy_uri + end + end + + describe '#deserialize' do + it "handles Array" do + api_client = Bandwidth::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '[12, 34]') + data = api_client.deserialize(response, 'Array') + expect(data).to be_instance_of(Array) + expect(data).to eq([12, 34]) + end + + it 'handles Array>' do + api_client = Bandwidth::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '[[12, 34], [56]]') + data = api_client.deserialize(response, 'Array>') + expect(data).to be_instance_of(Array) + expect(data).to eq([[12, 34], [56]]) + end + + it 'handles Hash' do + api_client = Bandwidth::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '{"message": "Hello"}') + data = api_client.deserialize(response, 'Hash') + expect(data).to be_instance_of(Hash) + expect(data).to eq(:message => 'Hello') + end + end + + describe "#object_to_hash" do + it 'ignores nils and includes empty arrays' do + # uncomment below to test object_to_hash for model + # api_client = Bandwidth::ApiClient.new + # _model = Bandwidth::ModelName.new + # update the model attribute below + # _model.id = 1 + # update the expected value (hash) below + # expected = {id: 1, name: '', tags: []} + # expect(api_client.object_to_hash(_model)).to eq(expected) + end + end + + describe '#build_collection_param' do + let(:param) { ['aa', 'bb', 'cc'] } + let(:api_client) { Bandwidth::ApiClient.new } + + it 'works for csv' do + expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') + end + + it 'works for ssv' do + expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc') + end + + it 'works for tsv' do + expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") + end + + it 'works for pipes' do + expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc') + end + + it 'works for multi' do + expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) + end + + it 'fails for invalid collection format' do + expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') + end + end + + describe '#json_mime?' do + let(:api_client) { Bandwidth::ApiClient.new } + + it 'works' do + expect(api_client.json_mime?(nil)).to eq false + expect(api_client.json_mime?('')).to eq false + + expect(api_client.json_mime?('application/json')).to eq true + expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true + expect(api_client.json_mime?('APPLICATION/JSON')).to eq true + + expect(api_client.json_mime?('application/xml')).to eq false + expect(api_client.json_mime?('text/plain')).to eq false + expect(api_client.json_mime?('application/jsonp')).to eq false + end + end + + describe '#select_header_accept' do + let(:api_client) { Bandwidth::ApiClient.new } + + it 'works' do + expect(api_client.select_header_accept(nil)).to be_nil + expect(api_client.select_header_accept([])).to be_nil + + expect(api_client.select_header_accept(['application/json'])).to eq('application/json') + expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + + expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml') + expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') + end + end + + describe '#select_header_content_type' do + let(:api_client) { Bandwidth::ApiClient.new } + + it 'works' do + expect(api_client.select_header_content_type(nil)).to be_nil + expect(api_client.select_header_content_type([])).to be_nil + + expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') + expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml') + expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') + end + end + + describe '#sanitize_filename' do + let(:api_client) { Bandwidth::ApiClient.new } + + it 'works' do + expect(api_client.sanitize_filename('sun')).to eq('sun') + expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif') + end + end +end diff --git a/spec/call_utils.rb b/spec/call_utils.rb index 0f67c962..60743be0 100644 --- a/spec/call_utils.rb +++ b/spec/call_utils.rb @@ -2,40 +2,40 @@ # These are reused in multiple tests def setup_manteca(type) - manteca_body = { - os: OPERATING_SYSTEM, - language: RUBY_VERSION, - type: type - } - manteca_test_url = URI(MANTECA_BASE_URL + "/tests") - manteca_header = { 'Content-Type': 'application/json' } + manteca_body = { + os: OPERATING_SYSTEM, + language: RUBY_VERSION, + type: type + } + manteca_test_url = URI(MANTECA_BASE_URL + "/tests") + manteca_header = { 'Content-Type': 'application/json' } - begin - test_id = Net::HTTP.post(manteca_test_url, manteca_body.to_json, manteca_header) - return test_id.body.to_s - rescue => e - puts e.inspect - end + begin + test_id = Net::HTTP.post(manteca_test_url, manteca_body.to_json, manteca_header) + test_id.body.to_s + rescue => e + puts e.inspect + end end def create_manteca_call(tag = "ruby", answer_path = "/bxml/pause", calls_api) - manteca_call_body = Bandwidth::CreateCall.new( - application_id: MANTECA_APPLICATION_ID, - to: MANTECA_IDLE_NUMBER, - from: MANTECA_ACTIVE_NUMBER, - answer_url: MANTECA_BASE_URL + answer_path, - tag: tag - ) + manteca_call_body = Bandwidth::CreateCall.new( + application_id: MANTECA_APPLICATION_ID, + to: MANTECA_IDLE_NUMBER, + from: MANTECA_ACTIVE_NUMBER, + answer_url: MANTECA_BASE_URL + answer_path, + tag: tag + ) - response = calls_api.create_call(BW_ACCOUNT_ID, manteca_call_body) - $active_calls.append(response.call_id) - return response.call_id + response = calls_api.create_call(BW_ACCOUNT_ID, manteca_call_body) + $active_calls.append(response.call_id) + response.call_id end def get_manteca_test_status(test_id) manteca_status_url = URI(MANTECA_BASE_URL + "/tests/" + test_id) response = JSON.parse(Net::HTTP.get(manteca_status_url)) - return response + response end def cleanup_calls(calls, calls_api) @@ -70,5 +70,5 @@ def call_ended(call_id, calls_api) return true end - return false + false end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb new file mode 100644 index 00000000..eb25f795 --- /dev/null +++ b/spec/configuration_spec.rb @@ -0,0 +1,82 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0 + +=end + + + +describe Bandwidth::Configuration do + let(:config) { Bandwidth::Configuration.new } + + before(:each) do + # uncomment below to setup host and base_path + # require 'URI' + # uri = URI.parse("http://localhost") + # Bandwidth.configure do |c| + # c.host = uri.host + # c.base_path = uri.path + # end + end + + describe '#base_url' do + it 'should have the default value' do + # uncomment below to test default value of the base path + expect(config.base_url).to eq("") + end + + it 'should remove trailing slashes' do + [nil, '', '/', '//'].each do |base_path| + config.base_path = base_path + # uncomment below to test trailing slashes + # expect(config.base_url).to eq("http://localhost") + end + end + end + + describe '#configure_faraday_connection' do + let(:faraday_connection) { Faraday::Connection.new } + + before do + stub_const('CustomAdapter', Class.new(Faraday::Adapter)) + stub_const('AnotherCustomAdapter', Class.new(Faraday::Adapter)) + + config.configure_faraday_connection do |conn| + conn.adapter CustomAdapter + conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger| + logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]') + end + end + end + + it 'adds a block that will be used to configure the connection' do + expect(faraday_connection.adapter).to eq(Faraday::Adapter::NetHttp) + expect(faraday_connection.builder.handlers).to_not include(Faraday::Response::Logger) + + config.configure_connection(faraday_connection) + + expect(faraday_connection.adapter).to eq(CustomAdapter) + expect(faraday_connection.builder.handlers).to include(Faraday::Response::Logger) + end + + it 'supports multiple configuration blocks' do + config.configure_faraday_connection do |conn| + conn.adapter AnotherCustomAdapter + end + + expect(faraday_connection.adapter).to eq(Faraday::Adapter::NetHttp) + expect(faraday_connection.builder.handlers).to_not include(Faraday::Response::Logger) + + config.configure_connection(faraday_connection) + + expect(faraday_connection.adapter).to eq(AnotherCustomAdapter) + expect(faraday_connection.builder.handlers).to include(Faraday::Response::Logger) + end + end +end diff --git a/spec/integration/calls_api_integration_spec.rb b/spec/integration/calls_api_integration_spec.rb index c1e34bb8..24eecda5 100644 --- a/spec/integration/calls_api_integration_spec.rb +++ b/spec/integration/calls_api_integration_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + require 'json' require_relative '../call_utils' @@ -112,7 +112,7 @@ update_call_id = create_manteca_call(@api_instance_calls) sleep(SLEEP_TIME_S) - update_bxml = "This is a test bxml response"; + update_bxml = "This is a test bxml response" update_response = @api_instance_calls.update_call_bxml_with_http_info(BW_ACCOUNT_ID, update_call_id, update_bxml) expect(update_response[CODE]).to eq(204) sleep(SLEEP_TIME_S) diff --git a/spec/integration/conferences_api_integration_spec.rb b/spec/integration/conferences_api_integration_spec.rb index 4bb69778..844842bd 100644 --- a/spec/integration/conferences_api_integration_spec.rb +++ b/spec/integration/conferences_api_integration_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + require 'json' require_relative '../call_utils' @@ -134,21 +134,21 @@ end end - # Get Conference Recording Information - describe 'get_conference_recording' do - it 'gets a conference recording by id' do - response = @api_instance_conferences.get_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id) - - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) - expect(response[DATA].conference_id).to eq($conference_id) - expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) - expect(response[DATA].name).to eq($manteca_test_id) - expect(response[DATA].status).to eq('complete').or eq('partial') - expect(response[DATA].recording_id).to be_instance_of(String) - expect(response[DATA].file_format).to eq(Bandwidth::FileFormatEnum::WAV) - end + # Get Conference Recording Information + describe 'get_conference_recording' do + it 'gets a conference recording by id' do + response = @api_instance_conferences.get_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) + expect(response[DATA].conference_id).to eq($conference_id) + expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) + expect(response[DATA].name).to eq($manteca_test_id) + expect(response[DATA].status).to eq('complete').or eq('partial') + expect(response[DATA].recording_id).to be_instance_of(String) + expect(response[DATA].file_format).to eq(Bandwidth::FileFormatEnum::WAV) end + end # Download Conference Recording describe 'download_conference_recording test' do diff --git a/spec/integration/media_api_integration_spec.rb b/spec/integration/media_api_integration_spec.rb index 3aadfb06..e5aeb5ba 100644 --- a/spec/integration/media_api_integration_spec.rb +++ b/spec/integration/media_api_integration_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + require 'json' # Integration Tests for Bandwidth::MediaApi @@ -30,16 +30,16 @@ end end - # List Media - describe 'list_media' do - it 'lists media' do - response = @api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID) - expect(response[CODE]).to eq(200) - expect(response[DATA][0]).to be_instance_of(Bandwidth::Media) - expect(response[DATA][0].content).to be_instance_of(String) - expect(response[DATA][0].content_length).to be > 0 - end + # List Media + describe 'list_media' do + it 'lists media' do + response = @api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID) + expect(response[CODE]).to eq(200) + expect(response[DATA][0]).to be_instance_of(Bandwidth::Media) + expect(response[DATA][0].content).to be_instance_of(String) + expect(response[DATA][0].content_length).to be > 0 end + end # Get Media describe 'get_media' do diff --git a/spec/integration/messages_api_integration_spec.rb b/spec/integration/messages_api_integration_spec.rb index 5a218473..f393dcf5 100644 --- a/spec/integration/messages_api_integration_spec.rb +++ b/spec/integration/messages_api_integration_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + require 'json' # Integration Tests for Bandwidth::MessagesApi diff --git a/spec/integration/mfa_api_integration_spec.rb b/spec/integration/mfa_api_integration_spec.rb index 89472a20..d269352f 100644 --- a/spec/integration/mfa_api_integration_spec.rb +++ b/spec/integration/mfa_api_integration_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + require 'json' # Integration Tests for Bandwidth::MFAApi diff --git a/spec/integration/phone_number_lookup_api_integration_spec.rb b/spec/integration/phone_number_lookup_api_integration_spec.rb index b5e5c7e4..e674862b 100644 --- a/spec/integration/phone_number_lookup_api_integration_spec.rb +++ b/spec/integration/phone_number_lookup_api_integration_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + require 'json' # Integration Tests for Bandwidth::PhoneNumberLookupApi diff --git a/spec/integration/recordings_api_integration_spec.rb b/spec/integration/recordings_api_integration_spec.rb index 27e3fce4..0ff8b207 100644 --- a/spec/integration/recordings_api_integration_spec.rb +++ b/spec/integration/recordings_api_integration_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + require 'json' require_relative '../call_utils' @@ -99,15 +99,15 @@ end end - # Download Recording - describe 'download_call_recording' do - it 'downloads a call recording by id' do - response = @api_instance_recordings.download_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + # Download Recording + describe 'download_call_recording' do + it 'downloads a call recording by id' do + response = @api_instance_recordings.download_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(String) - end + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(String) end + end # Create Transcription Request describe 'transcribe_call_recording' do @@ -137,18 +137,18 @@ end end - # Get Transcription - describe 'get_call_transcription' do - it 'gets the completed call recording transcription' do - response = @api_instance_recordings.get_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) - - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::TranscriptionList) - expect(response[DATA].transcripts[0]).to be_instance_of(Bandwidth::Transcription) - expect(response[DATA].transcripts[0].text).to be_instance_of(String) - expect(response[DATA].transcripts[0].confidence).to be_instance_of(Float) - end + # Get Transcription + describe 'get_call_transcription' do + it 'gets the completed call recording transcription' do + response = @api_instance_recordings.get_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + + expect(response[CODE]).to eq(200) + expect(response[DATA]).to be_instance_of(Bandwidth::TranscriptionList) + expect(response[DATA].transcripts[0]).to be_instance_of(Bandwidth::Transcription) + expect(response[DATA].transcripts[0].text).to be_instance_of(String) + expect(response[DATA].transcripts[0].confidence).to be_instance_of(Float) end + end # Delete Transcription describe 'delete_call_transcription' do @@ -158,13 +158,13 @@ end end - # Delete Recording Media - describe 'delete_recording_media' do - it 'deletes the completed call recording media' do - response = @api_instance_recordings.delete_recording_media_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) - expect(response[CODE]).to eq(204) - end + # Delete Recording Media + describe 'delete_recording_media' do + it 'deletes the completed call recording media' do + response = @api_instance_recordings.delete_recording_media_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + expect(response[CODE]).to eq(204) end + end # Delete Recording describe 'delete_recording' do diff --git a/spec/integration/statistics_api_integration_spec.rb b/spec/integration/statistics_api_integration_spec.rb index b86eb863..fc33bad2 100644 --- a/spec/integration/statistics_api_integration_spec.rb +++ b/spec/integration/statistics_api_integration_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + require 'json' # Integration Tests for Bandwidth::StatisticsApi diff --git a/spec/unit/models/account_statistics_spec.rb b/spec/models/account_statistics_spec.rb similarity index 76% rename from spec/unit/models/account_statistics_spec.rb rename to spec/models/account_statistics_spec.rb index d671f6d8..e9c70e42 100644 --- a/spec/unit/models/account_statistics_spec.rb +++ b/spec/models/account_statistics_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,13 +27,13 @@ end describe 'test attribute "current_call_queue_size"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "max_call_queue_size"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/answer_callback_spec.rb b/spec/models/answer_callback_spec.rb similarity index 54% rename from spec/unit/models/answer_callback_spec.rb rename to spec/models/answer_callback_spec.rb index 3446baf1..b0eb6487 100644 --- a/spec/unit/models/answer_callback_spec.rb +++ b/spec/models/answer_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,85 +27,85 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "machine_detection_result"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/bridge_complete_callback_spec.rb b/spec/models/bridge_complete_callback_spec.rb similarity index 54% rename from spec/unit/models/bridge_complete_callback_spec.rb rename to spec/models/bridge_complete_callback_spec.rb index 8987132d..d320903d 100644 --- a/spec/unit/models/bridge_complete_callback_spec.rb +++ b/spec/models/bridge_complete_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,97 +27,97 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "cause"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/bridge_target_complete_callback_spec.rb b/spec/models/bridge_target_complete_callback_spec.rb similarity index 56% rename from spec/unit/models/bridge_target_complete_callback_spec.rb rename to spec/models/bridge_target_complete_callback_spec.rb index 5e94bb88..ef1ce186 100644 --- a/spec/unit/models/bridge_target_complete_callback_spec.rb +++ b/spec/models/bridge_target_complete_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,79 +27,79 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/bxml/bxml_spec.rb b/spec/models/bxml/bxml_spec.rb similarity index 95% rename from spec/unit/models/bxml/bxml_spec.rb rename to spec/models/bxml/bxml_spec.rb index 62943263..d0ad3a86 100644 --- a/spec/unit/models/bxml/bxml_spec.rb +++ b/spec/models/bxml/bxml_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Bxml describe 'Bandwidth::Bxml::Bxml' do diff --git a/spec/unit/models/bxml/nestable_verb_spec.rb b/spec/models/bxml/nestable_verb_spec.rb similarity index 94% rename from spec/unit/models/bxml/nestable_verb_spec.rb rename to spec/models/bxml/nestable_verb_spec.rb index 423e90fc..393e3705 100644 --- a/spec/unit/models/bxml/nestable_verb_spec.rb +++ b/spec/models/bxml/nestable_verb_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::NestableVerb describe 'Bandwidth::Bxml::NestableVerb' do diff --git a/spec/unit/models/bxml/response_spec.rb b/spec/models/bxml/response_spec.rb similarity index 96% rename from spec/unit/models/bxml/response_spec.rb rename to spec/models/bxml/response_spec.rb index 420ec57f..c846631e 100644 --- a/spec/unit/models/bxml/response_spec.rb +++ b/spec/models/bxml/response_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Response describe 'Bandwidth::Bxml::Response' do diff --git a/spec/unit/models/bxml/verb_spec.rb b/spec/models/bxml/verb_spec.rb similarity index 89% rename from spec/unit/models/bxml/verb_spec.rb rename to spec/models/bxml/verb_spec.rb index 55f08270..477431d6 100644 --- a/spec/unit/models/bxml/verb_spec.rb +++ b/spec/models/bxml/verb_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Verb describe 'Bandwidth::Bxml::Verb' do @@ -15,7 +15,7 @@ end it 'tests invalid attribute' do - attributes = {'invalid_attribute' => 'invalid'} + attributes = { 'invalid_attribute' => 'invalid' } instance.set_attributes(attributes) expect { diff --git a/spec/unit/models/bxml/verbs/bridge_spec.rb b/spec/models/bxml/verbs/bridge_spec.rb similarity index 99% rename from spec/unit/models/bxml/verbs/bridge_spec.rb rename to spec/models/bxml/verbs/bridge_spec.rb index 71454d3f..888ff7da 100644 --- a/spec/unit/models/bxml/verbs/bridge_spec.rb +++ b/spec/models/bxml/verbs/bridge_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Bridge describe 'Bandwidth::Bxml::Bridge' do diff --git a/spec/unit/models/bxml/verbs/conference_spec.rb b/spec/models/bxml/verbs/conference_spec.rb similarity index 99% rename from spec/unit/models/bxml/verbs/conference_spec.rb rename to spec/models/bxml/verbs/conference_spec.rb index 4d7710ac..43adc55a 100644 --- a/spec/unit/models/bxml/verbs/conference_spec.rb +++ b/spec/models/bxml/verbs/conference_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Conference describe 'Bandwidth::Bxml::Conference' do diff --git a/spec/unit/models/bxml/verbs/custom_param_spec.rb b/spec/models/bxml/verbs/custom_param_spec.rb similarity index 97% rename from spec/unit/models/bxml/verbs/custom_param_spec.rb rename to spec/models/bxml/verbs/custom_param_spec.rb index 9fac6600..781b67cd 100644 --- a/spec/unit/models/bxml/verbs/custom_param_spec.rb +++ b/spec/models/bxml/verbs/custom_param_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::CustomParam describe 'Bandwidth::Bxml::CustomParam' do diff --git a/spec/unit/models/bxml/verbs/forward_spec.rb b/spec/models/bxml/verbs/forward_spec.rb similarity index 98% rename from spec/unit/models/bxml/verbs/forward_spec.rb rename to spec/models/bxml/verbs/forward_spec.rb index f032f873..1cb6f231 100644 --- a/spec/unit/models/bxml/verbs/forward_spec.rb +++ b/spec/models/bxml/verbs/forward_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Forward describe 'Bandwidth::Bxml::Forward' do diff --git a/spec/unit/models/bxml/verbs/gather_spec.rb b/spec/models/bxml/verbs/gather_spec.rb similarity index 99% rename from spec/unit/models/bxml/verbs/gather_spec.rb rename to spec/models/bxml/verbs/gather_spec.rb index a105e6c4..94ce34ba 100644 --- a/spec/unit/models/bxml/verbs/gather_spec.rb +++ b/spec/models/bxml/verbs/gather_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Gather describe 'Bandwidth::Bxml::Gather' do diff --git a/spec/unit/models/bxml/verbs/hangup_spec.rb b/spec/models/bxml/verbs/hangup_spec.rb similarity index 95% rename from spec/unit/models/bxml/verbs/hangup_spec.rb rename to spec/models/bxml/verbs/hangup_spec.rb index 836a3e62..eb99878f 100644 --- a/spec/unit/models/bxml/verbs/hangup_spec.rb +++ b/spec/models/bxml/verbs/hangup_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Hangup describe 'Bandwidth::Bxml::Hangup' do diff --git a/spec/unit/models/bxml/verbs/pause_recording_spec.rb b/spec/models/bxml/verbs/pause_recording_spec.rb similarity index 96% rename from spec/unit/models/bxml/verbs/pause_recording_spec.rb rename to spec/models/bxml/verbs/pause_recording_spec.rb index 8045cccd..195942bb 100644 --- a/spec/unit/models/bxml/verbs/pause_recording_spec.rb +++ b/spec/models/bxml/verbs/pause_recording_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::PauseRecording describe 'Bandwidth::Bxml::PauseRecording' do diff --git a/spec/unit/models/bxml/verbs/pause_spec.rb b/spec/models/bxml/verbs/pause_spec.rb similarity index 97% rename from spec/unit/models/bxml/verbs/pause_spec.rb rename to spec/models/bxml/verbs/pause_spec.rb index 35918ef9..6dc2b26d 100644 --- a/spec/unit/models/bxml/verbs/pause_spec.rb +++ b/spec/models/bxml/verbs/pause_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Pause describe 'Bandwidth::Bxml::Pause' do diff --git a/spec/unit/models/bxml/verbs/phone_number_spec.rb b/spec/models/bxml/verbs/phone_number_spec.rb similarity index 99% rename from spec/unit/models/bxml/verbs/phone_number_spec.rb rename to spec/models/bxml/verbs/phone_number_spec.rb index 4d02c513..cccb980b 100644 --- a/spec/unit/models/bxml/verbs/phone_number_spec.rb +++ b/spec/models/bxml/verbs/phone_number_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::PhoneNumber describe 'Bandwidth::Bxml::PhoneNumber' do diff --git a/spec/unit/models/bxml/verbs/play_audio_spec.rb b/spec/models/bxml/verbs/play_audio_spec.rb similarity index 98% rename from spec/unit/models/bxml/verbs/play_audio_spec.rb rename to spec/models/bxml/verbs/play_audio_spec.rb index 76d51195..a1aa95b8 100644 --- a/spec/unit/models/bxml/verbs/play_audio_spec.rb +++ b/spec/models/bxml/verbs/play_audio_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::PlayAudio describe 'Bandwidth::Bxml::PlayAudio' do diff --git a/spec/unit/models/bxml/verbs/record_spec.rb b/spec/models/bxml/verbs/record_spec.rb similarity index 99% rename from spec/unit/models/bxml/verbs/record_spec.rb rename to spec/models/bxml/verbs/record_spec.rb index 2633ce92..f55d3e4a 100644 --- a/spec/unit/models/bxml/verbs/record_spec.rb +++ b/spec/models/bxml/verbs/record_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Record describe 'Bandwidth::Bxml::Record' do diff --git a/spec/unit/models/bxml/verbs/redirect_spec.rb b/spec/models/bxml/verbs/redirect_spec.rb similarity index 98% rename from spec/unit/models/bxml/verbs/redirect_spec.rb rename to spec/models/bxml/verbs/redirect_spec.rb index 69aa068e..eae7b1ea 100644 --- a/spec/unit/models/bxml/verbs/redirect_spec.rb +++ b/spec/models/bxml/verbs/redirect_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Redirect describe 'Bandwidth::Bxml::Redirect' do diff --git a/spec/unit/models/bxml/verbs/resume_recording_spec.rb b/spec/models/bxml/verbs/resume_recording_spec.rb similarity index 96% rename from spec/unit/models/bxml/verbs/resume_recording_spec.rb rename to spec/models/bxml/verbs/resume_recording_spec.rb index f599b9cc..a76de778 100644 --- a/spec/unit/models/bxml/verbs/resume_recording_spec.rb +++ b/spec/models/bxml/verbs/resume_recording_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::ResumeRecording describe 'Bandwidth::Bxml::ResumeRecording' do diff --git a/spec/unit/models/bxml/verbs/ring_spec.rb b/spec/models/bxml/verbs/ring_spec.rb similarity index 97% rename from spec/unit/models/bxml/verbs/ring_spec.rb rename to spec/models/bxml/verbs/ring_spec.rb index 14089ee4..2e35ec33 100644 --- a/spec/unit/models/bxml/verbs/ring_spec.rb +++ b/spec/models/bxml/verbs/ring_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Ring describe 'Bandwidth::Bxml::Ring' do diff --git a/spec/unit/models/bxml/verbs/send_dtmf_spec.rb b/spec/models/bxml/verbs/send_dtmf_spec.rb similarity index 97% rename from spec/unit/models/bxml/verbs/send_dtmf_spec.rb rename to spec/models/bxml/verbs/send_dtmf_spec.rb index 757a8ace..dbaacff1 100644 --- a/spec/unit/models/bxml/verbs/send_dtmf_spec.rb +++ b/spec/models/bxml/verbs/send_dtmf_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::SendDtmf describe 'Bandwidth::Bxml::SendDtmf' do diff --git a/spec/unit/models/bxml/verbs/sip_uri_spec.rb b/spec/models/bxml/verbs/sip_uri_spec.rb similarity index 99% rename from spec/unit/models/bxml/verbs/sip_uri_spec.rb rename to spec/models/bxml/verbs/sip_uri_spec.rb index 149ad1b5..4d830f98 100644 --- a/spec/unit/models/bxml/verbs/sip_uri_spec.rb +++ b/spec/models/bxml/verbs/sip_uri_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::SipUri describe 'Bandwidth::Bxml::SipUri' do diff --git a/spec/unit/models/bxml/verbs/speak_sentence_spec.rb b/spec/models/bxml/verbs/speak_sentence_spec.rb similarity index 98% rename from spec/unit/models/bxml/verbs/speak_sentence_spec.rb rename to spec/models/bxml/verbs/speak_sentence_spec.rb index 14ebcadc..2aaafd7d 100644 --- a/spec/unit/models/bxml/verbs/speak_sentence_spec.rb +++ b/spec/models/bxml/verbs/speak_sentence_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::SpeakSentence describe 'Bandwidth::Bxml::SpeakSentence' do diff --git a/spec/unit/models/bxml/verbs/start_gather_spec.rb b/spec/models/bxml/verbs/start_gather_spec.rb similarity index 98% rename from spec/unit/models/bxml/verbs/start_gather_spec.rb rename to spec/models/bxml/verbs/start_gather_spec.rb index 1bf0e37c..a9113335 100644 --- a/spec/unit/models/bxml/verbs/start_gather_spec.rb +++ b/spec/models/bxml/verbs/start_gather_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::StartGather describe 'Bandwidth::Bxml::StartGather' do diff --git a/spec/unit/models/bxml/verbs/start_recording_spec.rb b/spec/models/bxml/verbs/start_recording_spec.rb similarity index 99% rename from spec/unit/models/bxml/verbs/start_recording_spec.rb rename to spec/models/bxml/verbs/start_recording_spec.rb index 7d81feb9..7ac14b11 100644 --- a/spec/unit/models/bxml/verbs/start_recording_spec.rb +++ b/spec/models/bxml/verbs/start_recording_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::StartRecording describe 'Bandwidth::Bxml::StartRecording' do diff --git a/spec/unit/models/bxml/verbs/start_stream_spec.rb b/spec/models/bxml/verbs/start_stream_spec.rb similarity index 93% rename from spec/unit/models/bxml/verbs/start_stream_spec.rb rename to spec/models/bxml/verbs/start_stream_spec.rb index 2fd99fa1..95d73a3c 100644 --- a/spec/unit/models/bxml/verbs/start_stream_spec.rb +++ b/spec/models/bxml/verbs/start_stream_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::StartStream describe 'Bandwidth::Bxml::StartStream' do @@ -26,8 +26,8 @@ } } - let (:stream_param_1) { Bandwidth::Bxml::StreamParam.new({name: 'stream_param_name_1', value: 'stream_param_value_1'}) } - let (:stream_param_2) { Bandwidth::Bxml::StreamParam.new({name: 'stream_param_name_2', value: 'stream_param_value_2'}) } + let (:stream_param_1) { Bandwidth::Bxml::StreamParam.new({ name: 'stream_param_name_1', value: 'stream_param_value_1' }) } + let (:stream_param_2) { Bandwidth::Bxml::StreamParam.new({ name: 'stream_param_name_2', value: 'stream_param_value_2' }) } let(:instance) { Bandwidth::Bxml::StartStream.new([], initial_attributes) } let(:instance_nested) { Bandwidth::Bxml::StartStream.new([stream_param_1], initial_attributes) } diff --git a/spec/unit/models/bxml/verbs/start_transcription_spec.rb b/spec/models/bxml/verbs/start_transcription_spec.rb similarity index 94% rename from spec/unit/models/bxml/verbs/start_transcription_spec.rb rename to spec/models/bxml/verbs/start_transcription_spec.rb index 39e388a8..e5fb3973 100644 --- a/spec/unit/models/bxml/verbs/start_transcription_spec.rb +++ b/spec/models/bxml/verbs/start_transcription_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::StartTranscription describe 'Bandwidth::Bxml::StartTranscription' do @@ -28,8 +28,8 @@ } } - let (:custom_param_1) { Bandwidth::Bxml::CustomParam.new({name: 'custom_param_name_1', value: 'custom_param_value_1'}) } - let (:custom_param_2) { Bandwidth::Bxml::CustomParam.new({name: 'custom_param_name_2', value: 'custom_param_value_2'}) } + let (:custom_param_1) { Bandwidth::Bxml::CustomParam.new({ name: 'custom_param_name_1', value: 'custom_param_value_1' }) } + let (:custom_param_2) { Bandwidth::Bxml::CustomParam.new({ name: 'custom_param_name_2', value: 'custom_param_value_2' }) } let(:instance) { Bandwidth::Bxml::StartTranscription.new([], initial_attributes) } let(:instance_nested) { Bandwidth::Bxml::StartTranscription.new([custom_param_1], initial_attributes) } diff --git a/spec/unit/models/bxml/verbs/stop_gather_spec.rb b/spec/models/bxml/verbs/stop_gather_spec.rb similarity index 96% rename from spec/unit/models/bxml/verbs/stop_gather_spec.rb rename to spec/models/bxml/verbs/stop_gather_spec.rb index e8c8cad8..d25eed61 100644 --- a/spec/unit/models/bxml/verbs/stop_gather_spec.rb +++ b/spec/models/bxml/verbs/stop_gather_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::StopGather describe 'Bandwidth::Bxml::StopGather' do diff --git a/spec/unit/models/bxml/verbs/stop_recording_spec.rb b/spec/models/bxml/verbs/stop_recording_spec.rb similarity index 96% rename from spec/unit/models/bxml/verbs/stop_recording_spec.rb rename to spec/models/bxml/verbs/stop_recording_spec.rb index 36e37725..02df752d 100644 --- a/spec/unit/models/bxml/verbs/stop_recording_spec.rb +++ b/spec/models/bxml/verbs/stop_recording_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::StopRecording describe 'Bandwidth::Bxml::StopRecording' do diff --git a/spec/unit/models/bxml/verbs/stop_stream_spec.rb b/spec/models/bxml/verbs/stop_stream_spec.rb similarity index 97% rename from spec/unit/models/bxml/verbs/stop_stream_spec.rb rename to spec/models/bxml/verbs/stop_stream_spec.rb index be08beea..094fad84 100644 --- a/spec/unit/models/bxml/verbs/stop_stream_spec.rb +++ b/spec/models/bxml/verbs/stop_stream_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::StopStream describe 'Bandwidth::Bxml::StopStream' do diff --git a/spec/unit/models/bxml/verbs/stop_transcription_spec.rb b/spec/models/bxml/verbs/stop_transcription_spec.rb similarity index 97% rename from spec/unit/models/bxml/verbs/stop_transcription_spec.rb rename to spec/models/bxml/verbs/stop_transcription_spec.rb index 914d2c9f..b60fae69 100644 --- a/spec/unit/models/bxml/verbs/stop_transcription_spec.rb +++ b/spec/models/bxml/verbs/stop_transcription_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::StopTranscription describe 'Bandwidth::Bxml::StopTranscription' do diff --git a/spec/unit/models/bxml/verbs/stream_param_spec.rb b/spec/models/bxml/verbs/stream_param_spec.rb similarity index 97% rename from spec/unit/models/bxml/verbs/stream_param_spec.rb rename to spec/models/bxml/verbs/stream_param_spec.rb index 64cb3bbb..fd9db0de 100644 --- a/spec/unit/models/bxml/verbs/stream_param_spec.rb +++ b/spec/models/bxml/verbs/stream_param_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::StreamParam describe 'Bandwidth::Bxml::StreamParam' do diff --git a/spec/unit/models/bxml/verbs/tag_spec.rb b/spec/models/bxml/verbs/tag_spec.rb similarity index 95% rename from spec/unit/models/bxml/verbs/tag_spec.rb rename to spec/models/bxml/verbs/tag_spec.rb index 2bb6b9ce..3120c27a 100644 --- a/spec/unit/models/bxml/verbs/tag_spec.rb +++ b/spec/models/bxml/verbs/tag_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Tag describe 'Bandwidth::Bxml::Tag' do diff --git a/spec/unit/models/bxml/verbs/transfer_spec.rb b/spec/models/bxml/verbs/transfer_spec.rb similarity index 99% rename from spec/unit/models/bxml/verbs/transfer_spec.rb rename to spec/models/bxml/verbs/transfer_spec.rb index c91bae5e..3ee2aa26 100644 --- a/spec/unit/models/bxml/verbs/transfer_spec.rb +++ b/spec/models/bxml/verbs/transfer_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' + # Unit tests for Bandwidth::Bxml::Transfer describe 'Bandwidth::Bxml::Transfer' do diff --git a/spec/unit/models/call_direction_enum_spec.rb b/spec/models/call_direction_enum_spec.rb similarity index 92% rename from spec/unit/models/call_direction_enum_spec.rb rename to spec/models/call_direction_enum_spec.rb index 92052a06..17de660f 100644 --- a/spec/unit/models/call_direction_enum_spec.rb +++ b/spec/models/call_direction_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/call_recording_metadata_spec.rb b/spec/models/call_recording_metadata_spec.rb similarity index 53% rename from spec/unit/models/call_recording_metadata_spec.rb rename to spec/models/call_recording_metadata_spec.rb index a5840e80..08b67d0a 100644 --- a/spec/unit/models/call_recording_metadata_spec.rb +++ b/spec/models/call_recording_metadata_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,109 +27,109 @@ end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "parent_call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "recording_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_caller_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "duration"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "channels"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "end_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "file_format"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transcription"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/call_state_enum_spec.rb b/spec/models/call_state_enum_spec.rb similarity index 92% rename from spec/unit/models/call_state_enum_spec.rb rename to spec/models/call_state_enum_spec.rb index 03710fd9..6aa27bf8 100644 --- a/spec/unit/models/call_state_enum_spec.rb +++ b/spec/models/call_state_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/call_state_spec.rb b/spec/models/call_state_spec.rb similarity index 52% rename from spec/unit/models/call_state_spec.rb rename to spec/models/call_state_spec.rb index 3b2774a1..0703aac1 100644 --- a/spec/unit/models/call_state_spec.rb +++ b/spec/models/call_state_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,109 +27,109 @@ end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "parent_call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "state"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "stir_shaken"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "identity"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "end_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "disconnect_cause"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "last_update"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/callback_method_enum_spec.rb b/spec/models/callback_method_enum_spec.rb similarity index 92% rename from spec/unit/models/callback_method_enum_spec.rb rename to spec/models/callback_method_enum_spec.rb index 394980d7..7ce6421e 100644 --- a/spec/unit/models/callback_method_enum_spec.rb +++ b/spec/models/callback_method_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/code_request_spec.rb b/spec/models/code_request_spec.rb similarity index 62% rename from spec/unit/models/code_request_spec.rb rename to spec/models/code_request_spec.rb index 39712279..160c8cc2 100644 --- a/spec/unit/models/code_request_spec.rb +++ b/spec/models/code_request_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,37 +27,37 @@ end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "scope"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "digits"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/conference_completed_callback_spec.rb b/spec/models/conference_completed_callback_spec.rb similarity index 66% rename from spec/unit/models/conference_completed_callback_spec.rb rename to spec/models/conference_completed_callback_spec.rb index b202ce8e..ec439e79 100644 --- a/spec/unit/models/conference_completed_callback_spec.rb +++ b/spec/models/conference_completed_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,31 +27,31 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "conference_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/conference_created_callback_spec.rb b/spec/models/conference_created_callback_spec.rb similarity index 66% rename from spec/unit/models/conference_created_callback_spec.rb rename to spec/models/conference_created_callback_spec.rb index 16d03179..dfa3d60f 100644 --- a/spec/unit/models/conference_created_callback_spec.rb +++ b/spec/models/conference_created_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,31 +27,31 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "conference_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/conference_member_exit_callback_spec.rb b/spec/models/conference_member_exit_callback_spec.rb similarity index 61% rename from spec/unit/models/conference_member_exit_callback_spec.rb rename to spec/models/conference_member_exit_callback_spec.rb index 4bb244d6..a1ce6b36 100644 --- a/spec/unit/models/conference_member_exit_callback_spec.rb +++ b/spec/models/conference_member_exit_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,49 +27,49 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "conference_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/conference_member_join_callback_spec.rb b/spec/models/conference_member_join_callback_spec.rb similarity index 61% rename from spec/unit/models/conference_member_join_callback_spec.rb rename to spec/models/conference_member_join_callback_spec.rb index b07a3abe..291acb51 100644 --- a/spec/unit/models/conference_member_join_callback_spec.rb +++ b/spec/models/conference_member_join_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,49 +27,49 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "conference_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/conference_member_spec.rb b/spec/models/conference_member_spec.rb similarity index 63% rename from spec/unit/models/conference_member_spec.rb rename to spec/models/conference_member_spec.rb index 62d2178e..5c8060e8 100644 --- a/spec/unit/models/conference_member_spec.rb +++ b/spec/models/conference_member_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,37 +27,37 @@ end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "conference_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "member_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "mute"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "hold"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_ids_to_coach"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/conference_recording_available_callback_spec.rb b/spec/models/conference_recording_available_callback_spec.rb similarity index 56% rename from spec/unit/models/conference_recording_available_callback_spec.rb rename to spec/models/conference_recording_available_callback_spec.rb index 92ca4030..fa4e29d8 100644 --- a/spec/unit/models/conference_recording_available_callback_spec.rb +++ b/spec/models/conference_recording_available_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,85 +27,85 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "conference_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "recording_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "channels"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "end_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "duration"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "file_format"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/conference_recording_metadata_spec.rb b/spec/models/conference_recording_metadata_spec.rb similarity index 57% rename from spec/unit/models/conference_recording_metadata_spec.rb rename to spec/models/conference_recording_metadata_spec.rb index 6f86e28e..dc968bd1 100644 --- a/spec/unit/models/conference_recording_metadata_spec.rb +++ b/spec/models/conference_recording_metadata_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,67 +27,67 @@ end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "conference_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "recording_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "duration"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "channels"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "end_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "file_format"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/conference_redirect_callback_spec.rb b/spec/models/conference_redirect_callback_spec.rb similarity index 66% rename from spec/unit/models/conference_redirect_callback_spec.rb rename to spec/models/conference_redirect_callback_spec.rb index 253f066b..81efec54 100644 --- a/spec/unit/models/conference_redirect_callback_spec.rb +++ b/spec/models/conference_redirect_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,31 +27,31 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "conference_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/conference_spec.rb b/spec/models/conference_spec.rb similarity index 59% rename from spec/unit/models/conference_spec.rb rename to spec/models/conference_spec.rb index e7f3018e..de4eee64 100644 --- a/spec/unit/models/conference_spec.rb +++ b/spec/models/conference_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,49 +27,49 @@ end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "created_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "completed_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "conference_event_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "conference_event_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "active_members"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/conference_state_enum_spec.rb b/spec/models/conference_state_enum_spec.rb similarity index 92% rename from spec/unit/models/conference_state_enum_spec.rb rename to spec/models/conference_state_enum_spec.rb index 6cfbb7de..808f58b3 100644 --- a/spec/unit/models/conference_state_enum_spec.rb +++ b/spec/models/conference_state_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/create_call_response_spec.rb b/spec/models/create_call_response_spec.rb similarity index 52% rename from spec/unit/models/create_call_response_spec.rb rename to spec/models/create_call_response_spec.rb index 6dce6a19..d6db6dfa 100644 --- a/spec/unit/models/create_call_response_spec.rb +++ b/spec/models/create_call_response_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,127 +27,127 @@ end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_timeout"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "callback_timeout"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_fallback_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_fallback_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "disconnect_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "disconnect_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "priority"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/create_call_spec.rb b/spec/models/create_call_spec.rb similarity index 52% rename from spec/unit/models/create_call_spec.rb rename to spec/models/create_call_spec.rb index 1e374804..a2163d6f 100644 --- a/spec/unit/models/create_call_spec.rb +++ b/spec/models/create_call_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,115 +27,115 @@ end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "uui"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_fallback_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_fallback_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "disconnect_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "disconnect_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_timeout"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "callback_timeout"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "machine_detection"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "priority"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/create_lookup_response_spec.rb b/spec/models/create_lookup_response_spec.rb similarity index 76% rename from spec/unit/models/create_lookup_response_spec.rb rename to spec/models/create_lookup_response_spec.rb index 238dad02..a61a39d1 100644 --- a/spec/unit/models/create_lookup_response_spec.rb +++ b/spec/models/create_lookup_response_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,13 +27,13 @@ end describe 'test attribute "request_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/create_message_request_error_spec.rb b/spec/models/create_message_request_error_spec.rb similarity index 72% rename from spec/unit/models/create_message_request_error_spec.rb rename to spec/models/create_message_request_error_spec.rb index 592d5972..9a214e93 100644 --- a/spec/unit/models/create_message_request_error_spec.rb +++ b/spec/models/create_message_request_error_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,19 +27,19 @@ end describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "description"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "field_errors"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/deferred_result_spec.rb b/spec/models/deferred_result_spec.rb similarity index 75% rename from spec/unit/models/deferred_result_spec.rb rename to spec/models/deferred_result_spec.rb index b1f4b607..c7740633 100644 --- a/spec/unit/models/deferred_result_spec.rb +++ b/spec/models/deferred_result_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,13 +27,13 @@ end describe 'test attribute "result"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "set_or_expired"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/disconnect_callback_spec.rb b/spec/models/disconnect_callback_spec.rb similarity index 53% rename from spec/unit/models/disconnect_callback_spec.rb rename to spec/models/disconnect_callback_spec.rb index 42219ed2..4c88ef92 100644 --- a/spec/unit/models/disconnect_callback_spec.rb +++ b/spec/models/disconnect_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,103 +27,103 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "end_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "cause"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/diversion_spec.rb b/spec/models/diversion_spec.rb similarity index 60% rename from spec/unit/models/diversion_spec.rb rename to spec/models/diversion_spec.rb index 6f8b9a8a..012d5c35 100644 --- a/spec/unit/models/diversion_spec.rb +++ b/spec/models/diversion_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,43 +27,43 @@ end describe 'test attribute "reason"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "privacy"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "screen"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "counter"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "limit"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "unknown"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "orig_to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/dtmf_callback_spec.rb b/spec/models/dtmf_callback_spec.rb similarity index 53% rename from spec/unit/models/dtmf_callback_spec.rb rename to spec/models/dtmf_callback_spec.rb index a0b9de36..ea3f75a1 100644 --- a/spec/unit/models/dtmf_callback_spec.rb +++ b/spec/models/dtmf_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,103 +27,103 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "digit"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "parent_call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_caller_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/field_error_spec.rb b/spec/models/field_error_spec.rb similarity index 75% rename from spec/unit/models/field_error_spec.rb rename to spec/models/field_error_spec.rb index e33c58cd..41835ce9 100644 --- a/spec/unit/models/field_error_spec.rb +++ b/spec/models/field_error_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,13 +27,13 @@ end describe 'test attribute "field_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "description"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/file_format_enum_spec.rb b/spec/models/file_format_enum_spec.rb similarity index 92% rename from spec/unit/models/file_format_enum_spec.rb rename to spec/models/file_format_enum_spec.rb index 9c6417d2..50baca20 100644 --- a/spec/unit/models/file_format_enum_spec.rb +++ b/spec/models/file_format_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/gather_callback_spec.rb b/spec/models/gather_callback_spec.rb similarity index 52% rename from spec/unit/models/gather_callback_spec.rb rename to spec/models/gather_callback_spec.rb index 8e567015..9eb22818 100644 --- a/spec/unit/models/gather_callback_spec.rb +++ b/spec/models/gather_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,109 +27,109 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "digits"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "parent_call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "terminating_digit"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_caller_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/inbound_message_callback_message_spec.rb b/spec/models/inbound_message_callback_message_spec.rb similarity index 56% rename from spec/unit/models/inbound_message_callback_message_spec.rb rename to spec/models/inbound_message_callback_message_spec.rb index 86ff19e2..54e6a724 100644 --- a/spec/unit/models/inbound_message_callback_message_spec.rb +++ b/spec/models/inbound_message_callback_message_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,73 +27,73 @@ end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "owner"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "segment_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "text"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "priority"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/inbound_message_callback_spec.rb b/spec/models/inbound_message_callback_spec.rb similarity index 65% rename from spec/unit/models/inbound_message_callback_spec.rb rename to spec/models/inbound_message_callback_spec.rb index 6e8d9393..5af404da 100644 --- a/spec/unit/models/inbound_message_callback_spec.rb +++ b/spec/models/inbound_message_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,31 +27,31 @@ end describe 'test attribute "time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "description"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/initiate_callback_spec.rb b/spec/models/initiate_callback_spec.rb similarity index 56% rename from spec/unit/models/initiate_callback_spec.rb rename to spec/models/initiate_callback_spec.rb index c97f96fe..25e1a953 100644 --- a/spec/unit/models/initiate_callback_spec.rb +++ b/spec/models/initiate_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,73 +27,73 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "diversion"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "stir_shaken"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/list_message_direction_enum_spec.rb b/spec/models/list_message_direction_enum_spec.rb similarity index 92% rename from spec/unit/models/list_message_direction_enum_spec.rb rename to spec/models/list_message_direction_enum_spec.rb index d196706a..14496900 100644 --- a/spec/unit/models/list_message_direction_enum_spec.rb +++ b/spec/models/list_message_direction_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/list_message_item_spec.rb b/spec/models/list_message_item_spec.rb similarity index 52% rename from spec/unit/models/list_message_item_spec.rb rename to spec/models/list_message_item_spec.rb index ae223c8a..1c84722e 100644 --- a/spec/unit/models/list_message_item_spec.rb +++ b/spec/models/list_message_item_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,97 +27,103 @@ end describe 'test attribute "message_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "source_tn"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "destination_tn"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message_status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message_direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "segment_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_code"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "receive_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "carrier_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message_size"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message_length"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "attachment_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "recipient_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "campaign_class"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "campaign_id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/lookup_request_spec.rb b/spec/models/lookup_request_spec.rb similarity index 82% rename from spec/unit/models/lookup_request_spec.rb rename to spec/models/lookup_request_spec.rb index 2fd1a337..9240d6c2 100644 --- a/spec/unit/models/lookup_request_spec.rb +++ b/spec/models/lookup_request_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,7 +27,7 @@ end describe 'test attribute "tns"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/lookup_result_spec.rb b/spec/models/lookup_result_spec.rb similarity index 58% rename from spec/unit/models/lookup_result_spec.rb rename to spec/models/lookup_result_spec.rb index 17df4ea5..df7bda86 100644 --- a/spec/unit/models/lookup_result_spec.rb +++ b/spec/models/lookup_result_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,55 +27,55 @@ end describe 'test attribute "response_code"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "e_164_format"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "formatted"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "country"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "line_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "line_provider"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "mobile_country_code"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "mobile_network_code"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/lookup_status_enum_spec.rb b/spec/models/lookup_status_enum_spec.rb similarity index 92% rename from spec/unit/models/lookup_status_enum_spec.rb rename to spec/models/lookup_status_enum_spec.rb index a9bf5502..6b457f21 100644 --- a/spec/unit/models/lookup_status_enum_spec.rb +++ b/spec/models/lookup_status_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/lookup_status_spec.rb b/spec/models/lookup_status_spec.rb similarity index 67% rename from spec/unit/models/lookup_status_spec.rb rename to spec/models/lookup_status_spec.rb index 4e22b40b..af0802fc 100644 --- a/spec/unit/models/lookup_status_spec.rb +++ b/spec/models/lookup_status_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,25 +27,25 @@ end describe 'test attribute "request_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "result"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "failed_telephone_numbers"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/machine_detection_complete_callback_spec.rb b/spec/models/machine_detection_complete_callback_spec.rb similarity index 56% rename from spec/unit/models/machine_detection_complete_callback_spec.rb rename to spec/models/machine_detection_complete_callback_spec.rb index 64deabc2..233514d2 100644 --- a/spec/unit/models/machine_detection_complete_callback_spec.rb +++ b/spec/models/machine_detection_complete_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,85 +27,85 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "machine_detection_result"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/machine_detection_configuration_spec.rb b/spec/models/machine_detection_configuration_spec.rb similarity index 56% rename from spec/unit/models/machine_detection_configuration_spec.rb rename to spec/models/machine_detection_configuration_spec.rb index d456fbe7..884d4047 100644 --- a/spec/unit/models/machine_detection_configuration_spec.rb +++ b/spec/models/machine_detection_configuration_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,91 +27,91 @@ end describe 'test attribute "mode"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "detection_timeout"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "silence_timeout"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "speech_threshold"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "speech_end_threshold"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "machine_speech_end_threshold"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "delay_result"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "callback_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "callback_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/machine_detection_mode_enum_spec.rb b/spec/models/machine_detection_mode_enum_spec.rb similarity index 92% rename from spec/unit/models/machine_detection_mode_enum_spec.rb rename to spec/models/machine_detection_mode_enum_spec.rb index 942c8dde..f471fca1 100644 --- a/spec/unit/models/machine_detection_mode_enum_spec.rb +++ b/spec/models/machine_detection_mode_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/models/machine_detection_result_spec.rb b/spec/models/machine_detection_result_spec.rb new file mode 100644 index 00000000..95673156 --- /dev/null +++ b/spec/models/machine_detection_result_spec.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.6.0 + +=end + + +require 'json' +require 'date' + +# Unit tests for Bandwidth::MachineDetectionResult +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Bandwidth::MachineDetectionResult do + let(:instance) { Bandwidth::MachineDetectionResult.new } + + describe 'test an instance of MachineDetectionResult' do + it 'should create an instance of MachineDetectionResult' do + expect(instance).to be_instance_of(Bandwidth::MachineDetectionResult) + end + end + describe 'test attribute "value"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "duration"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/unit/models/media_spec.rb b/spec/models/media_spec.rb similarity index 70% rename from spec/unit/models/media_spec.rb rename to spec/models/media_spec.rb index 7d363910..e0749f39 100644 --- a/spec/unit/models/media_spec.rb +++ b/spec/models/media_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,19 +27,19 @@ end describe 'test attribute "content"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "content_length"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/message_delivered_callback_message_spec.rb b/spec/models/message_delivered_callback_message_spec.rb similarity index 56% rename from spec/unit/models/message_delivered_callback_message_spec.rb rename to spec/models/message_delivered_callback_message_spec.rb index 0c57b32c..2f6124dd 100644 --- a/spec/unit/models/message_delivered_callback_message_spec.rb +++ b/spec/models/message_delivered_callback_message_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,73 +27,73 @@ end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "owner"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "segment_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "text"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "priority"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/message_delivered_callback_spec.rb b/spec/models/message_delivered_callback_spec.rb similarity index 66% rename from spec/unit/models/message_delivered_callback_spec.rb rename to spec/models/message_delivered_callback_spec.rb index c865c349..8f11c0be 100644 --- a/spec/unit/models/message_delivered_callback_spec.rb +++ b/spec/models/message_delivered_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,31 +27,31 @@ end describe 'test attribute "time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "description"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/message_direction_enum_spec.rb b/spec/models/message_direction_enum_spec.rb similarity index 92% rename from spec/unit/models/message_direction_enum_spec.rb rename to spec/models/message_direction_enum_spec.rb index 642b9d7b..dcfd8336 100644 --- a/spec/unit/models/message_direction_enum_spec.rb +++ b/spec/models/message_direction_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/message_failed_callback_message_spec.rb b/spec/models/message_failed_callback_message_spec.rb similarity index 56% rename from spec/unit/models/message_failed_callback_message_spec.rb rename to spec/models/message_failed_callback_message_spec.rb index 20dc9a82..882a7062 100644 --- a/spec/unit/models/message_failed_callback_message_spec.rb +++ b/spec/models/message_failed_callback_message_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,73 +27,73 @@ end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "owner"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "segment_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "text"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "priority"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/message_failed_callback_spec.rb b/spec/models/message_failed_callback_spec.rb similarity index 63% rename from spec/unit/models/message_failed_callback_spec.rb rename to spec/models/message_failed_callback_spec.rb index f38f19e7..7d4db766 100644 --- a/spec/unit/models/message_failed_callback_spec.rb +++ b/spec/models/message_failed_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,37 +27,37 @@ end describe 'test attribute "time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "description"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_code"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/message_request_spec.rb b/spec/models/message_request_spec.rb similarity index 59% rename from spec/unit/models/message_request_spec.rb rename to spec/models/message_request_spec.rb index 48ff1f5c..2ea119cc 100644 --- a/spec/unit/models/message_request_spec.rb +++ b/spec/models/message_request_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,49 +27,49 @@ end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "text"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "priority"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "expiration"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/message_sending_callback_message_spec.rb b/spec/models/message_sending_callback_message_spec.rb similarity index 56% rename from spec/unit/models/message_sending_callback_message_spec.rb rename to spec/models/message_sending_callback_message_spec.rb index cbbae5b5..9a73f9ff 100644 --- a/spec/unit/models/message_sending_callback_message_spec.rb +++ b/spec/models/message_sending_callback_message_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,73 +27,73 @@ end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "owner"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "segment_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "text"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "priority"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/message_sending_callback_spec.rb b/spec/models/message_sending_callback_spec.rb similarity index 65% rename from spec/unit/models/message_sending_callback_spec.rb rename to spec/models/message_sending_callback_spec.rb index 86d18ddc..5e5fea3f 100644 --- a/spec/unit/models/message_sending_callback_spec.rb +++ b/spec/models/message_sending_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,31 +27,31 @@ end describe 'test attribute "time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "description"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/message_spec.rb b/spec/models/message_spec.rb similarity index 54% rename from spec/unit/models/message_spec.rb rename to spec/models/message_spec.rb index 07e9d580..fb433d25 100644 --- a/spec/unit/models/message_spec.rb +++ b/spec/models/message_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,79 +27,79 @@ end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "owner"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "segment_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "text"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "priority"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "expiration"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/message_status_enum_spec.rb b/spec/models/message_status_enum_spec.rb similarity index 92% rename from spec/unit/models/message_status_enum_spec.rb rename to spec/models/message_status_enum_spec.rb index bda7d8ae..13d5f333 100644 --- a/spec/unit/models/message_status_enum_spec.rb +++ b/spec/models/message_status_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/message_type_enum_spec.rb b/spec/models/message_type_enum_spec.rb similarity index 92% rename from spec/unit/models/message_type_enum_spec.rb rename to spec/models/message_type_enum_spec.rb index 4098a219..e0ead866 100644 --- a/spec/unit/models/message_type_enum_spec.rb +++ b/spec/models/message_type_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/messages_list_spec.rb b/spec/models/messages_list_spec.rb similarity index 70% rename from spec/unit/models/messages_list_spec.rb rename to spec/models/messages_list_spec.rb index 77b39926..997b22b7 100644 --- a/spec/unit/models/messages_list_spec.rb +++ b/spec/models/messages_list_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,19 +27,19 @@ end describe 'test attribute "total_count"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "page_info"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "messages"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/messaging_code_response_spec.rb b/spec/models/messaging_code_response_spec.rb similarity index 83% rename from spec/unit/models/messaging_code_response_spec.rb rename to spec/models/messaging_code_response_spec.rb index 14616f5b..d21ee2cc 100644 --- a/spec/unit/models/messaging_code_response_spec.rb +++ b/spec/models/messaging_code_response_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,7 +27,7 @@ end describe 'test attribute "message_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/messaging_request_error_spec.rb b/spec/models/messaging_request_error_spec.rb similarity index 76% rename from spec/unit/models/messaging_request_error_spec.rb rename to spec/models/messaging_request_error_spec.rb index f1d9e385..159a980b 100644 --- a/spec/unit/models/messaging_request_error_spec.rb +++ b/spec/models/messaging_request_error_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,13 +27,13 @@ end describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "description"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/mfa_forbidden_request_error_spec.rb b/spec/models/mfa_forbidden_request_error_spec.rb similarity index 83% rename from spec/unit/models/mfa_forbidden_request_error_spec.rb rename to spec/models/mfa_forbidden_request_error_spec.rb index 55505b42..71330ae1 100644 --- a/spec/unit/models/mfa_forbidden_request_error_spec.rb +++ b/spec/models/mfa_forbidden_request_error_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,7 +27,7 @@ end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/mfa_request_error_spec.rb b/spec/models/mfa_request_error_spec.rb similarity index 75% rename from spec/unit/models/mfa_request_error_spec.rb rename to spec/models/mfa_request_error_spec.rb index a0f5c357..4d4d98f7 100644 --- a/spec/unit/models/mfa_request_error_spec.rb +++ b/spec/models/mfa_request_error_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,13 +27,13 @@ end describe 'test attribute "error"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "request_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/mfa_unauthorized_request_error_spec.rb b/spec/models/mfa_unauthorized_request_error_spec.rb similarity index 83% rename from spec/unit/models/mfa_unauthorized_request_error_spec.rb rename to spec/models/mfa_unauthorized_request_error_spec.rb index 2bf0dcdc..e9521542 100644 --- a/spec/unit/models/mfa_unauthorized_request_error_spec.rb +++ b/spec/models/mfa_unauthorized_request_error_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,7 +27,7 @@ end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/page_info_spec.rb b/spec/models/page_info_spec.rb similarity index 67% rename from spec/unit/models/page_info_spec.rb rename to spec/models/page_info_spec.rb index 6e6dd97d..61f47b44 100644 --- a/spec/unit/models/page_info_spec.rb +++ b/spec/models/page_info_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,25 +27,25 @@ end describe 'test attribute "prev_page"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "next_page"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "prev_page_token"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "next_page_token"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/priority_enum_spec.rb b/spec/models/priority_enum_spec.rb similarity index 92% rename from spec/unit/models/priority_enum_spec.rb rename to spec/models/priority_enum_spec.rb index e1c8e6ba..365965d7 100644 --- a/spec/unit/models/priority_enum_spec.rb +++ b/spec/models/priority_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/recording_available_callback_spec.rb b/spec/models/recording_available_callback_spec.rb similarity index 52% rename from spec/unit/models/recording_available_callback_spec.rb rename to spec/models/recording_available_callback_spec.rb index 1fbf0f0f..d79985df 100644 --- a/spec/unit/models/recording_available_callback_spec.rb +++ b/spec/models/recording_available_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,133 +27,133 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "parent_call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "recording_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "end_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "duration"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "file_format"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "channels"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_caller_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/recording_complete_callback_spec.rb b/spec/models/recording_complete_callback_spec.rb similarity index 52% rename from spec/unit/models/recording_complete_callback_spec.rb rename to spec/models/recording_complete_callback_spec.rb index 3d70d510..4fcc6324 100644 --- a/spec/unit/models/recording_complete_callback_spec.rb +++ b/spec/models/recording_complete_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,133 +27,133 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "parent_call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "recording_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "end_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "duration"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "file_format"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "channels"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_caller_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/recording_state_enum_spec.rb b/spec/models/recording_state_enum_spec.rb similarity index 92% rename from spec/unit/models/recording_state_enum_spec.rb rename to spec/models/recording_state_enum_spec.rb index eb84b19c..5880f277 100644 --- a/spec/unit/models/recording_state_enum_spec.rb +++ b/spec/models/recording_state_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/redirect_callback_spec.rb b/spec/models/redirect_callback_spec.rb similarity index 53% rename from spec/unit/models/redirect_callback_spec.rb rename to spec/models/redirect_callback_spec.rb index 757f0cfc..7914bd54 100644 --- a/spec/unit/models/redirect_callback_spec.rb +++ b/spec/models/redirect_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,97 +27,97 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "parent_call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_caller_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/redirect_method_enum_spec.rb b/spec/models/redirect_method_enum_spec.rb similarity index 92% rename from spec/unit/models/redirect_method_enum_spec.rb rename to spec/models/redirect_method_enum_spec.rb index 33cf6632..f93245ab 100644 --- a/spec/unit/models/redirect_method_enum_spec.rb +++ b/spec/models/redirect_method_enum_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' diff --git a/spec/unit/models/stir_shaken_spec.rb b/spec/models/stir_shaken_spec.rb similarity index 71% rename from spec/unit/models/stir_shaken_spec.rb rename to spec/models/stir_shaken_spec.rb index 790625da..5ea177e3 100644 --- a/spec/unit/models/stir_shaken_spec.rb +++ b/spec/models/stir_shaken_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,19 +27,19 @@ end describe 'test attribute "verstat"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "attestation_indicator"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "originating_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/tag_spec.rb b/spec/models/tag_spec.rb similarity index 74% rename from spec/unit/models/tag_spec.rb rename to spec/models/tag_spec.rb index 14d4641b..bd8791fc 100644 --- a/spec/unit/models/tag_spec.rb +++ b/spec/models/tag_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,13 +27,13 @@ end describe 'test attribute "key"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/tn_lookup_request_error_spec.rb b/spec/models/tn_lookup_request_error_spec.rb similarity index 82% rename from spec/unit/models/tn_lookup_request_error_spec.rb rename to spec/models/tn_lookup_request_error_spec.rb index edc66fbe..970182bb 100644 --- a/spec/unit/models/tn_lookup_request_error_spec.rb +++ b/spec/models/tn_lookup_request_error_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,7 +27,7 @@ end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/transcribe_recording_spec.rb b/spec/models/transcribe_recording_spec.rb similarity index 59% rename from spec/unit/models/transcribe_recording_spec.rb rename to spec/models/transcribe_recording_spec.rb index d8ee6d72..670f7390 100644 --- a/spec/unit/models/transcribe_recording_spec.rb +++ b/spec/models/transcribe_recording_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,37 +27,43 @@ end describe 'test attribute "callback_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "callback_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "callback_timeout"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "detect_language"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/transcription_available_callback_spec.rb b/spec/models/transcription_available_callback_spec.rb similarity index 52% rename from spec/unit/models/transcription_available_callback_spec.rb rename to spec/models/transcription_available_callback_spec.rb index 15426222..b3142b02 100644 --- a/spec/unit/models/transcription_available_callback_spec.rb +++ b/spec/models/transcription_available_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,127 +27,127 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "media_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "parent_call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "recording_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "end_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "duration"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "file_format"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transcription"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_caller_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/transcription_list_spec.rb b/spec/models/transcription_list_spec.rb similarity index 82% rename from spec/unit/models/transcription_list_spec.rb rename to spec/models/transcription_list_spec.rb index a5bb273d..0f6e4c9c 100644 --- a/spec/unit/models/transcription_list_spec.rb +++ b/spec/models/transcription_list_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,7 +27,7 @@ end describe 'test attribute "transcripts"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/transcription_metadata_spec.rb b/spec/models/transcription_metadata_spec.rb similarity index 68% rename from spec/unit/models/transcription_metadata_spec.rb rename to spec/models/transcription_metadata_spec.rb index 9403dbbb..345d3180 100644 --- a/spec/unit/models/transcription_metadata_spec.rb +++ b/spec/models/transcription_metadata_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,25 +27,25 @@ end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "completed_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/transcription_spec.rb b/spec/models/transcription_spec.rb similarity index 75% rename from spec/unit/models/transcription_spec.rb rename to spec/models/transcription_spec.rb index 9a15c568..2c61d326 100644 --- a/spec/unit/models/transcription_spec.rb +++ b/spec/models/transcription_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,13 +27,13 @@ end describe 'test attribute "text"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "confidence"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/transfer_answer_callback_spec.rb b/spec/models/transfer_answer_callback_spec.rb similarity index 54% rename from spec/unit/models/transfer_answer_callback_spec.rb rename to spec/models/transfer_answer_callback_spec.rb index a4ec5baf..68a7064b 100644 --- a/spec/unit/models/transfer_answer_callback_spec.rb +++ b/spec/models/transfer_answer_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,91 +27,91 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_caller_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/transfer_complete_callback_spec.rb b/spec/models/transfer_complete_callback_spec.rb similarity index 53% rename from spec/unit/models/transfer_complete_callback_spec.rb rename to spec/models/transfer_complete_callback_spec.rb index 0d248173..a82e2cb5 100644 --- a/spec/unit/models/transfer_complete_callback_spec.rb +++ b/spec/models/transfer_complete_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,109 +27,109 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_caller_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "cause"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/transfer_disconnect_callback_spec.rb b/spec/models/transfer_disconnect_callback_spec.rb similarity index 52% rename from spec/unit/models/transfer_disconnect_callback_spec.rb rename to spec/models/transfer_disconnect_callback_spec.rb index 5eb5dbdb..75dfc0c4 100644 --- a/spec/unit/models/transfer_disconnect_callback_spec.rb +++ b/spec/models/transfer_disconnect_callback_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,121 +27,121 @@ end describe 'test attribute "event_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "event_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "account_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "application_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "from"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "direction"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "parent_call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "enqueued_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "start_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "answer_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "end_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_caller_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "transfer_to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "cause"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "error_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/update_call_recording_spec.rb b/spec/models/update_call_recording_spec.rb similarity index 82% rename from spec/unit/models/update_call_recording_spec.rb rename to spec/models/update_call_recording_spec.rb index 89b99d0d..f3518761 100644 --- a/spec/unit/models/update_call_recording_spec.rb +++ b/spec/models/update_call_recording_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,7 +27,7 @@ end describe 'test attribute "state"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/update_call_spec.rb b/spec/models/update_call_spec.rb similarity index 57% rename from spec/unit/models/update_call_spec.rb rename to spec/models/update_call_spec.rb index cfe69e23..038d5d50 100644 --- a/spec/unit/models/update_call_spec.rb +++ b/spec/models/update_call_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,61 +27,61 @@ end describe 'test attribute "state"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "redirect_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "redirect_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "redirect_fallback_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "redirect_fallback_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tag"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/update_conference_member_spec.rb b/spec/models/update_conference_member_spec.rb similarity index 72% rename from spec/unit/models/update_conference_member_spec.rb rename to spec/models/update_conference_member_spec.rb index 34067bf2..51707995 100644 --- a/spec/unit/models/update_conference_member_spec.rb +++ b/spec/models/update_conference_member_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,19 +27,19 @@ end describe 'test attribute "mute"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "hold"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "call_ids_to_coach"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/update_conference_spec.rb b/spec/models/update_conference_spec.rb similarity index 59% rename from spec/unit/models/update_conference_spec.rb rename to spec/models/update_conference_spec.rb index 189b5722..b4d495d7 100644 --- a/spec/unit/models/update_conference_spec.rb +++ b/spec/models/update_conference_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,55 +27,55 @@ end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "redirect_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "redirect_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "redirect_fallback_url"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "redirect_fallback_method"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "fallback_password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/verify_code_request_spec.rb b/spec/models/verify_code_request_spec.rb similarity index 68% rename from spec/unit/models/verify_code_request_spec.rb rename to spec/models/verify_code_request_spec.rb index b80d72c1..2b5afc89 100644 --- a/spec/unit/models/verify_code_request_spec.rb +++ b/spec/models/verify_code_request_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,25 +27,25 @@ end describe 'test attribute "to"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "scope"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "expiration_time_in_minutes"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "code"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/verify_code_response_spec.rb b/spec/models/verify_code_response_spec.rb similarity index 82% rename from spec/unit/models/verify_code_response_spec.rb rename to spec/models/verify_code_response_spec.rb index 54914ba1..d0e87540 100644 --- a/spec/unit/models/verify_code_response_spec.rb +++ b/spec/models/verify_code_response_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,7 +27,7 @@ end describe 'test attribute "valid"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/voice_api_error_spec.rb b/spec/models/voice_api_error_spec.rb similarity index 70% rename from spec/unit/models/voice_api_error_spec.rb rename to spec/models/voice_api_error_spec.rb index 3eb94b36..50566eb1 100644 --- a/spec/unit/models/voice_api_error_spec.rb +++ b/spec/models/voice_api_error_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,19 +27,19 @@ end describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "description"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/unit/models/voice_code_response_spec.rb b/spec/models/voice_code_response_spec.rb similarity index 82% rename from spec/unit/models/voice_code_response_spec.rb rename to spec/models/voice_code_response_spec.rb index fbfc3999..a9c3e5d3 100644 --- a/spec/unit/models/voice_code_response_spec.rb +++ b/spec/models/voice_code_response_spec.rb @@ -6,11 +6,11 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 +OpenAPI Generator version: 6.6.0 =end -require 'spec_helper' + require 'json' require 'date' @@ -27,7 +27,7 @@ end describe 'test attribute "call_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1b2253d6..e6672df9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -75,7 +75,7 @@ config.password = BW_PASSWORD end calls_api = Bandwidth::CallsApi.new - cleanup_calls($active_calls, calls_api) + # cleanup_calls($active_calls, calls_api) } # rspec-expectations config goes here. You can use an alternate From 446c463f1edf24b3bcc4f266ad92e9b1877705cd Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Tue, 18 Jul 2023 11:06:11 -0400 Subject: [PATCH 20/30] SWI-1771 Add Unit Tests (#103) * update spec and use 6.6 * changes we'd need to automate * newline in readme * remove config tests * revert config back to working version * regenerate with v6.5.0 * fix other files * dont try to clean up calls since voice api is slow * update spec * add custom templates and update readme badge * update test workflow name * add openapitools * add sdk update workflow * add config test file and fix it * update config test * update integration tests * Revert "update integration tests" This reverts commit 77545d90ace098e448fa6f1bebd684e38af5e927. * add client option to rakefile * update version logic and ignore file * remove unnecessary env vars from build wf * revert version change * remove unnecessary spec_helper imports * lots of small changes based on rubocop linting * update custom templates * add rubocop badge to README * add gem version badge to readme * remove unnecessary deploy action * update codeowners * update workflows * add gem version env var to test wfs * remove newlines from bxml tests * unit tests for acc stats * comment * fix eventTime data type * answer callback tests and improve * bridge callback and improve * bridge target * enum tests * test desc * delete unused spec files for unit tests * update message time to be date-time * add suite of encompassing unit tests * update gitignore * fix small logic error in bxml library * calls_api unit tests * remove unnecessary require * update calls tests to be better and add conferences tests * add webmock * move 4xx tests to client suite * skip all integration tests * skip 4xx tests for now (TODO: fix these) * rubocop linting for calls and conferences * add comment to document test skips * spacing * fix hashes * media tests * remove unnecessary flag from media integration * rubocop doesnt like my newline * add argument error tests to media * reorganizing * recordings tests * update list message item receive time * messages tests * add argument error tests to messages * fix expects * update messages * mfa tests * i can test basic auth in the client, not needed in apis * assert arrays * be_a -> be_instance_of * tnlookup tests * statistics tests * add gems to Gemfile and template * bring back statistics integration tests * bring back mfa * remove json dep * tnlookup * enforce single quotes * more quotes changes * single quotes * media * add string interpolation rule * quotes in tests * dont do config * exclude files from rubocop * ignore rubocop * messages * calls * newline * assertion cleanup * conferences * consistency * recordings * update model tests * start on client tests * configuration tests * small changes * update openapi-generator-ignore to ignore all tests * update error checking * error checking * lots of client tests * lowercase require? * use @uri * refactor to use let * use let for rest of unit tests * use let * final client tests * use let in integration tests * rubocop save me * rubocop newlines around blocks * add ApiError tests * no longer need to install hub * update unit tests * finalize workflow * add limitTotalCount (new msg param) --- .github/workflows/update-sdk.yml | 6 +- .gitignore | 2 + .openapi-generator-ignore | 5 +- .openapi-generator/FILES | 1 - .rubocop.yml | 17 +- Gemfile | 2 + Rakefile | 2 +- bandwidth-sdk.gemspec | 22 +- bandwidth.yml | 22 +- custom_templates/Gemfile.mustache | 2 + docs/AnswerCallback.md | 4 +- docs/BridgeCompleteCallback.md | 4 +- docs/BridgeTargetCompleteCallback.md | 4 +- docs/ConferenceCompletedCallback.md | 4 +- docs/ConferenceCreatedCallback.md | 4 +- docs/ConferenceMemberExitCallback.md | 4 +- docs/ConferenceMemberJoinCallback.md | 4 +- docs/ConferenceRecordingAvailableCallback.md | 4 +- docs/ConferenceRedirectCallback.md | 4 +- docs/DisconnectCallback.md | 4 +- docs/DtmfCallback.md | 4 +- docs/GatherCallback.md | 4 +- docs/InitiateCallback.md | 4 +- docs/ListMessageItem.md | 4 +- docs/MachineDetectionCompleteCallback.md | 4 +- docs/Message.md | 4 +- docs/MessagesApi.md | 4 +- docs/MessagesList.md | 2 +- docs/RecordingAvailableCallback.md | 4 +- docs/RecordingCompleteCallback.md | 4 +- docs/RedirectCallback.md | 4 +- docs/TranscriptionAvailableCallback.md | 4 +- docs/TransferAnswerCallback.md | 4 +- docs/TransferCompleteCallback.md | 4 +- docs/TransferDisconnectCallback.md | 4 +- lib/bandwidth-sdk/api/messages_api.rb | 3 + lib/bandwidth-sdk/api_error.rb | 2 +- .../models/account_statistics.rb | 2 +- lib/bandwidth-sdk/models/answer_callback.rb | 4 +- .../models/bridge_complete_callback.rb | 4 +- .../models/bridge_target_complete_callback.rb | 4 +- .../models/bxml/nestable_verb.rb | 3 +- lib/bandwidth-sdk/models/bxml/verb.rb | 3 +- lib/bandwidth-sdk/models/bxml/verbs/bridge.rb | 2 +- .../models/bxml/verbs/conference.rb | 2 +- .../models/bxml/verbs/custom_param.rb | 2 +- .../models/bxml/verbs/forward.rb | 2 +- lib/bandwidth-sdk/models/bxml/verbs/gather.rb | 2 +- lib/bandwidth-sdk/models/bxml/verbs/hangup.rb | 2 +- lib/bandwidth-sdk/models/bxml/verbs/pause.rb | 2 +- .../models/bxml/verbs/pause_recording.rb | 2 +- .../models/bxml/verbs/phone_number.rb | 2 +- .../models/bxml/verbs/play_audio.rb | 2 +- lib/bandwidth-sdk/models/bxml/verbs/record.rb | 2 +- .../models/bxml/verbs/redirect.rb | 2 +- .../models/bxml/verbs/resume_recording.rb | 2 +- lib/bandwidth-sdk/models/bxml/verbs/ring.rb | 2 +- .../models/bxml/verbs/send_dtmf.rb | 2 +- .../models/bxml/verbs/sip_uri.rb | 2 +- .../models/bxml/verbs/speak_sentence.rb | 2 +- .../models/bxml/verbs/start_gather.rb | 2 +- .../models/bxml/verbs/start_recording.rb | 2 +- .../models/bxml/verbs/start_stream.rb | 2 +- .../models/bxml/verbs/start_transcription.rb | 2 +- .../models/bxml/verbs/stop_gather.rb | 2 +- .../models/bxml/verbs/stop_recording.rb | 2 +- .../models/bxml/verbs/stop_stream.rb | 2 +- .../models/bxml/verbs/stop_transcription.rb | 2 +- .../models/bxml/verbs/stream_param.rb | 2 +- lib/bandwidth-sdk/models/bxml/verbs/tag.rb | 2 +- .../models/bxml/verbs/transfer.rb | 2 +- .../models/call_direction_enum.rb | 4 +- .../models/call_recording_metadata.rb | 2 +- lib/bandwidth-sdk/models/call_state.rb | 2 +- lib/bandwidth-sdk/models/call_state_enum.rb | 4 +- .../models/callback_method_enum.rb | 4 +- lib/bandwidth-sdk/models/code_request.rb | 2 +- lib/bandwidth-sdk/models/conference.rb | 2 +- .../models/conference_completed_callback.rb | 4 +- .../models/conference_created_callback.rb | 4 +- lib/bandwidth-sdk/models/conference_member.rb | 2 +- .../models/conference_member_exit_callback.rb | 4 +- .../models/conference_member_join_callback.rb | 4 +- ...conference_recording_available_callback.rb | 4 +- .../models/conference_recording_metadata.rb | 2 +- .../models/conference_redirect_callback.rb | 4 +- .../models/conference_state_enum.rb | 4 +- lib/bandwidth-sdk/models/create_call.rb | 2 +- .../models/create_call_response.rb | 2 +- .../models/create_lookup_response.rb | 2 +- .../models/create_message_request_error.rb | 2 +- lib/bandwidth-sdk/models/deferred_result.rb | 2 +- .../models/disconenct_callback.rb | 2 +- .../models/disconnect_callback.rb | 4 +- lib/bandwidth-sdk/models/diversion.rb | 2 +- lib/bandwidth-sdk/models/dtmf_callback.rb | 4 +- lib/bandwidth-sdk/models/field_error.rb | 2 +- lib/bandwidth-sdk/models/file_format_enum.rb | 4 +- lib/bandwidth-sdk/models/gather_callback.rb | 4 +- .../models/inbound_message_callback.rb | 2 +- .../inbound_message_callback_message.rb | 2 +- lib/bandwidth-sdk/models/initiate_callback.rb | 4 +- .../models/list_message_direction_enum.rb | 4 +- lib/bandwidth-sdk/models/list_message_item.rb | 4 +- lib/bandwidth-sdk/models/lookup_request.rb | 2 +- lib/bandwidth-sdk/models/lookup_result.rb | 2 +- lib/bandwidth-sdk/models/lookup_status.rb | 2 +- .../models/lookup_status_enum.rb | 8 +- .../machine_detection_complete_callback.rb | 4 +- .../models/machine_detection_configuration.rb | 2 +- .../models/machine_detection_mode_enum.rb | 4 +- .../models/machine_detection_result.rb | 2 +- lib/bandwidth-sdk/models/media.rb | 2 +- lib/bandwidth-sdk/models/message.rb | 4 +- .../models/message_delivered_callback.rb | 2 +- .../message_delivered_callback_message.rb | 2 +- .../models/message_direction_enum.rb | 4 +- .../models/message_failed_callback.rb | 2 +- .../models/message_failed_callback_message.rb | 2 +- lib/bandwidth-sdk/models/message_request.rb | 2 +- .../models/message_sending_callback.rb | 2 +- .../message_sending_callback_message.rb | 2 +- .../models/message_status_enum.rb | 16 +- lib/bandwidth-sdk/models/message_type_enum.rb | 4 +- lib/bandwidth-sdk/models/messages_list.rb | 4 +- .../models/messaging_code_response.rb | 2 +- .../models/messaging_request_error.rb | 2 +- .../models/mfa_forbidden_request_error.rb | 2 +- lib/bandwidth-sdk/models/mfa_request_error.rb | 2 +- .../models/mfa_unauthorized_request_error.rb | 2 +- lib/bandwidth-sdk/models/page_info.rb | 2 +- lib/bandwidth-sdk/models/priority_enum.rb | 4 +- .../models/recording_available_callback.rb | 4 +- .../models/recording_complete_callback.rb | 4 +- .../models/recording_state_enum.rb | 4 +- lib/bandwidth-sdk/models/redirect_callback.rb | 4 +- .../models/redirect_method_enum.rb | 4 +- lib/bandwidth-sdk/models/stir_shaken.rb | 2 +- lib/bandwidth-sdk/models/tag.rb | 2 +- .../models/tn_lookup_request_error.rb | 2 +- .../models/transcribe_recording.rb | 2 +- lib/bandwidth-sdk/models/transcription.rb | 2 +- .../transcription_available_callback.rb | 4 +- .../models/transcription_list.rb | 2 +- .../models/transcription_metadata.rb | 2 +- .../models/transfer_answer_callback.rb | 4 +- .../models/transfer_complete_callback.rb | 4 +- .../models/transfer_disconnect_callback.rb | 4 +- lib/bandwidth-sdk/models/update_call.rb | 2 +- .../models/update_call_recording.rb | 2 +- lib/bandwidth-sdk/models/update_conference.rb | 2 +- .../models/update_conference_member.rb | 2 +- .../models/verify_code_request.rb | 2 +- .../models/verify_code_response.rb | 2 +- lib/bandwidth-sdk/models/voice_api_error.rb | 2 +- .../models/voice_code_response.rb | 2 +- lib/bandwidth-sdk/version.rb | 2 +- spec/api/calls_api_spec.rb | 265 +++++++--- spec/api/conferences_api_spec.rb | 470 ++++++++++++----- spec/api/media_api_spec.rb | 167 +++--- spec/api/messages_api_spec.rb | 231 +++++++-- spec/api/mfa_api_spec.rb | 160 ++++-- spec/api/phone_number_lookup_api_spec.rb | 127 +++-- spec/api/recordings_api_spec.rb | 472 ++++++++++++----- spec/api/statistics_api_spec.rb | 66 ++- spec/api_client_spec.rb | 488 ++++++++++++------ spec/api_error_spec.rb | 23 + spec/call_utils.rb | 8 +- spec/configuration_spec.rb | 200 +++++-- .../integration/calls_api_integration_spec.rb | 148 +++--- .../conferences_api_integration_spec.rb | 134 ++--- .../integration/media_api_integration_spec.rb | 62 ++- .../messages_api_integration_spec.rb | 113 ++-- spec/integration/mfa_api_integration_spec.rb | 74 +-- ...hone_number_lookup_api_integration_spec.rb | 48 +- .../recordings_api_integration_spec.rb | 137 ++--- .../statistics_api_integration_spec.rb | 29 +- spec/models/account_statistics_spec.rb | 40 -- spec/models/answer_callback_spec.rb | 112 ---- spec/models/bridge_complete_callback_spec.rb | 124 ----- .../bridge_target_complete_callback_spec.rb | 106 ---- spec/models/bxml/bxml_spec.rb | 2 - spec/models/bxml/nestable_verb_spec.rb | 2 - spec/models/bxml/response_spec.rb | 2 - spec/models/bxml/verb_spec.rb | 13 - spec/models/bxml/verbs/bridge_spec.rb | 2 - spec/models/bxml/verbs/conference_spec.rb | 2 - spec/models/bxml/verbs/custom_param_spec.rb | 2 - spec/models/bxml/verbs/forward_spec.rb | 2 - spec/models/bxml/verbs/gather_spec.rb | 2 - spec/models/bxml/verbs/hangup_spec.rb | 2 - .../models/bxml/verbs/pause_recording_spec.rb | 2 - spec/models/bxml/verbs/pause_spec.rb | 2 - spec/models/bxml/verbs/phone_number_spec.rb | 2 - spec/models/bxml/verbs/play_audio_spec.rb | 2 - spec/models/bxml/verbs/record_spec.rb | 2 - spec/models/bxml/verbs/redirect_spec.rb | 2 - .../bxml/verbs/resume_recording_spec.rb | 2 - spec/models/bxml/verbs/ring_spec.rb | 2 - spec/models/bxml/verbs/send_dtmf_spec.rb | 2 - spec/models/bxml/verbs/sip_uri_spec.rb | 2 - spec/models/bxml/verbs/speak_sentence_spec.rb | 2 - spec/models/bxml/verbs/start_gather_spec.rb | 2 - .../models/bxml/verbs/start_recording_spec.rb | 2 - spec/models/bxml/verbs/start_stream_spec.rb | 2 - .../bxml/verbs/start_transcription_spec.rb | 2 - spec/models/bxml/verbs/stop_gather_spec.rb | 2 - spec/models/bxml/verbs/stop_recording_spec.rb | 2 - spec/models/bxml/verbs/stop_stream_spec.rb | 2 - .../bxml/verbs/stop_transcription_spec.rb | 2 - spec/models/bxml/verbs/stream_param_spec.rb | 2 - spec/models/bxml/verbs/tag_spec.rb | 2 - spec/models/bxml/verbs/transfer_spec.rb | 2 - spec/models/call_direction_enum_spec.rb | 28 - spec/models/call_recording_metadata_spec.rb | 136 ----- spec/models/call_state_enum_spec.rb | 26 +- spec/models/call_state_spec.rb | 307 ++++++----- spec/models/callback_method_enum_spec.rb | 28 - spec/models/code_request_spec.rb | 64 --- .../conference_completed_callback_spec.rb | 58 --- .../conference_created_callback_spec.rb | 58 --- .../conference_member_exit_callback_spec.rb | 76 --- .../conference_member_join_callback_spec.rb | 76 --- spec/models/conference_member_spec.rb | 64 --- ...rence_recording_available_callback_spec.rb | 112 ---- .../conference_recording_metadata_spec.rb | 94 ---- .../conference_redirect_callback_spec.rb | 58 --- spec/models/conference_spec.rb | 76 --- spec/models/conference_state_enum_spec.rb | 28 - spec/models/create_call_response_spec.rb | 154 ------ spec/models/create_call_spec.rb | 142 ----- spec/models/create_lookup_response_spec.rb | 40 -- .../create_message_request_error_spec.rb | 46 -- spec/models/deferred_result_spec.rb | 95 +++- spec/models/disconnect_callback_spec.rb | 130 ----- spec/models/diversion_spec.rb | 70 --- spec/models/dtmf_callback_spec.rb | 130 ----- spec/models/field_error_spec.rb | 40 -- spec/models/file_format_enum_spec.rb | 28 - spec/models/gather_callback_spec.rb | 136 ----- .../inbound_message_callback_message_spec.rb | 100 ---- spec/models/inbound_message_callback_spec.rb | 58 --- spec/models/initiate_callback_spec.rb | 100 ---- .../list_message_direction_enum_spec.rb | 28 - spec/models/list_message_item_spec.rb | 130 ----- spec/models/lookup_request_spec.rb | 34 -- spec/models/lookup_result_spec.rb | 82 --- spec/models/lookup_status_enum_spec.rb | 28 - spec/models/lookup_status_spec.rb | 52 -- ...achine_detection_complete_callback_spec.rb | 112 ---- .../machine_detection_configuration_spec.rb | 118 ----- .../machine_detection_mode_enum_spec.rb | 28 - spec/models/machine_detection_result_spec.rb | 40 -- spec/models/media_spec.rb | 46 -- ...message_delivered_callback_message_spec.rb | 100 ---- .../models/message_delivered_callback_spec.rb | 58 --- spec/models/message_direction_enum_spec.rb | 28 - .../message_failed_callback_message_spec.rb | 100 ---- spec/models/message_failed_callback_spec.rb | 64 --- spec/models/message_request_spec.rb | 76 --- .../message_sending_callback_message_spec.rb | 100 ---- spec/models/message_sending_callback_spec.rb | 58 --- spec/models/message_spec.rb | 175 ++++--- spec/models/message_status_enum_spec.rb | 28 - spec/models/message_type_enum_spec.rb | 28 - spec/models/messages_list_spec.rb | 46 -- spec/models/messaging_code_response_spec.rb | 34 -- spec/models/messaging_request_error_spec.rb | 40 -- .../mfa_forbidden_request_error_spec.rb | 34 -- spec/models/mfa_request_error_spec.rb | 40 -- .../mfa_unauthorized_request_error_spec.rb | 34 -- spec/models/page_info_spec.rb | 52 -- spec/models/priority_enum_spec.rb | 28 - .../recording_available_callback_spec.rb | 160 ------ .../recording_complete_callback_spec.rb | 160 ------ spec/models/recording_state_enum_spec.rb | 28 - spec/models/redirect_callback_spec.rb | 124 ----- spec/models/redirect_method_enum_spec.rb | 28 - spec/models/stir_shaken_spec.rb | 46 -- spec/models/tag_spec.rb | 40 -- spec/models/tn_lookup_request_error_spec.rb | 34 -- spec/models/transcribe_recording_spec.rb | 70 --- .../transcription_available_callback_spec.rb | 154 ------ spec/models/transcription_list_spec.rb | 34 -- spec/models/transcription_metadata_spec.rb | 52 -- spec/models/transcription_spec.rb | 40 -- spec/models/transfer_answer_callback_spec.rb | 118 ----- .../models/transfer_complete_callback_spec.rb | 136 ----- .../transfer_disconnect_callback_spec.rb | 148 ------ spec/models/update_call_recording_spec.rb | 34 -- spec/models/update_call_spec.rb | 88 ---- spec/models/update_conference_member_spec.rb | 46 -- spec/models/update_conference_spec.rb | 82 --- spec/models/verify_code_request_spec.rb | 142 +++-- spec/models/verify_code_response_spec.rb | 34 -- spec/models/voice_api_error_spec.rb | 46 -- spec/models/voice_code_response_spec.rb | 34 -- spec/spec_helper.rb | 74 +-- 298 files changed, 3090 insertions(+), 7638 deletions(-) create mode 100644 spec/api_error_spec.rb delete mode 100644 spec/models/account_statistics_spec.rb delete mode 100644 spec/models/answer_callback_spec.rb delete mode 100644 spec/models/bridge_complete_callback_spec.rb delete mode 100644 spec/models/bridge_target_complete_callback_spec.rb delete mode 100644 spec/models/call_direction_enum_spec.rb delete mode 100644 spec/models/call_recording_metadata_spec.rb delete mode 100644 spec/models/callback_method_enum_spec.rb delete mode 100644 spec/models/code_request_spec.rb delete mode 100644 spec/models/conference_completed_callback_spec.rb delete mode 100644 spec/models/conference_created_callback_spec.rb delete mode 100644 spec/models/conference_member_exit_callback_spec.rb delete mode 100644 spec/models/conference_member_join_callback_spec.rb delete mode 100644 spec/models/conference_member_spec.rb delete mode 100644 spec/models/conference_recording_available_callback_spec.rb delete mode 100644 spec/models/conference_recording_metadata_spec.rb delete mode 100644 spec/models/conference_redirect_callback_spec.rb delete mode 100644 spec/models/conference_spec.rb delete mode 100644 spec/models/conference_state_enum_spec.rb delete mode 100644 spec/models/create_call_response_spec.rb delete mode 100644 spec/models/create_call_spec.rb delete mode 100644 spec/models/create_lookup_response_spec.rb delete mode 100644 spec/models/create_message_request_error_spec.rb delete mode 100644 spec/models/disconnect_callback_spec.rb delete mode 100644 spec/models/diversion_spec.rb delete mode 100644 spec/models/dtmf_callback_spec.rb delete mode 100644 spec/models/field_error_spec.rb delete mode 100644 spec/models/file_format_enum_spec.rb delete mode 100644 spec/models/gather_callback_spec.rb delete mode 100644 spec/models/inbound_message_callback_message_spec.rb delete mode 100644 spec/models/inbound_message_callback_spec.rb delete mode 100644 spec/models/initiate_callback_spec.rb delete mode 100644 spec/models/list_message_direction_enum_spec.rb delete mode 100644 spec/models/list_message_item_spec.rb delete mode 100644 spec/models/lookup_request_spec.rb delete mode 100644 spec/models/lookup_result_spec.rb delete mode 100644 spec/models/lookup_status_enum_spec.rb delete mode 100644 spec/models/lookup_status_spec.rb delete mode 100644 spec/models/machine_detection_complete_callback_spec.rb delete mode 100644 spec/models/machine_detection_configuration_spec.rb delete mode 100644 spec/models/machine_detection_mode_enum_spec.rb delete mode 100644 spec/models/machine_detection_result_spec.rb delete mode 100644 spec/models/media_spec.rb delete mode 100644 spec/models/message_delivered_callback_message_spec.rb delete mode 100644 spec/models/message_delivered_callback_spec.rb delete mode 100644 spec/models/message_direction_enum_spec.rb delete mode 100644 spec/models/message_failed_callback_message_spec.rb delete mode 100644 spec/models/message_failed_callback_spec.rb delete mode 100644 spec/models/message_request_spec.rb delete mode 100644 spec/models/message_sending_callback_message_spec.rb delete mode 100644 spec/models/message_sending_callback_spec.rb delete mode 100644 spec/models/message_status_enum_spec.rb delete mode 100644 spec/models/message_type_enum_spec.rb delete mode 100644 spec/models/messages_list_spec.rb delete mode 100644 spec/models/messaging_code_response_spec.rb delete mode 100644 spec/models/messaging_request_error_spec.rb delete mode 100644 spec/models/mfa_forbidden_request_error_spec.rb delete mode 100644 spec/models/mfa_request_error_spec.rb delete mode 100644 spec/models/mfa_unauthorized_request_error_spec.rb delete mode 100644 spec/models/page_info_spec.rb delete mode 100644 spec/models/priority_enum_spec.rb delete mode 100644 spec/models/recording_available_callback_spec.rb delete mode 100644 spec/models/recording_complete_callback_spec.rb delete mode 100644 spec/models/recording_state_enum_spec.rb delete mode 100644 spec/models/redirect_callback_spec.rb delete mode 100644 spec/models/redirect_method_enum_spec.rb delete mode 100644 spec/models/stir_shaken_spec.rb delete mode 100644 spec/models/tag_spec.rb delete mode 100644 spec/models/tn_lookup_request_error_spec.rb delete mode 100644 spec/models/transcribe_recording_spec.rb delete mode 100644 spec/models/transcription_available_callback_spec.rb delete mode 100644 spec/models/transcription_list_spec.rb delete mode 100644 spec/models/transcription_metadata_spec.rb delete mode 100644 spec/models/transcription_spec.rb delete mode 100644 spec/models/transfer_answer_callback_spec.rb delete mode 100644 spec/models/transfer_complete_callback_spec.rb delete mode 100644 spec/models/transfer_disconnect_callback_spec.rb delete mode 100644 spec/models/update_call_recording_spec.rb delete mode 100644 spec/models/update_call_spec.rb delete mode 100644 spec/models/update_conference_member_spec.rb delete mode 100644 spec/models/update_conference_spec.rb delete mode 100644 spec/models/verify_code_response_spec.rb delete mode 100644 spec/models/voice_api_error_spec.rb delete mode 100644 spec/models/voice_code_response_spec.rb diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml index 4696c84b..acba3707 100644 --- a/.github/workflows/update-sdk.yml +++ b/.github/workflows/update-sdk.yml @@ -41,7 +41,7 @@ jobs: id: jira run: | JIRA_KEY=$(jq -r '.key' <<< $(curl -s -u $JIRA_USERNAME:$JIRA_TOKEN \ - -X POST https://415a76a1898d1ab9952165e173353bb1.m.pipedream.net \ + -X POST https://bandwidth-jira.atlassian.net/rest/api/2/issue \ -H "Content-Type: application/json" \ --data-binary @- << EOF { @@ -102,8 +102,6 @@ jobs: - name: Open Pull Request if: steps.build.outputs.changes run: | - sudo apt update - sudo apt-get install -y hub - hub pull-request -b Bandwidth:main -h Bandwidth:${{ steps.jira.outputs.jira-key }} -m '${{ steps.jira.outputs.jira-key }} Update SDK Based on Recent Spec Changes' -m 'Auto-generated by Update SDK Workflow' + gh pr create -B main -H Bandwidth:${{ steps.jira.outputs.jira-key }} -t '${{ steps.jira.outputs.jira-key }} Update SDK Based on Recent Spec Changes' -b 'Auto-generated by Update SDK Workflow' env: GITHUB_TOKEN: ${{ env.DX_GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 9d8a5a13..1e47cd99 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,5 @@ Gemfile.lock # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: .rvmrc + +.DS_Store diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 9ba780b9..a74a4808 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -1,8 +1,7 @@ # OpenAPI Generator Ignore # Generated by openapi-generator https://github.com/openapitools/openapi-generator -/spec/spec_helper.rb -/spec/configuration_spec.rb -/spec/api_client_spec.rb +/spec/** Rakefile .gitignore +.rubocop.yml diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 42a68b5f..b98a4270 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,6 +1,5 @@ .gitlab-ci.yml .rspec -.rubocop.yml .travis.yml Gemfile README.md diff --git a/.rubocop.yml b/.rubocop.yml index d32b2b1c..06fb0407 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -40,6 +40,9 @@ Layout/EmptyLinesAroundMethodBody: Layout/EmptyLinesAroundModuleBody: Enabled: true +Layout/EmptyLinesAroundBlockBody: + Enabled: true + Layout/FirstArgumentIndentation: Enabled: true @@ -108,9 +111,17 @@ Layout/SpaceInsideParens: Enabled: true # Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes +Style/StringLiterals: + Enabled: true + EnforcedStyle: single_quotes + Exclude: + - lib/bandwidth-sdk/api_client.rb + - lib/bandwidth-sdk/configuration.rb + +#Check quotes inside the string interpolation. +Style/StringLiteralsInInterpolation: + Enabled: true + EnforcedStyle: single_quotes # Detect hard tabs, no hard tabs. Layout/IndentationStyle: diff --git a/Gemfile b/Gemfile index 757cdcf7..ed673756 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,6 @@ group :development, :test do gem 'rake', '~> 13.0.1' gem 'pry-byebug' gem 'rubocop', '~> 1.52.0' + gem 'webmock', '~> 3.18.0' + gem 'simplecov', '~> 0.21.2' end diff --git a/Rakefile b/Rakefile index c0c3a363..55a4d0a1 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,4 @@ -require "bundler/gem_tasks" +require 'bundler/gem_tasks' begin require 'rspec/core/rake_task' diff --git a/bandwidth-sdk.gemspec b/bandwidth-sdk.gemspec index e0ab4ea7..4113fb03 100644 --- a/bandwidth-sdk.gemspec +++ b/bandwidth-sdk.gemspec @@ -12,20 +12,20 @@ OpenAPI Generator version: 6.5.0 =end -$:.push File.expand_path("../lib", __FILE__) -require "bandwidth-sdk/version" +$:.push File.expand_path('../lib', __FILE__) +require 'bandwidth-sdk/version' Gem::Specification.new do |s| - s.name = "bandwidth-sdk" + s.name = 'bandwidth-sdk' s.version = Bandwidth::VERSION s.platform = Gem::Platform::RUBY - s.authors = ["Bandwidth"] - s.email = ["dx@bandwidth.com"] - s.homepage = "https://github.com/Bandwidth/ruby-sdk" - s.summary = "Bandwidth Ruby SDK" - s.description = "The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs" - s.license = "MIT" - s.required_ruby_version = ">=2.7" + s.authors = ['Bandwidth'] + s.email = ['dx@bandwidth.com'] + s.homepage = 'https://github.com/Bandwidth/ruby-sdk' + s.summary = 'Bandwidth Ruby SDK' + s.description = 'The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs' + s.license = 'MIT' + s.required_ruby_version = '>=2.7' s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0' s.add_runtime_dependency 'faraday-multipart' @@ -36,5 +36,5 @@ Gem::Specification.new do |s| s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") s.executables = [] - s.require_paths = ["lib"] + s.require_paths = ['lib'] end diff --git a/bandwidth.yml b/bandwidth.yml index 8eb60077..cb848837 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -171,6 +171,7 @@ paths: - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/pageToken' - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/limitTotalCount' responses: '200': $ref: '#/components/responses/listMessagesResponse' @@ -1237,7 +1238,9 @@ components: properties: totalCount: type: integer - description: Total number of messages matched by the search. + description: >- + The total number of messages matched by the search. When the request + has limitTotalCount set to true this value is limited to 10,000. example: 100 pageInfo: $ref: '#/components/schemas/pageInfo' @@ -1281,6 +1284,7 @@ components: example: 9902 receiveTime: type: string + format: date-time description: The ISO 8601 datetime of the message. example: 2020-04-07T14:03:07.000Z carrierName: @@ -1411,6 +1415,7 @@ components: example: 93de2206-9669-4e07-948d-329f4b722ee2 time: type: string + format: date-time description: The datetime stamp of the message in ISO 8601 example: 2022-09-14T18:20:16.000Z segmentCount: @@ -3860,10 +3865,12 @@ components: example: bridgeComplete eventTime: type: string + format: date-time 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. + example: '2022-06-17T22:19:40.375Z' accountId: type: string description: The user account associated with the call. @@ -4952,6 +4959,19 @@ components: schema: type: integer example: 50 + limitTotalCount: + in: query + name: limitTotalCount + required: false + description: >- + When set to true, the response's totalCount field will have a maximum + value of 10,000. When set to false, or excluded, this will give an + accurate totalCount of all messages that match the provided filters. If + you are experiencing latency, try using this parameter to limit your + results. + example: true + schema: + type: boolean callId: name: callId in: path diff --git a/custom_templates/Gemfile.mustache b/custom_templates/Gemfile.mustache index 757cdcf7..ed673756 100644 --- a/custom_templates/Gemfile.mustache +++ b/custom_templates/Gemfile.mustache @@ -6,4 +6,6 @@ group :development, :test do gem 'rake', '~> 13.0.1' gem 'pry-byebug' gem 'rubocop', '~> 1.52.0' + gem 'webmock', '~> 3.18.0' + gem 'simplecov', '~> 0.21.2' end diff --git a/docs/AnswerCallback.md b/docs/AnswerCallback.md index 26ba9d9c..c3989f6b 100644 --- a/docs/AnswerCallback.md +++ b/docs/AnswerCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -26,7 +26,7 @@ require 'bandwidth-sdk' instance = Bandwidth::AnswerCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/BridgeCompleteCallback.md b/docs/BridgeCompleteCallback.md index 3d3f4497..916ef99f 100644 --- a/docs/BridgeCompleteCallback.md +++ b/docs/BridgeCompleteCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -28,7 +28,7 @@ require 'bandwidth-sdk' instance = Bandwidth::BridgeCompleteCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/BridgeTargetCompleteCallback.md b/docs/BridgeTargetCompleteCallback.md index ac369e4a..273fd538 100644 --- a/docs/BridgeTargetCompleteCallback.md +++ b/docs/BridgeTargetCompleteCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -25,7 +25,7 @@ require 'bandwidth-sdk' instance = Bandwidth::BridgeTargetCompleteCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/ConferenceCompletedCallback.md b/docs/ConferenceCompletedCallback.md index 4d70217b..5815eb66 100644 --- a/docs/ConferenceCompletedCallback.md +++ b/docs/ConferenceCompletedCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | | **name** | **String** | The user-specified name of the conference that was recorded | [optional] | | **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | @@ -17,7 +17,7 @@ require 'bandwidth-sdk' instance = Bandwidth::ConferenceCompletedCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9, name: my-conference-name, tag: exampleTag diff --git a/docs/ConferenceCreatedCallback.md b/docs/ConferenceCreatedCallback.md index 9347499b..2ddc9335 100644 --- a/docs/ConferenceCreatedCallback.md +++ b/docs/ConferenceCreatedCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | | **name** | **String** | The user-specified name of the conference that was recorded | [optional] | | **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | @@ -17,7 +17,7 @@ require 'bandwidth-sdk' instance = Bandwidth::ConferenceCreatedCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9, name: my-conference-name, tag: exampleTag diff --git a/docs/ConferenceMemberExitCallback.md b/docs/ConferenceMemberExitCallback.md index 3e978445..89479dae 100644 --- a/docs/ConferenceMemberExitCallback.md +++ b/docs/ConferenceMemberExitCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | | **name** | **String** | The user-specified name of the conference that was recorded | [optional] | | **from** | **String** | 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] | @@ -20,7 +20,7 @@ require 'bandwidth-sdk' instance = Bandwidth::ConferenceMemberExitCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9, name: my-conference-name, from: +15555555555, diff --git a/docs/ConferenceMemberJoinCallback.md b/docs/ConferenceMemberJoinCallback.md index 06c220a8..f8e2708f 100644 --- a/docs/ConferenceMemberJoinCallback.md +++ b/docs/ConferenceMemberJoinCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | | **name** | **String** | The user-specified name of the conference that was recorded | [optional] | | **from** | **String** | 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] | @@ -20,7 +20,7 @@ require 'bandwidth-sdk' instance = Bandwidth::ConferenceMemberJoinCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9, name: my-conference-name, from: +15555555555, diff --git a/docs/ConferenceRecordingAvailableCallback.md b/docs/ConferenceRecordingAvailableCallback.md index b5ea5228..4b193a68 100644 --- a/docs/ConferenceRecordingAvailableCallback.md +++ b/docs/ConferenceRecordingAvailableCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | | **name** | **String** | The user-specified name of the conference that was recorded | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | @@ -26,7 +26,7 @@ require 'bandwidth-sdk' instance = Bandwidth::ConferenceRecordingAvailableCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9, name: my-conference-name, account_id: 920012, diff --git a/docs/ConferenceRedirectCallback.md b/docs/ConferenceRedirectCallback.md index 986285fc..2b218d01 100644 --- a/docs/ConferenceRedirectCallback.md +++ b/docs/ConferenceRedirectCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] | | **name** | **String** | The user-specified name of the conference that was recorded | [optional] | | **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | @@ -17,7 +17,7 @@ require 'bandwidth-sdk' instance = Bandwidth::ConferenceRedirectCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9, name: my-conference-name, tag: exampleTag diff --git a/docs/DisconnectCallback.md b/docs/DisconnectCallback.md index 73b99c64..9f04b862 100644 --- a/docs/DisconnectCallback.md +++ b/docs/DisconnectCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -29,7 +29,7 @@ require 'bandwidth-sdk' instance = Bandwidth::DisconnectCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/DtmfCallback.md b/docs/DtmfCallback.md index 896d0b60..f2732b6b 100644 --- a/docs/DtmfCallback.md +++ b/docs/DtmfCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -29,7 +29,7 @@ require 'bandwidth-sdk' instance = Bandwidth::DtmfCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/GatherCallback.md b/docs/GatherCallback.md index 56fe3247..6489e6a2 100644 --- a/docs/GatherCallback.md +++ b/docs/GatherCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -30,7 +30,7 @@ require 'bandwidth-sdk' instance = Bandwidth::GatherCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/InitiateCallback.md b/docs/InitiateCallback.md index 2ca35c7a..e30039f8 100644 --- a/docs/InitiateCallback.md +++ b/docs/InitiateCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -24,7 +24,7 @@ require 'bandwidth-sdk' instance = Bandwidth::InitiateCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/ListMessageItem.md b/docs/ListMessageItem.md index 7e26c432..1c2b8ea1 100644 --- a/docs/ListMessageItem.md +++ b/docs/ListMessageItem.md @@ -13,7 +13,7 @@ | **message_type** | [**MessageTypeEnum**](MessageTypeEnum.md) | | [optional] | | **segment_count** | **Integer** | The number of segments the message was sent as. | [optional] | | **error_code** | **Integer** | The numeric error code of the message. | [optional] | -| **receive_time** | **String** | The ISO 8601 datetime of the message. | [optional] | +| **receive_time** | **Time** | The ISO 8601 datetime of the message. | [optional] | | **carrier_name** | **String** | The name of the carrier. Not currently supported for MMS coming soon. | [optional] | | **message_size** | **Integer** | The size of the message including message content and headers. | [optional] | | **message_length** | **Integer** | The length of the message content. | [optional] | @@ -37,7 +37,7 @@ instance = Bandwidth::ListMessageItem.new( message_type: null, segment_count: 1, error_code: 9902, - receive_time: 2020-04-07T14:03:07.000Z, + receive_time: 2020-04-07T14:03:07Z, carrier_name: other, message_size: 27, message_length: 18, diff --git a/docs/MachineDetectionCompleteCallback.md b/docs/MachineDetectionCompleteCallback.md index 3ed62de6..2b7b0ccb 100644 --- a/docs/MachineDetectionCompleteCallback.md +++ b/docs/MachineDetectionCompleteCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -26,7 +26,7 @@ require 'bandwidth-sdk' instance = Bandwidth::MachineDetectionCompleteCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/Message.md b/docs/Message.md index 5a660b2a..266db3a5 100644 --- a/docs/Message.md +++ b/docs/Message.md @@ -7,7 +7,7 @@ | **id** | **String** | The id of the message. | [optional] | | **owner** | **String** | The Bandwidth phone number associated with the message. | [optional] | | **application_id** | **String** | The application ID associated with the message. | [optional] | -| **time** | **String** | The datetime stamp of the message in ISO 8601 | [optional] | +| **time** | **Time** | The datetime stamp of the message in ISO 8601 | [optional] | | **segment_count** | **Integer** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] | | **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | [optional] | | **to** | **Array<String>** | The phone number recipients of the message. | [optional] | @@ -27,7 +27,7 @@ instance = Bandwidth::Message.new( id: 1589228074636lm4k2je7j7jklbn2, owner: +15554443333, application_id: 93de2206-9669-4e07-948d-329f4b722ee2, - time: 2022-09-14T18:20:16.000Z, + time: 2022-09-14T18:20:16Z, segment_count: 2, direction: null, to: ["+15552223333"], diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md index cfa72b67..b32f532d 100644 --- a/docs/MessagesApi.md +++ b/docs/MessagesApi.md @@ -116,7 +116,8 @@ opts = { campaign_id: 'CJEUMDK', # String | The campaign ID of the message. sort: 'sourceTn:desc', # String | The field and direction to sort by combined with a colon. Direction is either asc or desc. page_token: 'gdEewhcJLQRB5', # String | A base64 encoded value used for pagination of results. - limit: 50 # Integer | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + limit: 50, # Integer | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + limit_total_count: true # Boolean | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. } begin @@ -165,6 +166,7 @@ end | **sort** | **String** | The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional] | | **page_token** | **String** | A base64 encoded value used for pagination of results. | [optional] | | **limit** | **Integer** | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] | +| **limit_total_count** | **Boolean** | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. | [optional] | ### Return type diff --git a/docs/MessagesList.md b/docs/MessagesList.md index 515acb80..8eae4842 100644 --- a/docs/MessagesList.md +++ b/docs/MessagesList.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **total_count** | **Integer** | Total number of messages matched by the search. | [optional] | +| **total_count** | **Integer** | The total number of messages matched by the search. When the request has limitTotalCount set to true this value is limited to 10,000. | [optional] | | **page_info** | [**PageInfo**](PageInfo.md) | | [optional] | | **messages** | [**Array<ListMessageItem>**](ListMessageItem.md) | | [optional] | diff --git a/docs/RecordingAvailableCallback.md b/docs/RecordingAvailableCallback.md index d76a7576..1d8527ee 100644 --- a/docs/RecordingAvailableCallback.md +++ b/docs/RecordingAvailableCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -34,7 +34,7 @@ require 'bandwidth-sdk' instance = Bandwidth::RecordingAvailableCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/RecordingCompleteCallback.md b/docs/RecordingCompleteCallback.md index cf25723b..29ccb1b7 100644 --- a/docs/RecordingCompleteCallback.md +++ b/docs/RecordingCompleteCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -34,7 +34,7 @@ require 'bandwidth-sdk' instance = Bandwidth::RecordingCompleteCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/RedirectCallback.md b/docs/RedirectCallback.md index 1a29f0f0..4d433b30 100644 --- a/docs/RedirectCallback.md +++ b/docs/RedirectCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -28,7 +28,7 @@ require 'bandwidth-sdk' instance = Bandwidth::RedirectCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/TranscriptionAvailableCallback.md b/docs/TranscriptionAvailableCallback.md index a4e1b40e..e5b28e5c 100644 --- a/docs/TranscriptionAvailableCallback.md +++ b/docs/TranscriptionAvailableCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -33,7 +33,7 @@ require 'bandwidth-sdk' instance = Bandwidth::TranscriptionAvailableCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/TransferAnswerCallback.md b/docs/TransferAnswerCallback.md index 86cda344..b1b09035 100644 --- a/docs/TransferAnswerCallback.md +++ b/docs/TransferAnswerCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -27,7 +27,7 @@ require 'bandwidth-sdk' instance = Bandwidth::TransferAnswerCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/TransferCompleteCallback.md b/docs/TransferCompleteCallback.md index 5b6b2062..b4c530cc 100644 --- a/docs/TransferCompleteCallback.md +++ b/docs/TransferCompleteCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -30,7 +30,7 @@ require 'bandwidth-sdk' instance = Bandwidth::TransferCompleteCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/docs/TransferDisconnectCallback.md b/docs/TransferDisconnectCallback.md index 5c323d3f..8933cc88 100644 --- a/docs/TransferDisconnectCallback.md +++ b/docs/TransferDisconnectCallback.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] | -| **event_time** | **String** | 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] | +| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] | | **account_id** | **String** | The user account associated with the call. | [optional] | | **application_id** | **String** | The id of the application associated with the call. | [optional] | | **from** | **String** | 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] | @@ -32,7 +32,7 @@ require 'bandwidth-sdk' instance = Bandwidth::TransferDisconnectCallback.new( event_type: bridgeComplete, - event_time: null, + event_time: 2022-06-17T22:19:40.375Z, account_id: 920012, application_id: 04e88489-df02-4e34-a0ee-27a91849555f, from: +15555555555, diff --git a/lib/bandwidth-sdk/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb index 56de282b..61f2f3bc 100644 --- a/lib/bandwidth-sdk/api/messages_api.rb +++ b/lib/bandwidth-sdk/api/messages_api.rb @@ -111,6 +111,7 @@ def create_message_with_http_info(account_id, message_request, opts = {}) # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. # @option opts [String] :page_token A base64 encoded value used for pagination of results. # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + # @option opts [Boolean] :limit_total_count When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. # @return [MessagesList] def list_messages(account_id, opts = {}) data, _status_code, _headers = list_messages_with_http_info(account_id, opts) @@ -135,6 +136,7 @@ def list_messages(account_id, opts = {}) # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. # @option opts [String] :page_token A base64 encoded value used for pagination of results. # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + # @option opts [Boolean] :limit_total_count When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. # @return [Array<(MessagesList, Integer, Hash)>] MessagesList data, response status code and response headers def list_messages_with_http_info(account_id, opts = {}) if @api_client.config.debugging @@ -163,6 +165,7 @@ def list_messages_with_http_info(account_id, opts = {}) query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'limitTotalCount'] = opts[:'limit_total_count'] if !opts[:'limit_total_count'].nil? # header parameters header_params = opts[:header_params] || {} diff --git a/lib/bandwidth-sdk/api_error.rb b/lib/bandwidth-sdk/api_error.rb index f78c9947..0d976daf 100644 --- a/lib/bandwidth-sdk/api_error.rb +++ b/lib/bandwidth-sdk/api_error.rb @@ -43,7 +43,7 @@ def to_s def message if @message.nil? - msg = "Error message: the server returns an error" + msg = 'Error message: the server returns an error' else msg = @message end diff --git a/lib/bandwidth-sdk/models/account_statistics.rb b/lib/bandwidth-sdk/models/account_statistics.rb index 8179002e..d0a984b6 100644 --- a/lib/bandwidth-sdk/models/account_statistics.rb +++ b/lib/bandwidth-sdk/models/account_statistics.rb @@ -52,7 +52,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::AccountStatistics` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::AccountStatistics` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/answer_callback.rb b/lib/bandwidth-sdk/models/answer_callback.rb index 57e92815..15a7ea15 100644 --- a/lib/bandwidth-sdk/models/answer_callback.rb +++ b/lib/bandwidth-sdk/models/answer_callback.rb @@ -107,7 +107,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -137,7 +137,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::AnswerCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::AnswerCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/bridge_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_complete_callback.rb index b86c9a5b..d22cd347 100644 --- a/lib/bandwidth-sdk/models/bridge_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_complete_callback.rb @@ -116,7 +116,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -149,7 +149,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::BridgeCompleteCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BridgeCompleteCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb index 16860dce..4f2aa82d 100644 --- a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb @@ -104,7 +104,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -132,7 +132,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::BridgeTargetCompleteCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BridgeTargetCompleteCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/bxml/nestable_verb.rb b/lib/bandwidth-sdk/models/bxml/nestable_verb.rb index a5b1aa07..9b217455 100644 --- a/lib/bandwidth-sdk/models/bxml/nestable_verb.rb +++ b/lib/bandwidth-sdk/models/bxml/nestable_verb.rb @@ -15,7 +15,6 @@ def initialize(tag, content = nil, nested_verbs = [], attributes = {}) @content = content @nested_verbs = nested_verbs @attributes = attributes - @attribute_map = [] end # Generate an XML element for the verb @@ -32,7 +31,7 @@ def generate_xml end end - if !@attributes.empty? + if !@attributes.empty? && !@attribute_map.nil? @attributes.each do |key, value| if @attribute_map.include? key.to_sym root[@attribute_map[key.to_sym]] = value diff --git a/lib/bandwidth-sdk/models/bxml/verb.rb b/lib/bandwidth-sdk/models/bxml/verb.rb index 3c90e473..16a3c8eb 100644 --- a/lib/bandwidth-sdk/models/bxml/verb.rb +++ b/lib/bandwidth-sdk/models/bxml/verb.rb @@ -11,7 +11,6 @@ def initialize(tag, content = nil, attributes = {}) @tag = tag @content = content @attributes = attributes - @attribute_map = [] end # Set XML attributes for the verb @@ -28,7 +27,7 @@ def generate_xml root << @content end - if !@attributes.empty? + if !@attributes.empty? && !@attribute_map.nil? @attributes.each do |key, value| if @attribute_map.include? key.to_sym root[@attribute_map[key.to_sym]] = value diff --git a/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb b/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb index 73cb15ae..8068ee07 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb @@ -7,7 +7,7 @@ class Bridge # @param target_call [String] The callId of the call to be bridged. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(target_call, attributes = {}) - super("Bridge", target_call, attributes) + super('Bridge', target_call, attributes) @attribute_map = { bridge_complete_url: 'bridgeCompleteUrl', # Optional [String]: URL to send the Bridge Complete event to and request new BXML. If this attribute is specified, then Verbs following the verb will be ignored and the BXML returned in this webhook is executed on the call. If this attribute is not specified then no webhook will be sent, and execution of the verbs following the verb continues. May be a relative URL. Defaults to None. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/conference.rb b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb index 1b79c950..08333eda 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/conference.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb @@ -7,7 +7,7 @@ class Conference # @param name [String] The name of the conference. Can contain up to 100 characters of letters, numbers, and the symbols -, _, and . # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(name, attributes = {}) - super("Conference", name, attributes) + super('Conference', name, attributes) @attribute_map = { mute: 'mute', # Optional [Boolean]: A boolean value to indicate whether the member should be on mute in the conference. When muted, a member can hear others speak, but others cannot hear them speak. Defaults to false. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb b/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb index 3c83d710..46d8f171 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb @@ -6,7 +6,7 @@ class CustomParam # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) - super("CustomParam", nil, attributes) + super('CustomParam', nil, attributes) @attribute_map = { name: 'name', # [String]: The name of this parameter, up to 256 characters. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/forward.rb b/lib/bandwidth-sdk/models/bxml/verbs/forward.rb index 6852764d..18567ab3 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/forward.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/forward.rb @@ -6,7 +6,7 @@ class Forward # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) - super("Forward", nil, attributes) + super('Forward', nil, attributes) @attribute_map = { to: 'to', # [String]: The phone number destination of the call. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb index 41d4ff33..d780b310 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb @@ -7,7 +7,7 @@ class Gather # @param audio_verbs [Array] XML element children. Defaults to an empty array. Valid nested audio verbs are: SpeakSentence, PlayAudio. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(audio_verbs = [], attributes = {}) - super("Gather", nil, audio_verbs, attributes) + super('Gather', nil, audio_verbs, attributes) @attribute_map = { gather_url: 'gatherUrl', # Optional [String]: URL to send Gather event to and request new BXML. May be a relative URL. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb b/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb index 3b0a5aad..51325abe 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb @@ -5,7 +5,7 @@ class Hangup # Initializer def initialize - super("Hangup", nil, {}) + super('Hangup', nil, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/pause.rb b/lib/bandwidth-sdk/models/bxml/verbs/pause.rb index 14c03fd2..981aeba4 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/pause.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/pause.rb @@ -6,7 +6,7 @@ class Pause # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) - super("Pause", nil, attributes) + super('Pause', nil, attributes) @attribute_map = { duration: 'duration', # Optional [Number]: The time in seconds to pause. Default value is 1. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb index 24d8f6ed..8ce4990f 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb @@ -5,7 +5,7 @@ class PauseRecording # Initializer def initialize - super("PauseRecording", nil, {}) + super('PauseRecording', nil, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb b/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb index 3b82ef23..b9f6b49d 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb @@ -7,7 +7,7 @@ class PhoneNumber # @param number [String] A phone number to transfer the call to. Value must be in E.164 format (e.g. +15555555555). # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(number, attributes = {}) - super("PhoneNumber", number, attributes) + super('PhoneNumber', number, attributes) @attribute_map = { transfer_answer_url: 'transferAnswerUrl', # Optional [String]: URL, if any, to send the Transfer Answer event to and request BXML to be executed for the called party before the call is bridged. May be a relative URL. Defaults to None. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb b/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb index 93f86073..640fe37b 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb @@ -7,7 +7,7 @@ class PlayAudio # @param audio_uri [String] The URL of the audio file to play. May be a relative URL. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(audio_uri, attributes = {}) - super("PlayAudio", audio_uri, attributes) + super('PlayAudio', audio_uri, attributes) @attribute_map = { username: 'username', # Optional [String]: The username to send in the HTTP request to audio_uri. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/record.rb b/lib/bandwidth-sdk/models/bxml/verbs/record.rb index d1d01e6c..86f7b317 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/record.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/record.rb @@ -6,7 +6,7 @@ class Record # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) - super("Record", nil, attributes) + super('Record', nil, attributes) @attribute_map = { record_complete_url: 'recordCompleteUrl', # Optional [String]: URL to send the Record Complete event to once the recording has ended. Accepts BXML, and may be a relative URL. This callback will not be sent if the recording ended due to the call hanging up. Defaults to None. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb b/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb index d5d29ecb..63c8c958 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb @@ -6,7 +6,7 @@ class Redirect # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) - super("Redirect", nil, attributes) + super('Redirect', nil, attributes) @attribute_map = { redirect_url: 'redirectUrl', # [String]: URL to request new BXML from. A Redirect event will be sent to this endpoint. May be a relative URL. Defaults to None. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb index e2ff1aea..9e516865 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb @@ -5,7 +5,7 @@ class ResumeRecording # Initializer def initialize - super("ResumeRecording", nil, {}) + super('ResumeRecording', nil, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/ring.rb b/lib/bandwidth-sdk/models/bxml/verbs/ring.rb index cfc1d196..0006cf55 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/ring.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/ring.rb @@ -6,7 +6,7 @@ class Ring # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) - super("Ring", nil, attributes) + super('Ring', nil, attributes) @attribute_map = { duration: 'duration', # Optional [Number]: How many seconds to play ringing on the call. Default value is 5. Range: decimal values between 0.1 - 86400. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb b/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb index cbe673d7..fdc04c6e 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb @@ -7,7 +7,7 @@ class SendDtmf # @param digits [String] String containing the DTMF characters to be sent in a call. Allows a maximum of 50 characters. The digits will be sent one-by-one with a marginal delay. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(digits, attributes = {}) - super("SendDtmf", digits, attributes) + super('SendDtmf', digits, attributes) @attribute_map = { tone_duration: 'toneDuration', # Optional [Number]: The length (in milliseconds) of each DTMF tone. Default value is 200. Range: decimal values between 50 - 5000. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb b/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb index 9f320f29..09863a22 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb @@ -7,7 +7,7 @@ class SipUri # @param uri [String] A SIP URI to transfer the call to (e.g. sip:user@server.com) # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(uri, attributes = {}) - super("SipUri", uri, attributes) + super('SipUri', uri, attributes) @attribute_map = { uui: 'uui', # Optional [String]: The value of the User-To-User header to send within the initial INVITE. Must include the encoding parameter as specified in RFC 7433. Only base64 and jwt encoding are currently allowed. This value, including the encoding specifier, may not exceed 256 characters. Defaults to None. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb index 934ec567..030239df 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb @@ -7,7 +7,7 @@ class SpeakSentence # @param text [String] The text to speak. Cannot be blank. Can be a mixture of plain text and SSML tags. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(text, attributes = {}) - super("SpeakSentence", text, attributes) + super('SpeakSentence', text, attributes) @attribute_map = { voice: 'voice', # Optional [String]: Selects the voice of the speaker. If the voice attribute is present, gender and locale are ignored. You can find a list of supported voices here: https://dev.bandwidth.com/docs/voice/bxml/speakSentence/#supported-voices diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb index 9571e642..b0f17a71 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb @@ -6,7 +6,7 @@ class StartGather # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) - super("StartGather", nil, attributes) + super('StartGather', nil, attributes) @attribute_map = { dtmf_url: 'dtmfUrl', # [String]: URL to send the DTMF event to. May be a relative URL. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb index b1c4748e..5e2d14c7 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb @@ -6,7 +6,7 @@ class StartRecording # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) - super("StartRecording", nil, attributes) + super('StartRecording', nil, attributes) @attribute_map = { recording_available_url: 'recordingAvailableUrl', # Optional [String]: URL to send the Recording Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb index d7ba9fdd..3b27f3e3 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb @@ -7,7 +7,7 @@ class StartStream # @param stream_params [Array] XML element children. Defaults to an empty array. Valid nested stream params are: StreamParam. You may specify up to 12 elements nested within a tag. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(stream_params = [], attributes = {}) - super("StartStream", nil, stream_params, attributes) + super('StartStream', nil, stream_params, attributes) @attribute_map = { name: 'name', # Optional [String]: A name to refer to this stream by. Used when sending . If not provided, it will default to the generated stream id as sent in the Media Stream Started webhook. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb index 50e3a6ac..6b7dfceb 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb @@ -7,7 +7,7 @@ class StartTranscription # @param custom_params [Array] XML element children. Defaults to an empty array. Valid nested custom params are: CustomParam. You may specify up to 12 elements nested within a tag. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(custom_params = [], attributes = {}) - super("StartTranscription", nil, custom_params, attributes) + super('StartTranscription', nil, custom_params, attributes) @attribute_map = { name: 'name', # Optional [String]: A name to refer to this transcription by. Used when sending . If not provided, it will default to the generated transcription id as sent in the Real-Time Transcription Started webhook. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb index 700d9e83..4442c998 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb @@ -5,7 +5,7 @@ class StopGather # Initializer def initialize - super("StopGather", nil, {}) + super('StopGather', nil, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb index ac870044..a3c78ac4 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb @@ -5,7 +5,7 @@ class StopRecording # Initializer def initialize - super("StopRecording", nil, {}) + super('StopRecording', nil, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb index 45896261..9ba7a0f0 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb @@ -6,7 +6,7 @@ class StopStream # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) - super("StopStream", nil, attributes) + super('StopStream', nil, attributes) @attribute_map = { name: 'name' # [String]: The name of the stream to stop. This is either the user selected name when sending the verb, or the system generated name returned in the Media Stream Started webhook if was sent with no name attribute. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb index 24c481f4..a2803cfb 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb @@ -6,7 +6,7 @@ class StopTranscription # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) - super("StopTranscription", nil, attributes) + super('StopTranscription', nil, attributes) @attribute_map = { name: 'name' # [String]: The name of the real-time transcription to stop. This is either the user selected name when sending the verb, or the system generated name returned in the Real-Time Transcription Started webhook if was sent with no name attribute. If no name is specified, then all active call transcriptions will be stopped. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb b/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb index 9962cf01..a1fd7ea9 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb @@ -6,7 +6,7 @@ class StreamParam # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) - super("StreamParam", nil, attributes) + super('StreamParam', nil, attributes) @attribute_map = { name: 'name', # [String]: The name of this parameter, up to 256 characters. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/tag.rb b/lib/bandwidth-sdk/models/bxml/verbs/tag.rb index 956a0725..a58c45a0 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/tag.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/tag.rb @@ -6,7 +6,7 @@ class Tag # Initializer # @param content [String] Custom tag value. Defaults to nil. def initialize(content = nil) - super("Tag", content, {}) + super('Tag', content, {}) end end end diff --git a/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb b/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb index 5a0f1f0d..7b94c4e3 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb @@ -7,7 +7,7 @@ class Transfer # @param transfer_to [Array] XML element children. Defaults to an empty array. Valid nested transfer verbs are: PhoneNumber, SipUri. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(transfer_to = [], attributes = {}) - super("Transfer", nil, transfer_to, attributes) + super('Transfer', nil, transfer_to, attributes) @attribute_map = { transfer_caller_id: 'transferCallerId', # Optional [String]: The caller ID to use when the call is transferred, if different. Must be in E.164 format (e.g. +15555555555) or be one of the following strings Restricted, Anonymous, Private, or Unavailable. Leave as default to pass along the number of the remote party. Defaults to None. diff --git a/lib/bandwidth-sdk/models/call_direction_enum.rb b/lib/bandwidth-sdk/models/call_direction_enum.rb index b5d4913d..05694dc8 100644 --- a/lib/bandwidth-sdk/models/call_direction_enum.rb +++ b/lib/bandwidth-sdk/models/call_direction_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class CallDirectionEnum - INBOUND = "inbound".freeze - OUTBOUND = "outbound".freeze + INBOUND = 'inbound'.freeze + OUTBOUND = 'outbound'.freeze def self.all_vars @all_vars ||= [INBOUND, OUTBOUND].freeze diff --git a/lib/bandwidth-sdk/models/call_recording_metadata.rb b/lib/bandwidth-sdk/models/call_recording_metadata.rb index 10a93a08..6dbb56a0 100644 --- a/lib/bandwidth-sdk/models/call_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/call_recording_metadata.rb @@ -153,7 +153,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CallRecordingMetadata` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CallRecordingMetadata` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/call_state.rb b/lib/bandwidth-sdk/models/call_state.rb index 1c3dd149..efe8db13 100644 --- a/lib/bandwidth-sdk/models/call_state.rb +++ b/lib/bandwidth-sdk/models/call_state.rb @@ -163,7 +163,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CallState` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CallState` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/call_state_enum.rb b/lib/bandwidth-sdk/models/call_state_enum.rb index 5671ca9b..3972a42e 100644 --- a/lib/bandwidth-sdk/models/call_state_enum.rb +++ b/lib/bandwidth-sdk/models/call_state_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class CallStateEnum - ACTIVE = "active".freeze - COMPLETED = "completed".freeze + ACTIVE = 'active'.freeze + COMPLETED = 'completed'.freeze def self.all_vars @all_vars ||= [ACTIVE, COMPLETED].freeze diff --git a/lib/bandwidth-sdk/models/callback_method_enum.rb b/lib/bandwidth-sdk/models/callback_method_enum.rb index 270ba6be..5f6e1fd9 100644 --- a/lib/bandwidth-sdk/models/callback_method_enum.rb +++ b/lib/bandwidth-sdk/models/callback_method_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class CallbackMethodEnum - GET = "GET".freeze - POST = "POST".freeze + GET = 'GET'.freeze + POST = 'POST'.freeze def self.all_vars @all_vars ||= [GET, POST].freeze diff --git a/lib/bandwidth-sdk/models/code_request.rb b/lib/bandwidth-sdk/models/code_request.rb index ca5bc4b1..aac1f586 100644 --- a/lib/bandwidth-sdk/models/code_request.rb +++ b/lib/bandwidth-sdk/models/code_request.rb @@ -72,7 +72,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CodeRequest` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CodeRequest` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/conference.rb b/lib/bandwidth-sdk/models/conference.rb index 49e842be..4730f092 100644 --- a/lib/bandwidth-sdk/models/conference.rb +++ b/lib/bandwidth-sdk/models/conference.rb @@ -108,7 +108,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Conference` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Conference` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/conference_completed_callback.rb b/lib/bandwidth-sdk/models/conference_completed_callback.rb index 8122d9ef..c5b52d8e 100644 --- a/lib/bandwidth-sdk/models/conference_completed_callback.rb +++ b/lib/bandwidth-sdk/models/conference_completed_callback.rb @@ -51,7 +51,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'conference_id' => :'String', :'name' => :'String', :'tag' => :'String' @@ -69,7 +69,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceCompletedCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceCompletedCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/conference_created_callback.rb b/lib/bandwidth-sdk/models/conference_created_callback.rb index 97acf102..599acd96 100644 --- a/lib/bandwidth-sdk/models/conference_created_callback.rb +++ b/lib/bandwidth-sdk/models/conference_created_callback.rb @@ -51,7 +51,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'conference_id' => :'String', :'name' => :'String', :'tag' => :'String' @@ -69,7 +69,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceCreatedCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceCreatedCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/conference_member.rb b/lib/bandwidth-sdk/models/conference_member.rb index 21d99121..b57a684b 100644 --- a/lib/bandwidth-sdk/models/conference_member.rb +++ b/lib/bandwidth-sdk/models/conference_member.rb @@ -73,7 +73,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceMember` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceMember` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb index a1e0fbfc..2481d04b 100644 --- a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb @@ -63,7 +63,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'conference_id' => :'String', :'name' => :'String', :'from' => :'String', @@ -84,7 +84,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceMemberExitCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceMemberExitCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/conference_member_join_callback.rb b/lib/bandwidth-sdk/models/conference_member_join_callback.rb index 4280fd41..93ed79ed 100644 --- a/lib/bandwidth-sdk/models/conference_member_join_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_join_callback.rb @@ -63,7 +63,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'conference_id' => :'String', :'name' => :'String', :'from' => :'String', @@ -84,7 +84,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceMemberJoinCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceMemberJoinCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb index ecf69bd5..f98d1fe4 100644 --- a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb @@ -108,7 +108,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'conference_id' => :'String', :'name' => :'String', :'account_id' => :'String', @@ -136,7 +136,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceRecordingAvailableCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceRecordingAvailableCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/conference_recording_metadata.rb b/lib/bandwidth-sdk/models/conference_recording_metadata.rb index ce7db7af..1db9827d 100644 --- a/lib/bandwidth-sdk/models/conference_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/conference_recording_metadata.rb @@ -119,7 +119,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceRecordingMetadata` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceRecordingMetadata` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/conference_redirect_callback.rb b/lib/bandwidth-sdk/models/conference_redirect_callback.rb index e22e745a..3611a0fb 100644 --- a/lib/bandwidth-sdk/models/conference_redirect_callback.rb +++ b/lib/bandwidth-sdk/models/conference_redirect_callback.rb @@ -51,7 +51,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'conference_id' => :'String', :'name' => :'String', :'tag' => :'String' @@ -69,7 +69,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ConferenceRedirectCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceRedirectCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/conference_state_enum.rb b/lib/bandwidth-sdk/models/conference_state_enum.rb index c4a7c846..56b59be3 100644 --- a/lib/bandwidth-sdk/models/conference_state_enum.rb +++ b/lib/bandwidth-sdk/models/conference_state_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class ConferenceStateEnum - ACTIVE = "active".freeze - COMPLETED = "completed".freeze + ACTIVE = 'active'.freeze + COMPLETED = 'completed'.freeze def self.all_vars @all_vars ||= [ACTIVE, COMPLETED].freeze diff --git a/lib/bandwidth-sdk/models/create_call.rb b/lib/bandwidth-sdk/models/create_call.rb index e58fcb08..b729affd 100644 --- a/lib/bandwidth-sdk/models/create_call.rb +++ b/lib/bandwidth-sdk/models/create_call.rb @@ -169,7 +169,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateCall` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateCall` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/create_call_response.rb b/lib/bandwidth-sdk/models/create_call_response.rb index 57b03e1f..47ad1957 100644 --- a/lib/bandwidth-sdk/models/create_call_response.rb +++ b/lib/bandwidth-sdk/models/create_call_response.rb @@ -178,7 +178,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateCallResponse` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateCallResponse` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/create_lookup_response.rb b/lib/bandwidth-sdk/models/create_lookup_response.rb index 377dd43b..c1afe401 100644 --- a/lib/bandwidth-sdk/models/create_lookup_response.rb +++ b/lib/bandwidth-sdk/models/create_lookup_response.rb @@ -74,7 +74,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateLookupResponse` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateLookupResponse` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/create_message_request_error.rb b/lib/bandwidth-sdk/models/create_message_request_error.rb index 06082141..db466f5a 100644 --- a/lib/bandwidth-sdk/models/create_message_request_error.rb +++ b/lib/bandwidth-sdk/models/create_message_request_error.rb @@ -54,7 +54,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::CreateMessageRequestError` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateMessageRequestError` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/deferred_result.rb b/lib/bandwidth-sdk/models/deferred_result.rb index cf160dd1..39f7e9a0 100644 --- a/lib/bandwidth-sdk/models/deferred_result.rb +++ b/lib/bandwidth-sdk/models/deferred_result.rb @@ -50,7 +50,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::DeferredResult` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::DeferredResult` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/disconenct_callback.rb b/lib/bandwidth-sdk/models/disconenct_callback.rb index 5578eb0f..b6b16e44 100644 --- a/lib/bandwidth-sdk/models/disconenct_callback.rb +++ b/lib/bandwidth-sdk/models/disconenct_callback.rb @@ -154,7 +154,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::DisconenctCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::DisconenctCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/disconnect_callback.rb b/lib/bandwidth-sdk/models/disconnect_callback.rb index 38c2d5df..72ff8110 100644 --- a/lib/bandwidth-sdk/models/disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/disconnect_callback.rb @@ -120,7 +120,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -154,7 +154,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::DisconnectCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::DisconnectCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/diversion.rb b/lib/bandwidth-sdk/models/diversion.rb index 7eca346f..5b475591 100644 --- a/lib/bandwidth-sdk/models/diversion.rb +++ b/lib/bandwidth-sdk/models/diversion.rb @@ -77,7 +77,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Diversion` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Diversion` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/dtmf_callback.rb b/lib/bandwidth-sdk/models/dtmf_callback.rb index 0a47cc40..9454c09e 100644 --- a/lib/bandwidth-sdk/models/dtmf_callback.rb +++ b/lib/bandwidth-sdk/models/dtmf_callback.rb @@ -120,7 +120,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -152,7 +152,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::DtmfCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::DtmfCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/field_error.rb b/lib/bandwidth-sdk/models/field_error.rb index 925a67c3..dfc3448c 100644 --- a/lib/bandwidth-sdk/models/field_error.rb +++ b/lib/bandwidth-sdk/models/field_error.rb @@ -52,7 +52,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::FieldError` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::FieldError` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/file_format_enum.rb b/lib/bandwidth-sdk/models/file_format_enum.rb index 6ff3c424..3cb74bdb 100644 --- a/lib/bandwidth-sdk/models/file_format_enum.rb +++ b/lib/bandwidth-sdk/models/file_format_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class FileFormatEnum - MP3 = "mp3".freeze - WAV = "wav".freeze + MP3 = 'mp3'.freeze + WAV = 'wav'.freeze def self.all_vars @all_vars ||= [MP3, WAV].freeze diff --git a/lib/bandwidth-sdk/models/gather_callback.rb b/lib/bandwidth-sdk/models/gather_callback.rb index 85712493..af79fd01 100644 --- a/lib/bandwidth-sdk/models/gather_callback.rb +++ b/lib/bandwidth-sdk/models/gather_callback.rb @@ -124,7 +124,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -157,7 +157,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::GatherCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::GatherCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/inbound_message_callback.rb b/lib/bandwidth-sdk/models/inbound_message_callback.rb index 7151f2ee..4b94c7a2 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback.rb @@ -63,7 +63,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::InboundMessageCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::InboundMessageCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb index 718f48e2..a90f2eb7 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb @@ -113,7 +113,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::InboundMessageCallbackMessage` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::InboundMessageCallbackMessage` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/initiate_callback.rb b/lib/bandwidth-sdk/models/initiate_callback.rb index cc6196f5..1134e1f9 100644 --- a/lib/bandwidth-sdk/models/initiate_callback.rb +++ b/lib/bandwidth-sdk/models/initiate_callback.rb @@ -98,7 +98,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -122,7 +122,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::InitiateCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::InitiateCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/list_message_direction_enum.rb b/lib/bandwidth-sdk/models/list_message_direction_enum.rb index c27dd165..93c5348e 100644 --- a/lib/bandwidth-sdk/models/list_message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/list_message_direction_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class ListMessageDirectionEnum - INBOUND = "INBOUND".freeze - OUTBOUND = "OUTBOUND".freeze + INBOUND = 'INBOUND'.freeze + OUTBOUND = 'OUTBOUND'.freeze def self.all_vars @all_vars ||= [INBOUND, OUTBOUND].freeze diff --git a/lib/bandwidth-sdk/models/list_message_item.rb b/lib/bandwidth-sdk/models/list_message_item.rb index 788f143d..832ad537 100644 --- a/lib/bandwidth-sdk/models/list_message_item.rb +++ b/lib/bandwidth-sdk/models/list_message_item.rb @@ -125,7 +125,7 @@ def self.openapi_types :'message_type' => :'MessageTypeEnum', :'segment_count' => :'Integer', :'error_code' => :'Integer', - :'receive_time' => :'String', + :'receive_time' => :'Time', :'carrier_name' => :'String', :'message_size' => :'Integer', :'message_length' => :'Integer', @@ -152,7 +152,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::ListMessageItem` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ListMessageItem` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/lookup_request.rb b/lib/bandwidth-sdk/models/lookup_request.rb index 32816f65..e8128566 100644 --- a/lib/bandwidth-sdk/models/lookup_request.rb +++ b/lib/bandwidth-sdk/models/lookup_request.rb @@ -47,7 +47,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::LookupRequest` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::LookupRequest` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/lookup_result.rb b/lib/bandwidth-sdk/models/lookup_result.rb index 8daf5811..22108bc3 100644 --- a/lib/bandwidth-sdk/models/lookup_result.rb +++ b/lib/bandwidth-sdk/models/lookup_result.rb @@ -88,7 +88,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::LookupResult` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::LookupResult` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/lookup_status.rb b/lib/bandwidth-sdk/models/lookup_status.rb index 0cde0b18..8962f4cc 100644 --- a/lib/bandwidth-sdk/models/lookup_status.rb +++ b/lib/bandwidth-sdk/models/lookup_status.rb @@ -84,7 +84,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::LookupStatus` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::LookupStatus` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/lookup_status_enum.rb b/lib/bandwidth-sdk/models/lookup_status_enum.rb index 551dcbb1..145152e1 100644 --- a/lib/bandwidth-sdk/models/lookup_status_enum.rb +++ b/lib/bandwidth-sdk/models/lookup_status_enum.rb @@ -15,10 +15,10 @@ module Bandwidth class LookupStatusEnum - IN_PROGRESS = "IN_PROGRESS".freeze - COMPLETE = "COMPLETE".freeze - PARTIAL_COMPLETE = "PARTIAL_COMPLETE".freeze - FAILED = "FAILED".freeze + IN_PROGRESS = 'IN_PROGRESS'.freeze + COMPLETE = 'COMPLETE'.freeze + PARTIAL_COMPLETE = 'PARTIAL_COMPLETE'.freeze + FAILED = 'FAILED'.freeze def self.all_vars @all_vars ||= [IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, FAILED].freeze diff --git a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb index d547a398..de7dd399 100644 --- a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +++ b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb @@ -107,7 +107,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -137,7 +137,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MachineDetectionCompleteCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MachineDetectionCompleteCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/machine_detection_configuration.rb b/lib/bandwidth-sdk/models/machine_detection_configuration.rb index c1387aab..37e1bba3 100644 --- a/lib/bandwidth-sdk/models/machine_detection_configuration.rb +++ b/lib/bandwidth-sdk/models/machine_detection_configuration.rb @@ -151,7 +151,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MachineDetectionConfiguration` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MachineDetectionConfiguration` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb index e710f175..69191f24 100644 --- a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +++ b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class MachineDetectionModeEnum - SYNC = "sync".freeze - ASYNC = "async".freeze + SYNC = 'sync'.freeze + ASYNC = 'async'.freeze def self.all_vars @all_vars ||= [SYNC, ASYNC].freeze diff --git a/lib/bandwidth-sdk/models/machine_detection_result.rb b/lib/bandwidth-sdk/models/machine_detection_result.rb index c363568d..f6bb40b2 100644 --- a/lib/bandwidth-sdk/models/machine_detection_result.rb +++ b/lib/bandwidth-sdk/models/machine_detection_result.rb @@ -53,7 +53,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MachineDetectionResult` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MachineDetectionResult` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/media.rb b/lib/bandwidth-sdk/models/media.rb index c2f7abee..5002324e 100644 --- a/lib/bandwidth-sdk/models/media.rb +++ b/lib/bandwidth-sdk/models/media.rb @@ -54,7 +54,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Media` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Media` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/message.rb b/lib/bandwidth-sdk/models/message.rb index e305ae24..01a5436c 100644 --- a/lib/bandwidth-sdk/models/message.rb +++ b/lib/bandwidth-sdk/models/message.rb @@ -104,7 +104,7 @@ def self.openapi_types :'id' => :'String', :'owner' => :'String', :'application_id' => :'String', - :'time' => :'String', + :'time' => :'Time', :'segment_count' => :'Integer', :'direction' => :'MessageDirectionEnum', :'to' => :'Array', @@ -127,7 +127,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Message` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Message` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/message_delivered_callback.rb b/lib/bandwidth-sdk/models/message_delivered_callback.rb index 6a268f8b..87ef6c72 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback.rb @@ -63,7 +63,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageDeliveredCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessageDeliveredCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb index b33f941f..5ca0b7fe 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb @@ -113,7 +113,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageDeliveredCallbackMessage` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessageDeliveredCallbackMessage` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/message_direction_enum.rb b/lib/bandwidth-sdk/models/message_direction_enum.rb index fc8e6e78..993da1ac 100644 --- a/lib/bandwidth-sdk/models/message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/message_direction_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class MessageDirectionEnum - IN = "in".freeze - OUT = "out".freeze + IN = 'in'.freeze + OUT = 'out'.freeze def self.all_vars @all_vars ||= [IN, OUT].freeze diff --git a/lib/bandwidth-sdk/models/message_failed_callback.rb b/lib/bandwidth-sdk/models/message_failed_callback.rb index 7ce6b4ba..8e1620b1 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback.rb @@ -67,7 +67,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageFailedCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessageFailedCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/message_failed_callback_message.rb b/lib/bandwidth-sdk/models/message_failed_callback_message.rb index fb96be91..579b1e48 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback_message.rb @@ -113,7 +113,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageFailedCallbackMessage` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessageFailedCallbackMessage` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/message_request.rb b/lib/bandwidth-sdk/models/message_request.rb index b0ea2ee6..6be9d8eb 100644 --- a/lib/bandwidth-sdk/models/message_request.rb +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -103,7 +103,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageRequest` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessageRequest` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/message_sending_callback.rb b/lib/bandwidth-sdk/models/message_sending_callback.rb index 05ba3534..6123c2f2 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback.rb @@ -63,7 +63,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageSendingCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessageSendingCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/message_sending_callback_message.rb b/lib/bandwidth-sdk/models/message_sending_callback_message.rb index a44fd681..5e132032 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback_message.rb @@ -113,7 +113,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessageSendingCallbackMessage` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessageSendingCallbackMessage` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/message_status_enum.rb b/lib/bandwidth-sdk/models/message_status_enum.rb index b01d6701..e30fb931 100644 --- a/lib/bandwidth-sdk/models/message_status_enum.rb +++ b/lib/bandwidth-sdk/models/message_status_enum.rb @@ -15,14 +15,14 @@ module Bandwidth class MessageStatusEnum - RECEIVED = "RECEIVED".freeze - QUEUED = "QUEUED".freeze - SENDING = "SENDING".freeze - SENT = "SENT".freeze - FAILED = "FAILED".freeze - DELIVERED = "DELIVERED".freeze - ACCEPTED = "ACCEPTED".freeze - UNDELIVERED = "UNDELIVERED".freeze + RECEIVED = 'RECEIVED'.freeze + QUEUED = 'QUEUED'.freeze + SENDING = 'SENDING'.freeze + SENT = 'SENT'.freeze + FAILED = 'FAILED'.freeze + DELIVERED = 'DELIVERED'.freeze + ACCEPTED = 'ACCEPTED'.freeze + UNDELIVERED = 'UNDELIVERED'.freeze def self.all_vars @all_vars ||= [RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, ACCEPTED, UNDELIVERED].freeze diff --git a/lib/bandwidth-sdk/models/message_type_enum.rb b/lib/bandwidth-sdk/models/message_type_enum.rb index df3739f1..5250d3aa 100644 --- a/lib/bandwidth-sdk/models/message_type_enum.rb +++ b/lib/bandwidth-sdk/models/message_type_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class MessageTypeEnum - SMS = "sms".freeze - MMS = "mms".freeze + SMS = 'sms'.freeze + MMS = 'mms'.freeze def self.all_vars @all_vars ||= [SMS, MMS].freeze diff --git a/lib/bandwidth-sdk/models/messages_list.rb b/lib/bandwidth-sdk/models/messages_list.rb index e77933c9..613369bf 100644 --- a/lib/bandwidth-sdk/models/messages_list.rb +++ b/lib/bandwidth-sdk/models/messages_list.rb @@ -15,7 +15,7 @@ module Bandwidth class MessagesList - # Total number of messages matched by the search. + # The total number of messages matched by the search. When the request has limitTotalCount set to true this value is limited to 10,000. attr_accessor :total_count attr_accessor :page_info @@ -55,7 +55,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessagesList` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessagesList` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/messaging_code_response.rb b/lib/bandwidth-sdk/models/messaging_code_response.rb index 4de4545f..c155752e 100644 --- a/lib/bandwidth-sdk/models/messaging_code_response.rb +++ b/lib/bandwidth-sdk/models/messaging_code_response.rb @@ -47,7 +47,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessagingCodeResponse` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessagingCodeResponse` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/messaging_request_error.rb b/lib/bandwidth-sdk/models/messaging_request_error.rb index 9435cf16..634d822f 100644 --- a/lib/bandwidth-sdk/models/messaging_request_error.rb +++ b/lib/bandwidth-sdk/models/messaging_request_error.rb @@ -50,7 +50,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MessagingRequestError` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessagingRequestError` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb index 5fbf0b4b..4ab2469e 100644 --- a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb @@ -47,7 +47,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MfaForbiddenRequestError` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MfaForbiddenRequestError` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/mfa_request_error.rb b/lib/bandwidth-sdk/models/mfa_request_error.rb index 3bcc54ed..163f5d13 100644 --- a/lib/bandwidth-sdk/models/mfa_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_request_error.rb @@ -52,7 +52,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MfaRequestError` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MfaRequestError` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb index 10d28dd4..78ab188e 100644 --- a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb @@ -47,7 +47,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::MfaUnauthorizedRequestError` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MfaUnauthorizedRequestError` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/page_info.rb b/lib/bandwidth-sdk/models/page_info.rb index 38d644bd..c705492b 100644 --- a/lib/bandwidth-sdk/models/page_info.rb +++ b/lib/bandwidth-sdk/models/page_info.rb @@ -62,7 +62,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::PageInfo` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::PageInfo` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/priority_enum.rb b/lib/bandwidth-sdk/models/priority_enum.rb index ff61ccef..0bf5aa30 100644 --- a/lib/bandwidth-sdk/models/priority_enum.rb +++ b/lib/bandwidth-sdk/models/priority_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class PriorityEnum - DEFAULT = "default".freeze - HIGH = "high".freeze + DEFAULT = 'default'.freeze + HIGH = 'high'.freeze def self.all_vars @all_vars ||= [DEFAULT, HIGH].freeze diff --git a/lib/bandwidth-sdk/models/recording_available_callback.rb b/lib/bandwidth-sdk/models/recording_available_callback.rb index 30097cb0..a964f677 100644 --- a/lib/bandwidth-sdk/models/recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/recording_available_callback.rb @@ -139,7 +139,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -176,7 +176,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::RecordingAvailableCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::RecordingAvailableCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/recording_complete_callback.rb b/lib/bandwidth-sdk/models/recording_complete_callback.rb index 31dd1ecc..cf13042d 100644 --- a/lib/bandwidth-sdk/models/recording_complete_callback.rb +++ b/lib/bandwidth-sdk/models/recording_complete_callback.rb @@ -139,7 +139,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -177,7 +177,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::RecordingCompleteCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::RecordingCompleteCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/recording_state_enum.rb b/lib/bandwidth-sdk/models/recording_state_enum.rb index 7eddc212..b4fcdc2d 100644 --- a/lib/bandwidth-sdk/models/recording_state_enum.rb +++ b/lib/bandwidth-sdk/models/recording_state_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class RecordingStateEnum - PAUSED = "paused".freeze - RECORDING = "recording".freeze + PAUSED = 'paused'.freeze + RECORDING = 'recording'.freeze def self.all_vars @all_vars ||= [PAUSED, RECORDING].freeze diff --git a/lib/bandwidth-sdk/models/redirect_callback.rb b/lib/bandwidth-sdk/models/redirect_callback.rb index bed4bace..0f0dfcec 100644 --- a/lib/bandwidth-sdk/models/redirect_callback.rb +++ b/lib/bandwidth-sdk/models/redirect_callback.rb @@ -116,7 +116,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -147,7 +147,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::RedirectCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::RedirectCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/redirect_method_enum.rb b/lib/bandwidth-sdk/models/redirect_method_enum.rb index eed11b06..9399170c 100644 --- a/lib/bandwidth-sdk/models/redirect_method_enum.rb +++ b/lib/bandwidth-sdk/models/redirect_method_enum.rb @@ -15,8 +15,8 @@ module Bandwidth class RedirectMethodEnum - GET = "GET".freeze - POST = "POST".freeze + GET = 'GET'.freeze + POST = 'POST'.freeze def self.all_vars @all_vars ||= [GET, POST].freeze diff --git a/lib/bandwidth-sdk/models/stir_shaken.rb b/lib/bandwidth-sdk/models/stir_shaken.rb index 449873ff..33beb330 100644 --- a/lib/bandwidth-sdk/models/stir_shaken.rb +++ b/lib/bandwidth-sdk/models/stir_shaken.rb @@ -57,7 +57,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::StirShaken` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::StirShaken` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/tag.rb b/lib/bandwidth-sdk/models/tag.rb index 92a0edf6..4bfe0c70 100644 --- a/lib/bandwidth-sdk/models/tag.rb +++ b/lib/bandwidth-sdk/models/tag.rb @@ -50,7 +50,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Tag` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Tag` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb index 9a15ba74..07eda0b5 100644 --- a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +++ b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb @@ -47,7 +47,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TnLookupRequestError` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TnLookupRequestError` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/transcribe_recording.rb b/lib/bandwidth-sdk/models/transcribe_recording.rb index 9cf464e7..e59bfc62 100644 --- a/lib/bandwidth-sdk/models/transcribe_recording.rb +++ b/lib/bandwidth-sdk/models/transcribe_recording.rb @@ -104,7 +104,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TranscribeRecording` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TranscribeRecording` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/transcription.rb b/lib/bandwidth-sdk/models/transcription.rb index ce20b294..40e4fc5b 100644 --- a/lib/bandwidth-sdk/models/transcription.rb +++ b/lib/bandwidth-sdk/models/transcription.rb @@ -52,7 +52,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::Transcription` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Transcription` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/transcription_available_callback.rb b/lib/bandwidth-sdk/models/transcription_available_callback.rb index 604c243a..c0ba4200 100644 --- a/lib/bandwidth-sdk/models/transcription_available_callback.rb +++ b/lib/bandwidth-sdk/models/transcription_available_callback.rb @@ -134,7 +134,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -170,7 +170,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TranscriptionAvailableCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TranscriptionAvailableCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/transcription_list.rb b/lib/bandwidth-sdk/models/transcription_list.rb index 21bf91d6..8cc2b34e 100644 --- a/lib/bandwidth-sdk/models/transcription_list.rb +++ b/lib/bandwidth-sdk/models/transcription_list.rb @@ -46,7 +46,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TranscriptionList` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TranscriptionList` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/transcription_metadata.rb b/lib/bandwidth-sdk/models/transcription_metadata.rb index 9004130f..bdfcda12 100644 --- a/lib/bandwidth-sdk/models/transcription_metadata.rb +++ b/lib/bandwidth-sdk/models/transcription_metadata.rb @@ -63,7 +63,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TranscriptionMetadata` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TranscriptionMetadata` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/transfer_answer_callback.rb b/lib/bandwidth-sdk/models/transfer_answer_callback.rb index 86af37fb..5c4a22e2 100644 --- a/lib/bandwidth-sdk/models/transfer_answer_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_answer_callback.rb @@ -112,7 +112,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -142,7 +142,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TransferAnswerCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TransferAnswerCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/transfer_complete_callback.rb b/lib/bandwidth-sdk/models/transfer_complete_callback.rb index ecc9909b..12158800 100644 --- a/lib/bandwidth-sdk/models/transfer_complete_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_complete_callback.rb @@ -124,7 +124,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -159,7 +159,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TransferCompleteCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TransferCompleteCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb index d1c14b42..de8c0128 100644 --- a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb @@ -132,7 +132,7 @@ def self.acceptable_attributes def self.openapi_types { :'event_type' => :'String', - :'event_time' => :'String', + :'event_time' => :'Time', :'account_id' => :'String', :'application_id' => :'String', :'from' => :'String', @@ -169,7 +169,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::TransferDisconnectCallback` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::TransferDisconnectCallback` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/update_call.rb b/lib/bandwidth-sdk/models/update_call.rb index 7139de5e..e932fc63 100644 --- a/lib/bandwidth-sdk/models/update_call.rb +++ b/lib/bandwidth-sdk/models/update_call.rb @@ -121,7 +121,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::UpdateCall` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::UpdateCall` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/update_call_recording.rb b/lib/bandwidth-sdk/models/update_call_recording.rb index ce44c013..3ab55e7e 100644 --- a/lib/bandwidth-sdk/models/update_call_recording.rb +++ b/lib/bandwidth-sdk/models/update_call_recording.rb @@ -68,7 +68,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::UpdateCallRecording` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::UpdateCallRecording` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/update_conference.rb b/lib/bandwidth-sdk/models/update_conference.rb index a2c321c9..decb8270 100644 --- a/lib/bandwidth-sdk/models/update_conference.rb +++ b/lib/bandwidth-sdk/models/update_conference.rb @@ -115,7 +115,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::UpdateConference` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::UpdateConference` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/update_conference_member.rb b/lib/bandwidth-sdk/models/update_conference_member.rb index 85ef734b..496557cf 100644 --- a/lib/bandwidth-sdk/models/update_conference_member.rb +++ b/lib/bandwidth-sdk/models/update_conference_member.rb @@ -58,7 +58,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::UpdateConferenceMember` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::UpdateConferenceMember` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/verify_code_request.rb b/lib/bandwidth-sdk/models/verify_code_request.rb index 1b69bc9d..cc03f213 100644 --- a/lib/bandwidth-sdk/models/verify_code_request.rb +++ b/lib/bandwidth-sdk/models/verify_code_request.rb @@ -62,7 +62,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::VerifyCodeRequest` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::VerifyCodeRequest` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/verify_code_response.rb b/lib/bandwidth-sdk/models/verify_code_response.rb index 537f6f2b..ecf713f0 100644 --- a/lib/bandwidth-sdk/models/verify_code_response.rb +++ b/lib/bandwidth-sdk/models/verify_code_response.rb @@ -47,7 +47,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::VerifyCodeResponse` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::VerifyCodeResponse` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/voice_api_error.rb b/lib/bandwidth-sdk/models/voice_api_error.rb index 426b37ae..2e695780 100644 --- a/lib/bandwidth-sdk/models/voice_api_error.rb +++ b/lib/bandwidth-sdk/models/voice_api_error.rb @@ -55,7 +55,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::VoiceApiError` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::VoiceApiError` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/models/voice_code_response.rb b/lib/bandwidth-sdk/models/voice_code_response.rb index 36d1cd16..ebf0b0ea 100644 --- a/lib/bandwidth-sdk/models/voice_code_response.rb +++ b/lib/bandwidth-sdk/models/voice_code_response.rb @@ -47,7 +47,7 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Bandwidth::VoiceCodeResponse` initialize method" + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::VoiceCodeResponse` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key diff --git a/lib/bandwidth-sdk/version.rb b/lib/bandwidth-sdk/version.rb index 6ff7a18f..b63906fc 100644 --- a/lib/bandwidth-sdk/version.rb +++ b/lib/bandwidth-sdk/version.rb @@ -11,5 +11,5 @@ =end module Bandwidth - VERSION = ENV.fetch("GEM_VERSION") + VERSION = ENV.fetch('GEM_VERSION') end diff --git a/spec/api/calls_api_spec.rb b/spec/api/calls_api_spec.rb index 03269930..cde57bba 100644 --- a/spec/api/calls_api_spec.rb +++ b/spec/api/calls_api_spec.rb @@ -1,89 +1,228 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' - # Unit tests for Bandwidth::CallsApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate describe 'CallsApi' do - before do - # run before each test - @api_instance = Bandwidth::CallsApi.new - end + # call info + let(:call_id) { 'c-15ac29a2-006c67ad-060f-4b98-b148-b753d6e5e2ce' } + let(:enqueued_time) { '2023-06-23T18:43:51.248Z' } + let(:call_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}" } + let(:call_timeout) { 30.0 } + let(:callback_timeout) { 15.0 } + let(:answer_method) { Bandwidth::CallbackMethodEnum::POST } + let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' } + let(:answer_fallback_url) { BASE_CALLBACK_URL + '/callbacks/answer' } + let(:answer_fallback_method) { Bandwidth::CallbackMethodEnum::POST } + let(:disconnect_method) { Bandwidth::CallbackMethodEnum::GET } + let(:disconnect_url) { BASE_CALLBACK_URL + '/callbacks/disconnect' } + let(:priority) { 5 } + let(:direction) { Bandwidth::CallDirectionEnum::OUTBOUND } + let(:state) { 'disconnected' } + let(:stir_shaken) { {} } + let(:start_time) { '2023-06-23T19:11:06.049Z' } + let(:end_time) { '2023-06-23T19:11:06.175Z' } + let(:disconnect_cause) { 'rejected' } + let(:error_message) { 'Destination not found' } + let(:error_id) { '779941c4-6482-461d-b370-177b4ad0b5a7' } + let(:last_update) { '2023-06-23T19:11:06.175Z' } + let(:tag) { 'test tag' } - after do - # run after each test + # stubs + let(:create_call_headers_stub) { { 'content-type' => 'application/json' } } + let(:create_call_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"enqueuedTime\":\"#{enqueued_time}\",\"callUrl\":\"#{call_url}\",\"callTimeout\":#{call_timeout},\"callbackTimeout\":#{callback_timeout},\"tag\":\"#{tag}\",\"answerMethod\":\"#{answer_method}\",\"answerUrl\":\"#{answer_url}\",\"answerFallbackUrl\":\"#{answer_fallback_url}\",\"answerFallbackMethod\":\"#{answer_fallback_method}\",\"disconnectMethod\":\"#{disconnect_method}\",\"disconnectUrl\":\"#{disconnect_url}\",\"priority\":#{priority}}" } + let(:create_call_bad_request_stub) { '{"type":"validation","description":"Invalid to: must be a valid SIP URI or an E164 TN"}' } + let(:get_call_state_headers_stub) { { 'content-type' => 'application/json' } } + let(:get_call_state_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"direction\":\"#{direction}\",\"state\":\"#{state}\",\"stirShaken\":#{stir_shaken},\"enqueuedTime\":\"#{enqueued_time}\",\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"disconnectCause\":\"#{disconnect_cause}\",\"errorMessage\":\"#{error_message}\",\"errorId\":\"#{error_id}\",\"lastUpdate\":\"#{last_update}\"}" } + let(:get_call_state_not_found_stub) { '{"type":"validation","description":"Call does-not-exist was not found."}' } + let(:get_call_state_unauthorized_stub) { '{"type":"authentication-error","description":"The credentials provided were invalid"}' } + let(:get_call_state_forbidden_stub) { '{"type":"authorization-error","description":"Access is denied"}' } + let(:update_call_headers_stub) { { 'content-length' => '0' } } + + before(:all) do + Bandwidth.configure do |config| + config.debugging = true + end + @calls_api_instance = Bandwidth::CallsApi.new end describe 'test an instance of CallsApi' do it 'should create an instance of CallsApi' do - expect(@api_instance).to be_instance_of(Bandwidth::CallsApi) + expect(@calls_api_instance).to be_instance_of(Bandwidth::CallsApi) end end - # unit tests for create_call # Create Call - # Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. <b>Please note:</b> Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed. - # @param account_id Your Bandwidth Account ID. - # @param create_call JSON object containing information to create an outbound call - # @param [Hash] opts the optional parameters - # @return [CreateCallResponse] - describe 'create_call test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#create_call' do + it 'creates a call with amd' do + stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls"). + to_return(status: 201, headers: create_call_headers_stub, body: create_call_body_stub) + + amd_config = Bandwidth::MachineDetectionConfiguration.new( + mode: 'async', + detection_timeout: 5.0, + silence_timeout: 5.0, + speech_threshold: 5.0, + speech_end_threshold: 5.0, + delay_result: true, + callback_url: BASE_CALLBACK_URL + '/machineDetection', + callback_method: Bandwidth::CallbackMethodEnum::POST + ) + + call_body = Bandwidth::CreateCall.new( + application_id: BW_VOICE_APPLICATION_ID, + to: USER_NUMBER, + from: BW_NUMBER, + answer_url: answer_url, + answer_fallback_url: answer_fallback_url, + answer_method: answer_method, + disconnect_url: disconnect_url, + disconnect_method: disconnect_method, + machine_detection: amd_config, + call_timeout: call_timeout, + callback_timeout: callback_timeout, + tag: tag + ) + + data, status_code, headers = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body) + + expect(status_code).to eq(201) + expect(headers).to eq(create_call_headers_stub) + expect(data).to be_instance_of(Bandwidth::CreateCallResponse) + expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID) + expect(data.account_id).to eq(BW_ACCOUNT_ID) + expect(data.call_id).to eq(call_id) + expect(data.to).to eq(USER_NUMBER) + expect(data.from).to eq(BW_NUMBER) + expect(data.enqueued_time).to eq(Time.parse(enqueued_time)) + expect(data.call_url).to eq(call_url) + expect(data.call_timeout).to eq(call_timeout) + expect(data.callback_timeout).to eq(callback_timeout) + expect(data.tag).to eq(tag) + expect(data.answer_method).to eq(answer_method) + expect(data.answer_url).to eq(answer_url) + expect(data.answer_fallback_method).to eq(answer_fallback_method) + expect(data.answer_fallback_url).to eq(answer_fallback_url) + expect(data.disconnect_method).to eq(disconnect_method) + expect(data.disconnect_url).to eq(disconnect_url) + expect(data.priority).to eq(priority) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + @calls_api_instance.create_call(nil, {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing create_call' do + expect { + @calls_api_instance.create_call(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) end end - # unit tests for get_call_state # Get Call State Information - # Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: 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 HTTP 404 response. - # @param account_id Your Bandwidth Account ID. - # @param call_id Programmable Voice API Call ID. - # @param [Hash] opts the optional parameters - # @return [CallState] - describe 'get_call_state test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#get_call_state' do + it 'gets the call state' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}"). + to_return(status: 200, headers: get_call_state_headers_stub, body: get_call_state_body_stub) + + data, status_code, headers = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, call_id) + + expect(status_code).to eq(200) + expect(headers).to eq(get_call_state_headers_stub) + expect(data).to be_instance_of(Bandwidth::CallState) + expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID) + expect(data.account_id).to eq(BW_ACCOUNT_ID) + expect(data.call_id).to eq(call_id) + expect(data.to).to eq(USER_NUMBER) + expect(data.from).to eq(BW_NUMBER) + expect(data.direction).to eq(direction) + expect(data.stir_shaken).to eq(stir_shaken) + expect(data.state).to eq(state) + expect(data.enqueued_time).to eq(Time.parse(enqueued_time)) + expect(data.start_time).to eq(Time.parse(start_time)) + expect(data.end_time).to eq(Time.parse(end_time)) + expect(data.disconnect_cause).to eq(disconnect_cause) + expect(data.error_message).to eq(error_message) + expect(data.error_id).to eq(error_id) + expect(data.last_update).to eq(Time.parse(last_update)) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @calls_api_instance.get_call_state(nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @calls_api_instance.get_call_state(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) end end - # unit tests for update_call # Update Call - # Interrupts and redirects a call to a different URL that should return a BXML document. - # @param account_id Your Bandwidth Account ID. - # @param call_id Programmable Voice API Call ID. - # @param update_call JSON object containing information to redirect an existing call to a new BXML document - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'update_call test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#update_call' do + it 'creates and updates a call' do + stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}"). + to_return(status: 200, headers: update_call_headers_stub) + + update_call_body = Bandwidth::UpdateCall.new( + state: Bandwidth::CallStateEnum::ACTIVE, + redirect_url: MANTECA_BASE_URL + '/bxml/pause' + ) + + data, status_code, headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, update_call_body) + + expect(status_code).to eq(200) + expect(headers).to eq(update_call_headers_stub) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @calls_api_instance.update_call(nil, '', {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @calls_api_instance.update_call(BW_ACCOUNT_ID, nil, {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing update_call' do + expect { + @calls_api_instance.update_call(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for update_call_bxml # Update Call BXML - # Interrupts and replaces an active call's BXML document. - # @param account_id Your Bandwidth Account ID. - # @param call_id Programmable Voice API Call ID. - # @param body - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'update_call_bxml test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#update_call_bxml' do + it 'updates a call using bxml' do + stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/bxml"). + to_return(status: 204) + + update_bxml = 'This is a test bxml response' + + data, status_code, headers = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, update_bxml) + + expect(status_code).to eq(204) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + @calls_api_instance.update_call_bxml(nil, '', {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @calls_api_instance.update_call_bxml(BW_ACCOUNT_ID, nil, {}) + }.to raise_error(ArgumentError) end - end + it 'causes an ArgumentError for a missing body' do + expect { + @calls_api_instance.update_call_bxml(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) + end + end end diff --git a/spec/api/conferences_api_spec.rb b/spec/api/conferences_api_spec.rb index 50be2b84..2fba68be 100644 --- a/spec/api/conferences_api_spec.rb +++ b/spec/api/conferences_api_spec.rb @@ -1,163 +1,393 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' - # Unit tests for Bandwidth::ConferencesApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate describe 'ConferencesApi' do - before do - # run before each test - @api_instance = Bandwidth::ConferencesApi.new - end - - after do - # run after each test + # conference info + let(:test_id) { 'ruby-3.1.3_macOS_conference_1687791527' } + let(:conference_id) { 'conf-3f758f24-6711b6d2-0d44-495d-afc8-2555c3ce5f4f' } + let(:created_time) { '2023-06-26T14:58:49.471Z' } + let(:conference_event_url) { 'https://amazonaws.com/prod/conferenceEvents' } + let(:conference_event_method) { 'POST' } + let(:call_id) { 'c-3f758f24-cd77b08f-97c2-4311-965a-a1ac8ed8f340' } + let(:recording_id) { 'r-fbe05094-7bf4b314-91fe-4bdd-a39b-500cdc873d3a' } + let(:start_time) { '2023-06-26T14:58:51.195Z' } + let(:end_time) { '2023-06-26T14:58:57.502Z' } + let(:duration) { 'PT6.3S' } + let(:channels) { 1 } + let(:file_format) { Bandwidth::FileFormatEnum::WAV } + let(:status) { 'complete' } + let(:member_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/members/#{call_id}" } + let(:media_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/recordings/#{recording_id}/media" } + let(:active_members) { "[{\"callId\":\"#{call_id}\",\"conferenceId\":\"#{conference_id}\",\"memberUrl\":\"#{member_url}\",\"mute\":false,\"hold\":false,\"callIdsToCoach\":[]}]" } + + # stubs + let(:list_conferences_headers_stub) { { 'content-type' => 'application/json' } } + let(:list_conferences_body_stub) { "[{\"id\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"createdTime\":\"#{created_time}\",\"conferenceEventUrl\":\"#{conference_event_url}\",\"conferenceEventMethod\":\"#{conference_event_method}\",\"tag\":\"#{test_id}\"}]" } + let(:get_conference_headers_stub) { { 'content-type' => 'application/json' } } + let(:get_conference_body_stub) { "{\"id\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"createdTime\":\"#{created_time}\",\"conferenceEventUrl\":\"#{conference_event_url}\",\"conferenceEventMethod\":\"#{conference_event_method}\",\"tag\":\"#{test_id}\",\"activeMembers\":#{active_members}}" } + let(:get_conference_member_headers_stub) { { 'content-type' => 'application/json' } } + let(:get_conference_member_body_stub) { "{\"callId\":\"#{call_id}\",\"conferenceId\":\"#{conference_id}\",\"memberUrl\":\"#{member_url}\",\"mute\":false,\"hold\":false,\"callIdsToCoach\":[]}" } + let(:list_conference_recordings_headers_stub) { { 'content-type' => 'application/json' } } + let(:list_conference_recordings_body_stub) { "[{\"accountId\":\"#{BW_ACCOUNT_ID}\",\"conferenceId\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"recordingId\":\"#{recording_id}\",\"duration\":\"#{duration}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}]" } + let(:get_conference_recording_headers_stub) { { 'content-type' => 'application/json' } } + let(:get_conference_recording_body_stub) { "{\"accountId\":\"#{BW_ACCOUNT_ID}\",\"conferenceId\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"recordingId\":\"#{recording_id}\",\"duration\":\"#{duration}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}" } + let(:download_conference_recording_body_stub) { 'RIFFWAVEfmtLISTINFOISFTLavf58.45.100data' } + let(:download_conference_recording_headers_stub) { { 'content-type' => 'audio/vnd.wave', 'content-length' => "#{download_conference_recording_body_stub.length}" } } + + before(:all) do + Bandwidth.configure do |config| + config.return_binary_data = true + config.debugging = true + end + @conferences_api_instance = Bandwidth::ConferencesApi.new end - + describe 'test an instance of ConferencesApi' do it 'should create an instance of ConferencesApi' do - expect(@api_instance).to be_instance_of(Bandwidth::ConferencesApi) + expect(@conferences_api_instance).to be_instance_of(Bandwidth::ConferencesApi) end end - - # unit tests for download_conference_recording + # Download Conference Recording - # Downloads the specified recording file. - # @param account_id Your Bandwidth Account ID. - # @param conference_id Programmable Voice API Conference ID. - # @param recording_id Programmable Voice API Recording ID. - # @param [Hash] opts the optional parameters - # @return [File] describe 'download_conference_recording test' do it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/recordings/#{recording_id}/media"). + to_return(status: 200, headers: download_conference_recording_headers_stub, body: download_conference_recording_body_stub) + + data, status_code, headers = @conferences_api_instance.download_conference_recording_with_http_info(BW_ACCOUNT_ID, conference_id, recording_id) + + expect(status_code).to eq(200) + expect(headers).to eq(download_conference_recording_headers_stub) + expect(data).to eq(download_conference_recording_body_stub) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @conferences_api_instance.download_conference_recording(nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing conference_id' do + expect { + @conferences_api_instance.download_conference_recording(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing recording_id' do + expect { + @conferences_api_instance.download_conference_recording(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for get_conference # Get Conference Information - # Returns information about the specified conference. - # @param account_id Your Bandwidth Account ID. - # @param conference_id Programmable Voice API Conference ID. - # @param [Hash] opts the optional parameters - # @return [Conference] - describe 'get_conference test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'get_conference' do + it 'get a conference by id' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}"). + to_return(status: 200, headers: get_conference_headers_stub, body: get_conference_body_stub) + + data, status_code, headers = @conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, conference_id) + + expect(status_code).to eq(200) + expect(headers).to eq(get_conference_headers_stub) + expect(data).to be_instance_of(Bandwidth::Conference) + expect(data.id).to eq(conference_id) + expect(data.name).to eq(test_id) + expect(data.tag).to eq(test_id) + expect(data.created_time).to eq(Time.parse(created_time)) + expect(data.conference_event_url).to eq(conference_event_url) + expect(data.conference_event_method).to eq(conference_event_method) + expect(data.active_members).to be_instance_of(Array) + expect(data.active_members[0]).to be_instance_of(Bandwidth::ConferenceMember) + expect(data.active_members[0].call_id).to eq(call_id) + expect(data.active_members[0].conference_id).to eq(conference_id) + expect(data.active_members[0].member_url).to eq(member_url) + expect(data.active_members[0].mute).to be false + expect(data.active_members[0].hold).to be false + expect(data.active_members[0].call_ids_to_coach).to eq([]) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @conferences_api_instance.get_conference(nil, '') + }.to raise_error(ArgumentError) end - end - # unit tests for get_conference_member + it 'causes an ArgumentError for a missing conference_id' do + expect { + @conferences_api_instance.get_conference(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) + end + end + # Get Conference Member - # Returns information about the specified conference member. - # @param account_id Your Bandwidth Account ID. - # @param conference_id Programmable Voice API Conference ID. - # @param member_id Programmable Voice API Conference Member ID. - # @param [Hash] opts the optional parameters - # @return [ConferenceMember] - describe 'get_conference_member test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'get_conference_member' do + it 'gets a conference member by call id' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/members/#{call_id}"). + to_return(status: 200, headers: get_conference_member_headers_stub, body: get_conference_member_body_stub) + + data, status_code, headers = @conferences_api_instance.get_conference_member_with_http_info(BW_ACCOUNT_ID, conference_id, call_id) + + expect(status_code).to eq(200) + expect(headers).to eq(get_conference_member_headers_stub) + expect(data).to be_instance_of(Bandwidth::ConferenceMember) + expect(data.conference_id).to eq(conference_id) + expect(data.call_id).to eq(call_id) + expect(data.member_url).to eq(member_url) + expect(data.mute).to be false + expect(data.hold).to be false + expect(data.call_ids_to_coach).to eq([]) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @conferences_api_instance.get_conference_member(nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing conference_id' do + expect { + @conferences_api_instance.get_conference_member(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing member_id' do + expect { + @conferences_api_instance.get_conference_member(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for get_conference_recording # Get Conference Recording Information - # Returns metadata for the specified recording. - # @param account_id Your Bandwidth Account ID. - # @param conference_id Programmable Voice API Conference ID. - # @param recording_id Programmable Voice API Recording ID. - # @param [Hash] opts the optional parameters - # @return [ConferenceRecordingMetadata] - describe 'get_conference_recording test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'get_conference_recording' do + it 'gets a conference recording by id' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/recordings/#{recording_id}"). + to_return(status: 200, headers: get_conference_recording_headers_stub, body: get_conference_recording_body_stub) + + data, status_code, headers = @conferences_api_instance.get_conference_recording_with_http_info(BW_ACCOUNT_ID, conference_id, recording_id) + + expect(status_code).to eq(200) + expect(headers).to eq(get_conference_recording_headers_stub) + expect(data).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) + expect(data.account_id).to eq(BW_ACCOUNT_ID) + expect(data.conference_id).to eq(conference_id) + expect(data.name).to eq(test_id) + expect(data.recording_id).to eq(recording_id) + expect(data.duration).to eq(duration) + expect(data.channels).to eq(channels) + expect(data.start_time).to eq(Time.parse(start_time)) + expect(data.end_time).to eq(Time.parse(end_time)) + expect(data.file_format).to eq(Bandwidth::FileFormatEnum::WAV) + expect(data.status).to eq('complete') + expect(data.media_url).to eq(media_url) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @conferences_api_instance.get_conference_recording(nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing conference_id' do + expect { + @conferences_api_instance.get_conference_recording(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing recording_id' do + expect { + @conferences_api_instance.get_conference_recording(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for list_conference_recordings # Get Conference Recordings - # Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. - # @param account_id Your Bandwidth Account ID. - # @param conference_id Programmable Voice API Conference ID. - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'list_conference_recordings test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'list_conference_recordings' do + it 'lists recordings for a conference' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/recordings"). + to_return(status: 200, headers: list_conference_recordings_headers_stub, body: list_conference_recordings_body_stub) + + data, status_code, headers = @conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, conference_id) + + expect(status_code).to eq(200) + expect(headers).to eq(list_conference_recordings_headers_stub) + expect(data).to be_instance_of(Array) + expect(data[0]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) + expect(data[0].account_id).to eq(BW_ACCOUNT_ID) + expect(data[0].conference_id).to eq(conference_id) + expect(data[0].name).to eq(test_id) + expect(data[0].recording_id).to eq(recording_id) + expect(data[0].duration).to eq(duration) + expect(data[0].channels).to eq(channels) + expect(data[0].start_time).to eq(Time.parse(start_time)) + expect(data[0].end_time).to eq(Time.parse(end_time)) + expect(data[0].file_format).to eq(Bandwidth::FileFormatEnum::WAV) + expect(data[0].status).to eq('complete') + expect(data[0].media_url).to eq(media_url) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @conferences_api_instance.list_conference_recordings(nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing conference_id' do + expect { + @conferences_api_instance.list_conference_recordings(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) end end - # unit tests for list_conferences # Get Conferences - # Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences 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 conference records. - # @param account_id Your Bandwidth Account ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :name Filter results by the `name` field. - # @option opts [String] :min_created_time Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). - # @option opts [String] :max_created_time Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). - # @option opts [Integer] :page_size Specifies the max number of conferences that will be returned. - # @option opts [String] :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. - # @return [Array] - describe 'list_conferences test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'list_conferences' do + it 'list all conferences' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences?name=#{test_id}"). + to_return(status: 200, headers: list_conferences_headers_stub, body: list_conferences_body_stub) + + conference_opts = { + name: test_id + } + + data, status_code, headers = @conferences_api_instance.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts) + + expect(status_code).to eq(200) + expect(headers).to eq(list_conferences_headers_stub) + expect(data).to be_instance_of(Array) + expect(data[0]).to be_instance_of(Bandwidth::Conference) + expect(data[0].id).to eq(conference_id) + expect(data[0].name).to eq(test_id) + expect(data[0].tag).to eq(test_id) + expect(data[0].created_time).to eq(Time.parse(created_time)) + expect(data[0].conference_event_url).to eq(conference_event_url) + expect(data[0].conference_event_method).to eq(conference_event_method) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @conferences_api_instance.list_conferences(nil, {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for an invalid page_size' do + expect { + @conferences_api_instance.list_conferences(BW_ACCOUNT_ID, { page_size: 1001 }) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for an invalid page_size' do + expect { + @conferences_api_instance.list_conferences(BW_ACCOUNT_ID, { page_size: 0 }) + }.to raise_error(ArgumentError) end end - # unit tests for update_conference # Update Conference - # Update the conference state. - # @param account_id Your Bandwidth Account ID. - # @param conference_id Programmable Voice API Conference ID. - # @param update_conference - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'update_conference test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'update_conference' do + it 'updates a conference' do + stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}"). + to_return(status: 204) + + update_conference_body = Bandwidth::UpdateConference.new( + status: Bandwidth::ConferenceStateEnum::ACTIVE, + redirect_url: BASE_CALLBACK_URL + '/bxml/pause', + redirect_method: Bandwidth::RedirectMethodEnum::POST, + username: 'username', + password: 'password', + redirect_fallback_url: BASE_CALLBACK_URL + '/bxml/pause', + redirect_fallback_method: Bandwidth::RedirectMethodEnum::POST, + fallback_username: 'username', + fallback_password: 'password' + ) + + data, status_code, headers = @conferences_api_instance.update_conference_with_http_info(BW_ACCOUNT_ID, conference_id, update_conference_body) + expect(status_code).to eq(204) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @conferences_api_instance.update_conference(nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing conference_id' do + expect { + @conferences_api_instance.update_conference(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) end - end - # unit tests for update_conference_bxml + it 'causes an ArgumentError for a missing update_conference' do + expect { + @conferences_api_instance.update_conference(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) + end + end + # Update Conference BXML - # Update the conference BXML document. - # @param account_id Your Bandwidth Account ID. - # @param conference_id Programmable Voice API Conference ID. - # @param body - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'update_conference_bxml test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'update_conference_bxml' do + it 'updates a conference using bxml' do + stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/bxml"). + to_return(status: 204) + + update_bxml = 'This should be a conference recording.' + + data, status_code, headers = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, conference_id, update_bxml) + expect(status_code).to eq(204) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @conferences_api_instance.update_conference_bxml(nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing conference_id' do + expect { + @conferences_api_instance.update_conference_bxml(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing body' do + expect { + @conferences_api_instance.update_conference_bxml(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for update_conference_member # Update Conference Member - # Updates settings for a particular conference member. - # @param account_id Your Bandwidth Account ID. - # @param conference_id Programmable Voice API Conference ID. - # @param member_id Programmable Voice API Conference Member ID. - # @param update_conference_member - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'update_conference_member test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'update_conference_member' do + it 'updates a conference member by call id' do + stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/members/#{call_id}"). + to_return(status: 204) + + update_conference_member = Bandwidth::UpdateConferenceMember.new( + mute: false + ) + + data, status_code, headers = @conferences_api_instance.update_conference_member_with_http_info(BW_ACCOUNT_ID, conference_id, call_id, update_conference_member) + expect(status_code).to eq(204) end - end + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @conferences_api_instance.update_conference_member(nil, '', '', {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing conference_id' do + expect { + @conferences_api_instance.update_conference_member(BW_ACCOUNT_ID, nil, '', {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing member_id' do + expect { + @conferences_api_instance.update_conference_member(BW_ACCOUNT_ID, '', nil, {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing update_conference_member' do + expect { + @conferences_api_instance.update_conference_member(BW_ACCOUNT_ID, '', '', nil) + }.to raise_error(ArgumentError) + end + end end diff --git a/spec/api/media_api_spec.rb b/spec/api/media_api_spec.rb index 550cdf49..283e5a25 100644 --- a/spec/api/media_api_spec.rb +++ b/spec/api/media_api_spec.rb @@ -1,90 +1,129 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' - # Unit tests for Bandwidth::MediaApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate describe 'MediaApi' do - before do - # run before each test - @api_instance = Bandwidth::MediaApi.new - end + # media info + let(:media_name) { 'ruby_binary_media' + SecureRandom.uuid } + let(:media_data) { '123456' } + let(:content_url) { "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/media/#{media_name}" } - after do - # run after each test + # stubs + let(:get_media_headers_stub) { { 'content-type' => 'application/json' } } + let(:list_media_body_stub) { "[{\"contentLength\":#{media_data.length},\"mediaName\":\"#{media_name}\",\"content\":\"#{content_url}\"}]" } + let(:list_media_headers_stub) { { 'content-type' => 'application/json' } } + + before(:all) do + Bandwidth.configure do |config| + config.return_binary_data = true + config.debugging = true + end + @media_api_instance = Bandwidth::MediaApi.new end describe 'test an instance of MediaApi' do it 'should create an instance of MediaApi' do - expect(@api_instance).to be_instance_of(Bandwidth::MediaApi) + expect(@media_api_instance).to be_instance_of(Bandwidth::MediaApi) end end - # unit tests for delete_media # Delete Media - # Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name. - # @param account_id Your Bandwidth Account ID. - # @param media_id Media ID to retrieve. - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_media test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'delete_media' do + it 'deletes the binary media' do + stub_request(:delete, "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/media/#{media_name}"). + to_return(status: 204) + + data, status_code, headers = @media_api_instance.delete_media_with_http_info(BW_ACCOUNT_ID, media_name) + + expect(status_code).to eq(204) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @media_api_instance.delete_media(nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing media_id' do + expect { + @media_api_instance.delete_media(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) end end - # unit tests for get_media # Get Media - # Downloads a media file you previously uploaded. - # @param account_id Your Bandwidth Account ID. - # @param media_id Media ID to retrieve. - # @param [Hash] opts the optional parameters - # @return [File] - describe 'get_media test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'get_media' do + it 'gets uploaded binary media' do + stub_request(:get, "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/media/#{media_name}"). + to_return(status: 200, headers: get_media_headers_stub, body: media_data) + + data, status_code, headers = @media_api_instance.get_media_with_http_info(BW_ACCOUNT_ID, media_name) + + expect(status_code).to eq(200) + expect(headers).to eq(get_media_headers_stub) + expect(data).to eq(media_data) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @media_api_instance.get_media(nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing media_id' do + expect { + @media_api_instance.get_media(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) end end - # unit tests for list_media # List Media - # Gets a list of your media files. No query parameters are supported. - # @param account_id Your Bandwidth Account ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :continuation_token Continuation token used to retrieve subsequent media. - # @return [Array] - describe 'list_media test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'list_media' do + it 'lists media' do + stub_request(:get, "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/media"). + to_return(status: 200, headers: list_media_headers_stub, body: list_media_body_stub) + + data, status_code, headers = @media_api_instance.list_media_with_http_info(BW_ACCOUNT_ID) + + expect(status_code).to eq(200) + expect(headers).to eq(list_media_headers_stub) + expect(data).to be_instance_of(Array) + expect(data[0]).to be_instance_of(Bandwidth::Media) + expect(data[0].content_length).to eq(media_data.length) + expect(data[0].media_name).to eq(media_name) + expect(data[0].content).to eq(content_url) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @media_api_instance.list_media(nil) + }.to raise_error(ArgumentError) end end - # unit tests for upload_media # Upload Media - # Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). - # @param account_id Your Bandwidth Account ID. - # @param media_id Media ID to retrieve. - # @param body - # @param [Hash] opts the optional parameters - # @option opts [String] :content_type The media type of the entity-body. - # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. - # @return [nil] - describe 'upload_media test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'upload_media' do + it 'uploads binary media' do + stub_request(:put, "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/media/#{media_name}"). + to_return(status: 204) + + data, status_code, headers = @media_api_instance.upload_media_with_http_info(BW_ACCOUNT_ID, media_name, media_data) + expect(status_code).to eq(204) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @media_api_instance.upload_media(nil, '', '') + }.to raise_error(ArgumentError) end - end + it 'causes an ArgumentError for a missing media_id' do + expect { + @media_api_instance.upload_media(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing body' do + expect { + @media_api_instance.upload_media(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) + end + end end diff --git a/spec/api/messages_api_spec.rb b/spec/api/messages_api_spec.rb index c9846a39..3b6a06d8 100644 --- a/spec/api/messages_api_spec.rb +++ b/spec/api/messages_api_spec.rb @@ -1,74 +1,193 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' - # Unit tests for Bandwidth::MessagesApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate describe 'MessagesApi' do - before do - # run before each test - @api_instance = Bandwidth::MessagesApi.new - end + # message info + let(:mms_id) { '1687899647358cu2t57tczmbzcu2s' } + let(:sms_id) { '1687899647634s46mhdt7ifq5hnjl' } + let(:time) { '2023-06-27T21:00:47.358063Z' } + let(:segment_count) { 1 } + let(:direction) { Bandwidth::MessageDirectionEnum::OUT } + let(:text) { 'test text' } + let(:media_url) { 'https://cdn2.thecatapi.com/images/MTY3ODIyMQ.jpg' } + let(:tag) { 'test tag' } + let(:priority) { Bandwidth::PriorityEnum::HIGH } + let(:expiration_time) { (Time.now + 60).round.to_datetime.rfc3339 } + let(:total_count) { 2 } + let(:next_page_token) { 'YWZ0ZXI9MTAwJmxpbWl0PTEwMA' } + let(:list_message_direction) { Bandwidth::ListMessageDirectionEnum::OUTBOUND } + let(:list_message_status) { Bandwidth::MessageStatusEnum::SENT } + let(:list_message_type_mms) { Bandwidth::MessageTypeEnum::MMS } + let(:list_message_type_sms) { Bandwidth::MessageTypeEnum::SMS } + let(:mms_length) { 45151 } + let(:attachment_count) { 1 } + let(:recipient_count) { 1 } + let(:mms_error_code) { 0 } + let(:sms_error_code) { 4720 } + let(:carrier_name) { 'Other' } + let(:next_page_url) { "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/messages?messageDirection=#{list_message_direction}&sourceTn=%2B#{BW_NUMBER[1..-1]}&pageToken=#{next_page_token}" } - after do - # run after each test + # stubs + let(:create_message_mms_headers_stub) { { 'content-type' => 'application/json' } } + let(:create_message_mms_body_stub) { "{\"id\":\"#{mms_id}\",\"owner\":\"#{BW_NUMBER}\",\"applicationId\":\"#{BW_MESSAGING_APPLICATION_ID}\",\"time\":\"#{time}\",\"segmentCount\":#{segment_count},\"direction\":\"#{direction}\",\"to\":[\"#{USER_NUMBER}\"],\"from\":\"#{BW_NUMBER}\",\"text\":\"#{text}\",\"media\":[\"#{media_url}\"],\"tag\":\"#{tag}\"}" } + let(:create_message_sms_headers_stub) { { 'content-type' => 'application/json' } } + let(:create_message_sms_body_stub) { "{\"id\":\"#{sms_id}\",\"owner\":\"#{BW_NUMBER}\",\"applicationId\":\"#{BW_MESSAGING_APPLICATION_ID}\",\"time\":\"#{time}\",\"segmentCount\":#{segment_count},\"direction\":\"#{direction}\",\"to\":[\"#{USER_NUMBER}\"],\"from\":\"#{BW_NUMBER}\",\"text\":\"#{text}\",\"tag\":\"#{tag}\",\"priority\":\"#{priority}\",\"expiration\":\"#{expiration_time}\"}" } + let(:list_messages_body_stub) { "{\"totalCount\":#{total_count},\"pageInfo\":{\"nextPage\":\"#{next_page_url}\",\"nextPageToken\":\"#{next_page_token}\"},\"messages\":[{\"messageId\":\"#{mms_id}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"sourceTn\":\"#{BW_NUMBER}\",\"destinationTn\":\"#{USER_NUMBER}\",\"messageStatus\":\"#{list_message_status}\",\"messageDirection\":\"#{list_message_direction}\",\"messageType\":\"#{list_message_type_mms}\",\"segmentCount\":#{segment_count},\"messageLength\":#{mms_length},\"messageSize\":#{mms_length},\"attachmentCount\":#{attachment_count},\"recipientCount\":#{recipient_count},\"errorCode\":#{mms_error_code},\"carrierName\":null,\"campaignClass\":null,\"campaignId\":null,\"receiveTime\":\"#{time}\"},{\"messageId\":\"#{sms_id}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"sourceTn\":\"#{BW_NUMBER}\",\"destinationTn\":\"#{USER_NUMBER}\",\"messageStatus\":\"#{list_message_status}\",\"messageDirection\":\"#{list_message_direction}\",\"messageType\":\"#{list_message_type_sms}\",\"segmentCount\":#{segment_count},\"messageLength\":#{text.length},\"messageSize\":null,\"attachmentCount\":null,\"recipientCount\":null,\"errorCode\":#{sms_error_code},\"carrierName\":\"#{carrier_name}\",\"campaignClass\":null,\"campaignId\":null,\"receiveTime\":\"#{time}\"}]}" } + let(:list_messages_headers_stub) { { 'content-type' => 'application/json', 'content-length' => "#{list_messages_body_stub.length}" } } + + before(:all) do + Bandwidth.configure do |config| + config.debugging = true + end + @messaging_api_instance = Bandwidth::MessagesApi.new end describe 'test an instance of MessagesApi' do it 'should create an instance of MessagesApi' do - expect(@api_instance).to be_instance_of(Bandwidth::MessagesApi) + expect(@messaging_api_instance).to be_instance_of(Bandwidth::MessagesApi) end end - # unit tests for create_message # Create Message - # Endpoint for sending text messages and picture messages using V2 messaging. - # @param account_id Your Bandwidth Account ID. - # @param message_request - # @param [Hash] opts the optional parameters - # @return [Message] - describe 'create_message test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'create_message' do + it 'creates an mms message' do + stub_request(:post, "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/messages"). + to_return(status: 202, headers: create_message_mms_headers_stub, body: create_message_mms_body_stub) + + message_request = Bandwidth::MessageRequest.new( + application_id: BW_MESSAGING_APPLICATION_ID, + to: [USER_NUMBER], + from: BW_NUMBER, + text: text, + media: [media_url], + tag: tag + ) + + data, status_code, headers = @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, message_request) + + expect(status_code).to eq(202) + expect(headers).to eq(create_message_mms_headers_stub) + expect(data).to be_instance_of(Bandwidth::Message) + expect(data.id).to eq(mms_id) + expect(data.owner).to eq(BW_NUMBER) + expect(data.application_id).to eq(BW_MESSAGING_APPLICATION_ID) + expect(data.time).to eq(Time.parse(time)) + expect(data.segment_count).to eq(segment_count) + expect(data.direction).to eq(direction) + expect(data.to).to eq([USER_NUMBER]) + expect(data.from).to eq(BW_NUMBER) + expect(data.text).to eq(text) + expect(data.media).to eq([media_url]) + expect(data.tag).to eq(tag) + end + + it 'creates an sms message' do + stub_request(:post, "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/messages"). + to_return(status: 202, headers: create_message_sms_headers_stub, body: create_message_sms_body_stub) + + message_request = Bandwidth::MessageRequest.new( + application_id: BW_MESSAGING_APPLICATION_ID, + to: [USER_NUMBER], + from: BW_NUMBER, + text: text, + tag: tag, + priority: priority, + expiration: expiration_time + ) + + data, status_code, headers = @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, message_request) + + expect(status_code).to eq(202) + expect(headers).to eq(create_message_sms_headers_stub) + expect(data).to be_instance_of(Bandwidth::Message) + expect(data.id).to eq(sms_id) + expect(data.owner).to eq(BW_NUMBER) + expect(data.application_id).to eq(BW_MESSAGING_APPLICATION_ID) + expect(data.time).to eq(Time.parse(time)) + expect(data.segment_count).to eq(segment_count) + expect(data.direction).to eq(direction) + expect(data.to).to eq([USER_NUMBER]) + expect(data.from).to eq(BW_NUMBER) + expect(data.text).to eq(text) + expect(data.tag).to eq(tag) + expect(data.priority).to eq(priority) + expect(data.expiration).to eq(Time.parse(expiration_time)) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @messaging_api_instance.create_message(nil, {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing message_request' do + expect { + @messaging_api_instance.create_message(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) end end - # unit tests for list_messages # List Messages - # Returns a list of messages based on query parameters. - # @param account_id Your Bandwidth Account ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. - # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. - # @option opts [ListMessageDirectionEnum] :message_direction The direction of the message. One of INBOUND OUTBOUND. - # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). - # @option opts [MessageTypeEnum] :message_type The type of message. Either sms or mms. - # @option opts [Integer] :error_code The error code of the message. - # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. - # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. - # @option opts [String] :campaign_id The campaign ID of the message. - # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. - # @option opts [String] :page_token A base64 encoded value used for pagination of results. - # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. - # @return [MessagesList] - describe 'list_messages test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'list_messages' do + it 'lists messages' do + stub_request(:get, "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/messages?messageDirection=#{list_message_direction}&sourceTn=%2B#{BW_NUMBER[1..-1]}"). + to_return(status: 200, headers: list_messages_headers_stub, body: list_messages_body_stub) + + get_opts = { + :source_tn => BW_NUMBER, + :message_direction => list_message_direction + } + + data, status_code, headers = @messaging_api_instance.list_messages_with_http_info(BW_ACCOUNT_ID, get_opts) + + expect(status_code).to eq(200) + expect(headers).to eq(list_messages_headers_stub) + expect(data).to be_instance_of(Bandwidth::MessagesList) + expect(data.total_count).to eq(total_count) + expect(data.page_info.next_page).to eq(next_page_url) + expect(data.page_info.next_page_token).to eq(next_page_token) + expect(data.messages.length).to eq(total_count) + expect(data.messages).to be_instance_of(Array) + expect(data.messages[0]).to be_instance_of(Bandwidth::ListMessageItem) + expect(data.messages[0].message_id).to eq(mms_id) + expect(data.messages[0].account_id).to eq(BW_ACCOUNT_ID) + expect(data.messages[0].source_tn).to eq(BW_NUMBER) + expect(data.messages[0].destination_tn).to eq(USER_NUMBER) + expect(data.messages[0].message_status).to eq(list_message_status) + expect(data.messages[0].message_direction).to eq(list_message_direction) + expect(data.messages[0].message_type).to eq(list_message_type_mms) + expect(data.messages[0].segment_count).to eq(segment_count) + expect(data.messages[0].error_code).to eq(mms_error_code) + expect(data.messages[0].receive_time).to eq(Time.parse(time)) + expect(data.messages[0].carrier_name).to eq(nil) + expect(data.messages[0].message_size).to eq(mms_length) + expect(data.messages[0].message_length).to eq(mms_length) + expect(data.messages[0].attachment_count).to eq(attachment_count) + expect(data.messages[0].recipient_count).to eq(recipient_count) + expect(data.messages[0].campaign_class).to eq(nil) + expect(data.messages[0].campaign_id).to eq(nil) + expect(data.messages[1]).to be_instance_of(Bandwidth::ListMessageItem) + expect(data.messages[1].message_id).to eq(sms_id) + expect(data.messages[1].account_id).to eq(BW_ACCOUNT_ID) + expect(data.messages[1].source_tn).to eq(BW_NUMBER) + expect(data.messages[1].destination_tn).to eq(USER_NUMBER) + expect(data.messages[1].message_status).to eq(list_message_status) + expect(data.messages[1].message_direction).to eq(list_message_direction) + expect(data.messages[1].message_type).to eq(list_message_type_sms) + expect(data.messages[1].segment_count).to eq(segment_count) + expect(data.messages[1].error_code).to eq(sms_error_code) + expect(data.messages[1].receive_time).to eq(Time.parse(time)) + expect(data.messages[1].carrier_name).to eq(carrier_name) + expect(data.messages[1].message_size).to eq(nil) + expect(data.messages[1].message_length).to eq(text.length) + expect(data.messages[1].attachment_count).to eq(nil) + expect(data.messages[1].recipient_count).to eq(nil) + expect(data.messages[1].campaign_class).to eq(nil) + expect(data.messages[1].campaign_id).to eq(nil) end - end + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @messaging_api_instance.list_messages(nil) + }.to raise_error(ArgumentError) + end + end end diff --git a/spec/api/mfa_api_spec.rb b/spec/api/mfa_api_spec.rb index 9d688c03..70486b73 100644 --- a/spec/api/mfa_api_spec.rb +++ b/spec/api/mfa_api_spec.rb @@ -1,74 +1,130 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' - # Unit tests for Bandwidth::MFAApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate describe 'MFAApi' do - before do - # run before each test - @api_instance = Bandwidth::MFAApi.new - end + # mfa info + let(:message) { 'Your temporary {NAME} {SCOPE} code is: {CODE}' } + let(:message_id) { '1687965513364hx26ky4mpkll3m5a' } + let(:call_id) { 'c-28bba681-cffc7d67-904e-42c8-85c5-b5589ea583b4' } + let(:digits) { 6 } - after do - # run after each test + # stubs + let(:generate_messaging_code_body_stub) { "{\"messageId\": \"#{message_id}\"}" } + let(:generate_messaging_code_headers_stub) { { 'content-type' => 'application/json', 'content-length' => "#{generate_messaging_code_body_stub.length}" } } + let(:generate_voice_code_body_stub) { "{\"callId\": \"#{call_id}\"}" } + let(:generate_voice_code_headers_stub) { { 'content-type' => 'application/json', 'content-length' => "#{generate_voice_code_body_stub.length}" } } + let(:verify_code_body_stub) { '{"valid": false}' } + let(:verify_code_headers_stub) { { 'content-type' => 'application/json', 'content-length' => "#{verify_code_body_stub.length}" } } + + before(:all) do + Bandwidth.configure do |config| + config.debugging = true + end + @mfa_api_instance = Bandwidth::MFAApi.new end describe 'test an instance of MFAApi' do it 'should create an instance of MFAApi' do - expect(@api_instance).to be_instance_of(Bandwidth::MFAApi) + expect(@mfa_api_instance).to be_instance_of(Bandwidth::MFAApi) end end - # unit tests for generate_messaging_code # Messaging Authentication Code - # Send an MFA code via text message (SMS). - # @param account_id Your Bandwidth Account ID. - # @param code_request MFA code request body. - # @param [Hash] opts the optional parameters - # @return [MessagingCodeResponse] - describe 'generate_messaging_code test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'generate_messaging_code' do + it 'generates messaging mfa code' do + stub_request(:post, "https://mfa.bandwidth.com/api/v1/accounts/#{BW_ACCOUNT_ID}/code/messaging"). + to_return(status: 200, headers: generate_messaging_code_headers_stub, body: generate_messaging_code_body_stub) + + req_schema = Bandwidth::CodeRequest.new( + to: USER_NUMBER, + from: BW_NUMBER, + application_id: BW_MESSAGING_APPLICATION_ID, + message: message, + digits: digits + ) + + data, status_code, headers = @mfa_api_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::MessagingCodeResponse) + expect(data.message_id).to eq(message_id) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @mfa_api_instance.generate_messaging_code(nil, {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing code_request' do + expect { + @mfa_api_instance.generate_messaging_code(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) end end - # unit tests for generate_voice_code # Voice Authentication Code - # Send an MFA Code via a phone call. - # @param account_id Your Bandwidth Account ID. - # @param code_request MFA code request body. - # @param [Hash] opts the optional parameters - # @return [VoiceCodeResponse] - describe 'generate_voice_code test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'generate_voice_code' do + it 'generates voice mfa code' do + stub_request(:post, "https://mfa.bandwidth.com/api/v1/accounts/#{BW_ACCOUNT_ID}/code/voice"). + to_return(status: 200, headers: generate_voice_code_headers_stub, body: generate_voice_code_body_stub) + + req_schema = Bandwidth::CodeRequest.new( + to: USER_NUMBER, + from: BW_NUMBER, + application_id: BW_VOICE_APPLICATION_ID, + message: message, + digits: digits + ) + + data, status_code, headers = @mfa_api_instance.generate_voice_code_with_http_info(BW_ACCOUNT_ID, req_schema) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::VoiceCodeResponse) + expect(data.call_id).to eq(call_id) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @mfa_api_instance.generate_voice_code(nil, {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing code_request' do + expect { + @mfa_api_instance.generate_voice_code(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) end end - # unit tests for verify_code # Verify Authentication Code - # Verify a previously sent MFA code. - # @param account_id Your Bandwidth Account ID. - # @param verify_code_request MFA code verify request body. - # @param [Hash] opts the optional parameters - # @return [VerifyCodeResponse] - describe 'verify_code test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'verify_code' do + it 'verifies mfa code' do + stub_request(:post, "https://mfa.bandwidth.com/api/v1/accounts/#{BW_ACCOUNT_ID}/code/verify"). + to_return(status: 200, headers: verify_code_headers_stub, body: verify_code_body_stub) + + req_schema = Bandwidth::VerifyCodeRequest.new( + to: '+1000' + rand(1...10000000).to_s, + scope: '2FA', + expiration_time_in_minutes: 3, + code: '12345' + ) + + data, status_code, headers = @mfa_api_instance.verify_code_with_http_info(BW_ACCOUNT_ID, req_schema) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::VerifyCodeResponse) + expect(data.valid).to be false end - end + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @mfa_api_instance.verify_code(nil, {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing cvarify_ode_request' do + expect { + @mfa_api_instance.verify_code(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) + end + end end diff --git a/spec/api/phone_number_lookup_api_spec.rb b/spec/api/phone_number_lookup_api_spec.rb index 0d736f05..835a7be4 100644 --- a/spec/api/phone_number_lookup_api_spec.rb +++ b/spec/api/phone_number_lookup_api_spec.rb @@ -1,61 +1,100 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' - # Unit tests for Bandwidth::PhoneNumberLookupApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate describe 'PhoneNumberLookupApi' do - before do - # run before each test - @api_instance = Bandwidth::PhoneNumberLookupApi.new - end + # lookup info + let(:request_id) { '21e6d818-eaa9-4ca9-b1d8-d6085f5c79d4' } + let(:status_in_progress) { Bandwidth::LookupStatusEnum::IN_PROGRESS } + let(:status_complete) { Bandwidth::LookupStatusEnum::COMPLETE } + let(:response_code) { 0 } + let(:message) { 'NOERROR' } + let(:formatted) { "(#{BW_NUMBER[2..4]}) #{BW_NUMBER[5..7]}-#{BW_NUMBER[7..-1]}" } + let(:country) { 'US' } + let(:line_type) { 'Mobile' } + let(:line_provider) { 'AdHoc P2P - Bandwidth - SVR' } - after do - # run after each test + # stubs + let(:create_lookup_headers_stub) { { 'content-type' => 'application/json' } } + let(:create_lookup_body_stub) { "{\"requestId\":\"#{request_id}\",\"status\":\"#{status_in_progress}\"}" } + let(:get_lookup_status_headers_stub) { { 'content-type' => 'application/json' } } + let(:get_lookup_status_body_stub) { "{\"requestId\":\"#{request_id}\",\"status\":\"#{status_complete}\",\"result\":[{\"Response Code\":#{response_code},\"Message\":\"#{message}\",\"E.164 Format\":\"#{BW_NUMBER}\",\"Formatted\":\"#{formatted}\",\"Country\":\"#{country}\",\"Line Type\":\"#{line_type}\",\"Line Provider\":\"#{line_provider}\"}]}" } + + before(:all) do + Bandwidth.configure do |config| + config.debugging = true + end + @phone_number_lookup_api_instance = Bandwidth::PhoneNumberLookupApi.new end describe 'test an instance of PhoneNumberLookupApi' do it 'should create an instance of PhoneNumberLookupApi' do - expect(@api_instance).to be_instance_of(Bandwidth::PhoneNumberLookupApi) + expect(@phone_number_lookup_api_instance).to be_instance_of(Bandwidth::PhoneNumberLookupApi) end end - # unit tests for create_lookup # Create Lookup - # Create a Phone Number Lookup Request. - # @param account_id Your Bandwidth Account ID. - # @param lookup_request Phone number lookup request. - # @param [Hash] opts the optional parameters - # @return [CreateLookupResponse] - describe 'create_lookup test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'create_lookup' do + it 'creates a tn lookup request' do + stub_request(:post, "https://numbers.bandwidth.com/api/v1/accounts/#{BW_ACCOUNT_ID}/tnlookup"). + to_return(status: 202, headers: create_lookup_headers_stub, body: create_lookup_body_stub) + + tn_body = Bandwidth::LookupRequest.new( + tns: [BW_NUMBER] + ) + data, status_code, headers = @phone_number_lookup_api_instance.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body) + + expect(status_code).to eq(202) + expect(headers).to eq(create_lookup_headers_stub) + expect(data).to be_instance_of(Bandwidth::CreateLookupResponse) + expect(data.request_id).to eq(request_id) + expect(data.status).to eq(status_in_progress) end - end - # unit tests for get_lookup_status - # Get Lookup Request Status - # Get an existing Phone Number Lookup Request. - # @param account_id Your Bandwidth Account ID. - # @param request_id The phone number lookup request ID from Bandwidth. - # @param [Hash] opts the optional parameters - # @return [LookupStatus] - describe 'get_lookup_status test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @phone_number_lookup_api_instance.create_lookup(nil, {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing lookup_request' do + expect { + @phone_number_lookup_api_instance.create_lookup(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) end end + # Get Lookup Status + describe 'get_lookup_status' do + it 'gets lookup status' do + stub_request(:get, "https://numbers.bandwidth.com/api/v1/accounts/#{BW_ACCOUNT_ID}/tnlookup/#{request_id}"). + to_return(status: 200, headers: get_lookup_status_headers_stub, body: get_lookup_status_body_stub) + + data, status_code, headers = @phone_number_lookup_api_instance.get_lookup_status_with_http_info(BW_ACCOUNT_ID, request_id) + + expect(status_code).to eq(200) + expect(headers).to eq(get_lookup_status_headers_stub) + expect(data).to be_instance_of(Bandwidth::LookupStatus) + expect(data.request_id).to eq(request_id) + expect(data.status).to eq(status_complete) + expect(data.result).to be_instance_of(Array) + expect(data.result[0]).to be_instance_of(Bandwidth::LookupResult) + expect(data.result[0].response_code).to eq(response_code) + expect(data.result[0].message).to eq(message) + expect(data.result[0].e_164_format).to eq(BW_NUMBER) + expect(data.result[0].formatted).to eq(formatted) + expect(data.result[0].country).to eq(country) + expect(data.result[0].line_type).to eq(line_type) + expect(data.result[0].line_provider).to eq(line_provider) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @phone_number_lookup_api_instance.get_lookup_status(nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing request_id' do + expect { + @phone_number_lookup_api_instance.get_lookup_status(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) + end + end end diff --git a/spec/api/recordings_api_spec.rb b/spec/api/recordings_api_spec.rb index 7fdecc26..21b44ddb 100644 --- a/spec/api/recordings_api_spec.rb +++ b/spec/api/recordings_api_spec.rb @@ -1,177 +1,395 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' - # Unit tests for Bandwidth::RecordingsApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate describe 'RecordingsApi' do - before do - # run before each test - @api_instance = Bandwidth::RecordingsApi.new - end + # recording info + let(:call_id) { 'c-3f758f24-40c0bd9f-0a8e-4ab6-88d4-c88a2e961c7d' } + let(:recording_id) { 'r-fbe05094-87f9b821-e110-4bfb-ac57-82b2bf2bb3d5' } + let(:duration) { 'PT4.478S' } + let(:direction) { Bandwidth::CallDirectionEnum::OUTBOUND } + let(:channels) { 1 } + let(:start_time) { '2023-06-26T14:58:51.195Z' } + let(:end_time) { '2023-06-26T14:58:57.502Z' } + let(:file_format) { Bandwidth::FileFormatEnum::WAV } + let(:status) { 'complete' } + let(:media_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/media" } + let(:text) { 'Now a recording, a long pause.' } + let(:confidence) { 0.975 } + let(:test_id) { 'test id' } - after do - # run after each test + # stubs + let(:download_call_recording_body_stub) { 'RIFFFWAVEfmtLISTINFOISFTLavf58.45.100data' } + let(:download_call_recording_headers_stub) { { 'content-type' => 'audio/vnd.wave', 'content-length' => "#{download_call_recording_body_stub.length}" } } + let(:get_call_recording_headers_stub) { { 'content-type' => 'application/json' } } + let(:get_call_recording_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"recordingId\":\"#{recording_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"duration\":\"#{duration}\",\"direction\":\"#{direction}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}" } + let(:get_call_transcription_headers_stub) { { 'content-type' => 'application/json' } } + let(:get_call_transcription_body_stub) { "{\"transcripts\":[{\"text\":\"#{text}\",\"confidence\":#{confidence}}]}" } + let(:list_account_call_recordings_headers_stub) { { 'content-type' => 'application/json' } } + let(:list_account_call_recordings_body_stub) { "[{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"recordingId\":\"#{recording_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"duration\":\"#{duration}\",\"direction\":\"#{direction}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}]" } + let(:list_call_recordings_headers_stub) { { 'content-type' => 'application/json' } } + let(:list_call_recordings_body_stub) { "[{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"recordingId\":\"#{recording_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"duration\":\"#{duration}\",\"direction\":\"#{direction}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}]" } + let(:update_call_recording_state_headers_stub) { { 'content-length' => '0' } } + + before(:all) do + Bandwidth.configure do |config| + config.return_binary_data = true + config.debugging = true + end + @recordings_api_instance = Bandwidth::RecordingsApi.new end describe 'test an instance of RecordingsApi' do it 'should create an instance of RecordingsApi' do - expect(@api_instance).to be_instance_of(Bandwidth::RecordingsApi) + expect(@recordings_api_instance).to be_instance_of(Bandwidth::RecordingsApi) end end - # unit tests for delete_call_transcription # Delete Transcription - # 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. - # @param call_id Programmable Voice API Call ID. - # @param recording_id Programmable Voice API Recording ID. - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_call_transcription test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'delete_call_transcription' do + it 'deletes the completed call recording transcription' do + stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/transcription"). + to_return(status: 204) + + data, status_code, headers = @recordings_api_instance.delete_call_transcription_with_http_info(BW_ACCOUNT_ID, call_id, recording_id) + + expect(status_code).to eq(204) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @recordings_api_instance.delete_call_transcription(nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @recordings_api_instance.delete_call_transcription(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing recording_id' do + expect { + @recordings_api_instance.delete_call_transcription(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for delete_recording # Delete Recording - # 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. - # @param call_id Programmable Voice API Call ID. - # @param recording_id Programmable Voice API Recording ID. - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_recording test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'delete_recording' do + it 'deletes the completed call recording data' do + stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}"). + to_return(status: 204) + + data, status_code, headers = @recordings_api_instance.delete_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id) + + expect(status_code).to eq(204) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @recordings_api_instance.delete_recording(nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @recordings_api_instance.delete_recording(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing recording_id' do + expect { + @recordings_api_instance.delete_recording(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for delete_recording_media # Delete Recording Media - # Deletes the specified recording's media. - # @param account_id Your Bandwidth Account ID. - # @param call_id Programmable Voice API Call ID. - # @param recording_id Programmable Voice API Recording ID. - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_recording_media test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'delete_recording_media' do + it 'deletes the completed call recording media' do + stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/media"). + to_return(status: 204) + + data, status_code, headers = @recordings_api_instance.delete_recording_media_with_http_info(BW_ACCOUNT_ID, call_id, recording_id) + + expect(status_code).to eq(204) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @recordings_api_instance.delete_recording_media(nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @recordings_api_instance.delete_recording_media(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing recording_id' do + expect { + @recordings_api_instance.delete_recording_media(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for download_call_recording # Download Recording - # Downloads the specified recording. - # @param account_id Your Bandwidth Account ID. - # @param call_id Programmable Voice API Call ID. - # @param recording_id Programmable Voice API Recording ID. - # @param [Hash] opts the optional parameters - # @return [File] - describe 'download_call_recording test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'download_call_recording' do + it 'downloads a call recording by id' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/media"). + to_return(status: 200, headers: download_call_recording_headers_stub, body: download_call_recording_body_stub) + + data, status_code, headers = @recordings_api_instance.download_call_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id) + + expect(status_code).to eq(200) + expect(headers).to eq(download_call_recording_headers_stub) + expect(data).to eq(download_call_recording_body_stub) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @recordings_api_instance.download_call_recording(nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @recordings_api_instance.download_call_recording(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing recording_id' do + expect { + @recordings_api_instance.download_call_recording(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for get_call_recording # Get Call Recording - # Returns metadata for the specified recording. - # @param account_id Your Bandwidth Account ID. - # @param call_id Programmable Voice API Call ID. - # @param recording_id Programmable Voice API Recording ID. - # @param [Hash] opts the optional parameters - # @return [CallRecordingMetadata] - describe 'get_call_recording test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'get_call_recording' do + it 'gets a call recording by id' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}"). + to_return(status: 200, headers: get_call_recording_headers_stub, body: get_call_recording_body_stub) + + data, status_code, headers = @recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id) + + expect(status_code).to eq(200) + expect(headers).to eq(get_call_recording_headers_stub) + expect(data).to be_instance_of(Bandwidth::CallRecordingMetadata) + expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID) + expect(data.account_id).to eq(BW_ACCOUNT_ID) + expect(data.call_id).to eq(call_id) + expect(data.recording_id).to eq(recording_id) + expect(data.to).to eq(USER_NUMBER) + expect(data.from).to eq(BW_NUMBER) + expect(data.duration).to eq(duration) + expect(data.direction).to eq(direction) + expect(data.channels).to eq(channels) + expect(data.start_time).to eq(Time.parse(start_time)) + expect(data.end_time).to eq(Time.parse(end_time)) + expect(data.file_format).to eq(file_format) + expect(data.status).to eq(status) + expect(data.media_url).to eq(media_url) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @recordings_api_instance.get_call_recording(nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @recordings_api_instance.get_call_recording(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing recording_id' do + expect { + @recordings_api_instance.get_call_recording(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for get_call_transcription # 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 [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/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. - # @param call_id Programmable Voice API Call ID. - # @param recording_id Programmable Voice API Recording ID. - # @param [Hash] opts the optional parameters - # @return [TranscriptionList] - describe 'get_call_transcription test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'get_call_transcription' do + it 'gets the completed call recording transcription' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/transcription"). + to_return(status: 200, headers: get_call_transcription_headers_stub, body: get_call_transcription_body_stub) + + data, status_code, headers = @recordings_api_instance.get_call_transcription_with_http_info(BW_ACCOUNT_ID, call_id, recording_id) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::TranscriptionList) + expect(data.transcripts).to be_instance_of(Array) + expect(data.transcripts[0]).to be_instance_of(Bandwidth::Transcription) + expect(data.transcripts[0].text).to eq(text) + expect(data.transcripts[0].confidence).to eq(confidence) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @recordings_api_instance.get_call_transcription(nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @recordings_api_instance.get_call_transcription(BW_ACCOUNT_ID, nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing recording_id' do + expect { + @recordings_api_instance.get_call_transcription(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for list_account_call_recordings # Get Call Recordings - # Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria. - # @param account_id Your Bandwidth Account ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :to Filter results by the `to` field. - # @option opts [String] :from Filter results by the `from` field. - # @option opts [String] :min_start_time Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). - # @option opts [String] :max_start_time Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). - # @return [Array] - describe 'list_account_call_recordings test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'list_account_call_recordings' do + it 'lists account call recordings' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/recordings"). + to_return(status: 200, headers: list_account_call_recordings_headers_stub, body: list_account_call_recordings_body_stub) + + data, status_code, headers = @recordings_api_instance.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Array) + expect(data[0]).to be_instance_of(Bandwidth::CallRecordingMetadata) + expect(data[0].application_id).to eq(BW_VOICE_APPLICATION_ID) + expect(data[0].account_id).to eq(BW_ACCOUNT_ID) + expect(data[0].call_id).to eq(call_id) + expect(data[0].recording_id).to eq(recording_id) + expect(data[0].to).to eq(USER_NUMBER) + expect(data[0].from).to eq(BW_NUMBER) + expect(data[0].duration).to eq(duration) + expect(data[0].direction).to eq(direction) + expect(data[0].channels).to eq(channels) + expect(data[0].start_time).to eq(Time.parse(start_time)) + expect(data[0].end_time).to eq(Time.parse(end_time)) + expect(data[0].file_format).to eq(file_format) + expect(data[0].status).to eq(status) + expect(data[0].media_url).to eq(media_url) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @recordings_api_instance.list_account_call_recordings(nil) + }.to raise_error(ArgumentError) end end - # unit tests for list_call_recordings # List Call Recordings - # Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. - # @param account_id Your Bandwidth Account ID. - # @param call_id Programmable Voice API Call ID. - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'list_call_recordings test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'list_call_recordings' do + it 'lists all recordings for a single call' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings"). + to_return(status: 200, headers: list_call_recordings_headers_stub, body: list_call_recordings_body_stub) + + data, status_code, headers = @recordings_api_instance.list_call_recordings_with_http_info(BW_ACCOUNT_ID, call_id) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Array) + expect(data[0].application_id).to eq(BW_VOICE_APPLICATION_ID) + expect(data[0].account_id).to eq(BW_ACCOUNT_ID) + expect(data[0].call_id).to eq(call_id) + expect(data[0].recording_id).to eq(recording_id) + expect(data[0].to).to eq(USER_NUMBER) + expect(data[0].from).to eq(BW_NUMBER) + expect(data[0].duration).to eq(duration) + expect(data[0].direction).to eq(direction) + expect(data[0].channels).to eq(channels) + expect(data[0].start_time).to eq(Time.parse(start_time)) + expect(data[0].end_time).to eq(Time.parse(end_time)) + expect(data[0].file_format).to eq(file_format) + expect(data[0].status).to eq(status) + expect(data[0].media_url).to eq(media_url) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @recordings_api_instance.list_call_recordings(nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @recordings_api_instance.list_call_recordings(BW_ACCOUNT_ID, nil) + }.to raise_error(ArgumentError) end end - # unit tests for transcribe_call_recording # Create Transcription Request - # Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. - # @param account_id Your Bandwidth Account ID. - # @param call_id Programmable Voice API Call ID. - # @param recording_id Programmable Voice API Recording ID. - # @param transcribe_recording - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'transcribe_call_recording test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'transcribe_call_recording' do + it 'creates a transcription request' do + stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/transcription"). + to_return(status: 204) + + transcribe_recording = Bandwidth::TranscribeRecording.new( + callback_url: BASE_CALLBACK_URL + '/transcriptions', + tag: test_id + ) + + data, status_code, headers = @recordings_api_instance.transcribe_call_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id, transcribe_recording) + + expect(status_code).to eq(204) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @recordings_api_instance.transcribe_call_recording(nil, '', '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @recordings_api_instance.transcribe_call_recording(BW_ACCOUNT_ID, nil, '', '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing recording_id' do + expect { + @recordings_api_instance.transcribe_call_recording(BW_ACCOUNT_ID, '', nil, '') + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing transcribe_recording' do + expect { + @recordings_api_instance.transcribe_call_recording(BW_ACCOUNT_ID, '', '', nil) + }.to raise_error(ArgumentError) end end - # unit tests for update_call_recording_state # Update Recording - # Pause or resume a recording on an active phone call. - # @param account_id Your Bandwidth Account ID. - # @param call_id Programmable Voice API Call ID. - # @param update_call_recording - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'update_call_recording_state test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'update_call_recording_state' do + it 'updates and ends the manteca call recording' do + stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recording"). + to_return(status: 200, headers: update_call_recording_state_headers_stub) + + pause_recording = Bandwidth::UpdateCallRecording.new( + state: Bandwidth::RecordingStateEnum::PAUSED + ) + + data, status_code, headers = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, call_id, pause_recording) + + expect(status_code).to eq(200) + end + + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @recordings_api_instance.update_call_recording_state(nil, '', {}) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError for a missing call_id' do + expect { + @recordings_api_instance.update_call_recording_state(BW_ACCOUNT_ID, nil, {}) + }.to raise_error(ArgumentError) end - end + it 'causes an ArgumentError for a missing update_call_recording' do + expect { + @recordings_api_instance.update_call_recording_state(BW_ACCOUNT_ID, '', nil) + }.to raise_error(ArgumentError) + end + end end diff --git a/spec/api/statistics_api_spec.rb b/spec/api/statistics_api_spec.rb index 2ebf95b1..4a5975c6 100644 --- a/spec/api/statistics_api_spec.rb +++ b/spec/api/statistics_api_spec.rb @@ -1,47 +1,45 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' - # Unit tests for Bandwidth::StatisticsApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate describe 'StatisticsApi' do - before do - # run before each test - @api_instance = Bandwidth::StatisticsApi.new - end - - after do - # run after each test + # statistics info + let(:current_call_queue_size) { 0 } + let(:max_call_queue_size) { 7500 } + + # stubs + let(:get_statistics_headers_stub) { { 'content-type' => 'application/json' } } + let(:get_statistics_body_stub) { "{\"currentCallQueueSize\":#{current_call_queue_size},\"maxCallQueueSize\":#{max_call_queue_size}}" } + + before(:all) do + Bandwidth.configure do |config| + config.debugging = true + end + @statistics_api_instance = Bandwidth::StatisticsApi.new end describe 'test an instance of StatisticsApi' do it 'should create an instance of StatisticsApi' do - expect(@api_instance).to be_instance_of(Bandwidth::StatisticsApi) + expect(@statistics_api_instance).to be_instance_of(Bandwidth::StatisticsApi) end end - # unit tests for get_statistics # Get Account Statistics - # Returns details about the current state of the account. - # @param account_id Your Bandwidth Account ID. - # @param [Hash] opts the optional parameters - # @return [AccountStatistics] - describe 'get_statistics test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'get_statistics' do + it 'gets account statistics' do + stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/statistics"). + to_return(status: 200, headers: get_statistics_headers_stub, body: get_statistics_body_stub) + + data, status_code, headers = @statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID) + + expect(status_code).to eq(200) + expect(headers).to eq(get_statistics_headers_stub) + expect(data).to be_instance_of(Bandwidth::AccountStatistics) + expect(data.current_call_queue_size).to eq(current_call_queue_size) + expect(data.max_call_queue_size).to eq(max_call_queue_size) end - end + it 'causes an ArgumentError for a missing account_id' do + expect { + resp = @statistics_api_instance.get_statistics(nil) + }.to raise_error(ArgumentError) + end + end end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index e771c6a2..b6ac4cae 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -1,223 +1,377 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 - -=end - - - +# Unit tests for Bandwidth::ApiClient describe Bandwidth::ApiClient do - context 'initialization' do - context 'URL stuff' do - context 'host' do - it 'removes http from host' do - Bandwidth.configure { |c| c.host = 'http://example.com' } - expect(Bandwidth::Configuration.default.host).to eq('example.com') - end - - it 'removes https from host' do - Bandwidth.configure { |c| c.host = 'https://wookiee.com' } - expect(Bandwidth::ApiClient.default.config.host).to eq('wookiee.com') - end - - it 'removes trailing path from host' do - Bandwidth.configure { |c| c.host = 'hobo.com/v4' } - expect(Bandwidth::Configuration.default.host).to eq('hobo.com') - end - end - - context 'base_path' do - it "prepends a slash to base_path" do - Bandwidth.configure { |c| c.base_path = 'v4/dog' } - expect(Bandwidth::Configuration.default.base_path).to eq('/v4/dog') - end - - it "doesn't prepend a slash if one is already there" do - Bandwidth.configure { |c| c.base_path = '/v4/dog' } - expect(Bandwidth::Configuration.default.base_path).to eq('/v4/dog') - end - - it "ends up as a blank string if nil" do - Bandwidth.configure { |c| c.base_path = nil } - expect(Bandwidth::Configuration.default.base_path).to eq('') - end - end + let(:api_client_default) { Bandwidth::ApiClient.new } + let(:config) { Bandwidth::Configuration.new } + let(:faraday_connection) { Faraday::Connection.new } + let(:api_client) { Bandwidth::ApiClient.new(config) } + let(:named_media_headers) { { 'content-disposition' => 'filename=test', 'content-type' => 'text/plain' } } + let(:media_data) { '123456' } + let(:media_headers) { { 'content-type' => 'text/plain' } } + let(:json_headers) { { 'content-type' => 'application/json' } } + let(:multipart_headers) { { 'Content-Type' => 'multipart/form-data' } } + let(:form_encoded_headers) { { 'Content-Type' => 'application/x-www-form-urlencoded' } } + let(:error_data) { '{"error": true}' } + + describe '#call_api' do + it 'calls api and returns a tempfile with name from content-disposition header' do + stub_request(:get, 'https://messaging.bandwidth.com/api/v2/path'). + to_return(status: 200, headers: media_headers, body: media_data) + + opts = { + operation: :"MediaApi.get_media", + header_params: {}, + query_params: {}, + form_params: {}, + body: nil, + auth_names: ['Basic'], + return_type: 'File' + } + data, status_code, headers = api_client.call_api(:GET, 'path', opts) + + expect(status_code).to eq(200) + expect(headers).to eq(media_headers) + expect(data).to be_a(Tempfile) end - end + it 'calls api and returns a tempfile' do + stub_request(:get, 'https://messaging.bandwidth.com/api/v2/path'). + to_return(status: 200, headers: named_media_headers, body: media_data) + + opts = { + operation: :"MediaApi.get_media", + header_params: {}, + query_params: {}, + form_params: {}, + body: nil, + auth_names: ['Basic'], + return_type: 'File' + } + data, status_code, headers = api_client.call_api(:GET, 'path', opts) + + expect(status_code).to eq(200) + expect(headers).to eq(named_media_headers) + expect(data).to be_a(Tempfile) + end - describe 'proxy in #build_connection' do - let(:config) { Bandwidth::Configuration.new } - let(:api_client) { Bandwidth::ApiClient.new(config) } - let(:proxy_uri) { URI('http://example.org:8080') } + it 'calls api and returns binary data' do + stub_request(:get, 'https://messaging.bandwidth.com/api/v2/path'). + to_return(status: 200, headers: media_headers, body: media_data) + + api_client.config.return_binary_data = true + api_client.config.debugging = true + + opts = { + operation: :"MediaApi.get_media", + header_params: {}, + query_params: {}, + form_params: {}, + body: nil, + auth_names: ['Basic'], + return_type: 'File' + } + data, status_code, headers = api_client.call_api(:GET, 'path', opts) + + expect(status_code).to eq(200) + expect(headers).to eq(media_headers) + expect(data).to eq(media_data) + end - it 'defaults to nil' do - expect(Bandwidth::Configuration.default.proxy).to be_nil - expect(config.proxy).to be_nil + it 'calls api and returns a hash' do + stub_request(:get, 'https://messaging.bandwidth.com/api/v2/path'). + to_return(status: 200, headers: json_headers, body: '{"id": 1}') + + opts = { + operation: :"MessagesApi.list_messages", + header_params: {}, + query_params: {}, + form_params: {}, + body: nil, + auth_names: ['Basic'], + return_type: 'Hash' + } + data, status_code, headers = api_client.call_api(:GET, 'path', opts) + + expect(status_code).to eq(200) + expect(headers).to eq(json_headers) + expect(data).to eq({ id: 1 }) + end - connection = api_client.build_connection - expect(connection.proxy_for_request('/test')).to be_nil + it 'posts data and returns nothing' do + stub_request(:post, 'https://messaging.bandwidth.com/api/v2/path'). + to_return(status: 204) + + api_client.config.debugging = true + + opts = { + operation: :"MediaApi.upload_media", + header_params: {}, + query_params: {}, + form_params: {}, + body: { id: 1 }, + auth_names: ['Basic'], + return_type: nil + } + data, status_code, headers = api_client.call_api(:POST, 'path', opts) + + expect(status_code).to eq(204) + expect(data).to be nil end - it 'can be customized with a string' do - config.proxy = proxy_uri.to_s + it 'posts multipart/form-data and returns nothing' do + stub_request(:post, 'https://messaging.bandwidth.com/api/v2/path'). + to_return(status: 204) + + opts = { + operation: :"MediaApi.upload_media", + header_params: multipart_headers, + query_params: {}, + form_params: { file: Tempfile.new('filename'), array: [1, 2, 3], string: '123' }, + body: nil, + auth_names: ['Basic'], + return_type: nil + } + data, status_code, headers = api_client.call_api(:POST, 'path', opts) + + expect(status_code).to eq(204) + expect(data).to be nil + end - connection = api_client.build_connection - configured_proxy = connection.proxy_for_request('/test') + it 'calls api and handles HTTP error' do + stub_request(:post, 'https://messaging.bandwidth.com/api/v2/path'). + to_return(status: 400, headers: json_headers, body: error_data) + + opts = { + operation: :"MediaApi.upload_media", + header_params: {}, + query_params: {}, + form_params: {}, + body: { id: 1 }, + auth_names: ['Basic'], + return_type: nil + } + + expect { + api_client.call_api(:POST, 'path', opts) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.code).to eq(400) + expect(e.response_headers).to eq(json_headers) + expect(e.response_body).to eq('{"error": true}') + } + end - expect(configured_proxy).not_to be_nil - expect(configured_proxy.uri.to_s).to eq proxy_uri.to_s + it 'calls api and handles timeout error' do + stub_request(:post, 'https://messaging.bandwidth.com/api/v2/path'). + to_raise(Faraday::TimeoutError) + + opts = { + operation: :"MediaApi.upload_media", + header_params: {}, + query_params: {}, + form_params: {}, + body: { id: 1 }, + auth_names: ['Basic'], + return_type: nil + } + + expect { + api_client.call_api(:POST, 'path', opts) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.message).to eq('Connection timed out') + } end - it 'can be customized with a hash' do - config.proxy = { uri: proxy_uri } + it 'calls api and handles connection error' do + stub_request(:post, 'https://messaging.bandwidth.com/api/v2/path'). + to_raise(Faraday::ConnectionFailed) + + opts = { + operation: :"MediaApi.upload_media", + header_params: {}, + query_params: {}, + form_params: {}, + body: { id: 1 }, + auth_names: ['Basic'], + return_type: nil + } + + expect { + api_client.call_api(:POST, 'path', opts) + }.to raise_error { |e| + expect(e).to be_instance_of(Bandwidth::ApiError) + expect(e.message).to eq('Connection failed') + } + end + end - connection = api_client.build_connection - configured_proxy = connection.proxy_for_request('/test') + describe '#build_request_body' do + it 'builds application/x-www-form-urlencoded' do + expect(api_client_default.build_request_body(form_encoded_headers, { id: 1 }, nil)).to eq('id=1') + end - expect(configured_proxy).not_to be_nil - expect(configured_proxy.uri).to eq proxy_uri + it 'builds empty body' do + expect(api_client_default.build_request_body({}, {}, nil)).to be nil end end describe '#deserialize' do - it "handles Array" do - api_client = Bandwidth::ApiClient.new - headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[12, 34]') - data = api_client.deserialize(response, 'Array') - expect(data).to be_instance_of(Array) - expect(data).to eq([12, 34]) - end - - it 'handles Array>' do - api_client = Bandwidth::ApiClient.new + it 'throws on invalid JSON when expecting JSON' do headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '[[12, 34], [56]]') - data = api_client.deserialize(response, 'Array>') - expect(data).to be_instance_of(Array) - expect(data).to eq([[12, 34], [56]]) + response = double('response', headers: headers, body: '{id 1}') + expect { + api_client_default.deserialize(response, 'Hash') + }.to raise_error(JSON::ParserError, 'unexpected token at \'{id 1}]\'') end - it 'handles Hash' do - api_client = Bandwidth::ApiClient.new + it 'rescues invalid JSON when expecting non-JSON' do headers = { 'Content-Type' => 'application/json' } - response = double('response', headers: headers, body: '{"message": "Hello"}') - data = api_client.deserialize(response, 'Hash') - expect(data).to be_instance_of(Hash) - expect(data).to eq(:message => 'Hello') + response = double('response', headers: headers, body: '2022-06-16') + data = api_client_default.deserialize(response, 'Date') + expect(data).to eq(Date.parse('2022-06-16')) end end - describe "#object_to_hash" do - it 'ignores nils and includes empty arrays' do - # uncomment below to test object_to_hash for model - # api_client = Bandwidth::ApiClient.new - # _model = Bandwidth::ModelName.new - # update the model attribute below - # _model.id = 1 - # update the expected value (hash) below - # expected = {id: 1, name: '', tags: []} - # expect(api_client.object_to_hash(_model)).to eq(expected) + describe '#basic_auth' do + it 'sets basic auth for the connection' do + api_client.config.username = 'username' + api_client.config.password = 'password' + api_client.basic_auth(faraday_connection) + expect(api_client.config.username).to eq('username') + expect(api_client.config.password).to eq('password') end end - describe '#build_collection_param' do - let(:param) { ['aa', 'bb', 'cc'] } - let(:api_client) { Bandwidth::ApiClient.new } + describe '#json_mime?' do + it 'checks if the given MIME is a JSON MIME' do + expect(api_client_default.json_mime?(nil)).to eq false + expect(api_client_default.json_mime?('')).to eq false - it 'works for csv' do - expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') - end + expect(api_client_default.json_mime?('application/json')).to eq true + expect(api_client_default.json_mime?('application/json; charset=UTF8')).to eq true + expect(api_client_default.json_mime?('APPLICATION/JSON')).to eq true - it 'works for ssv' do - expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc') + expect(api_client_default.json_mime?('application/xml')).to eq false + expect(api_client_default.json_mime?('text/plain')).to eq false + expect(api_client_default.json_mime?('application/jsonp')).to eq false end + end - it 'works for tsv' do - expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") + describe '#convert_to_type' do + it 'conversts data to the given return type' do + expect(api_client_default.convert_to_type(1, 'String')).to eq('1') + expect(api_client_default.convert_to_type('1', 'Integer')).to eq(1) + expect(api_client_default.convert_to_type('1', 'Float')).to eq(1.0) + expect(api_client_default.convert_to_type(1, 'Boolean')).to be false + expect(api_client_default.convert_to_type('2022-06-16T13:15:07.160Z', 'Time')).to eq(Time.parse('2022-06-16T13:15:07.160Z')) + expect(api_client_default.convert_to_type('2022-06-16', 'Date')).to eq(Date.parse('2022-06-16')) + expect(api_client_default.convert_to_type({ id: 1 }, 'Object')).to eq({ id: 1 }) + expect(api_client_default.convert_to_type([[12, 34], [56]], 'Array>')).to eq([[12, 34], [56]]) + expect(api_client_default.convert_to_type({ "id": 'test' }, 'Hash')).to eq({ id: 'test' }) + expect(api_client_default.convert_to_type({ set_or_expired: true }, 'DeferredResult')).to be_instance_of(Bandwidth::DeferredResult) end + end - it 'works for pipes' do - expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc') + describe '#sanitize_filename' do + it 'sanitizes a filename by removing the path' do + expect(api_client_default.sanitize_filename('sun')).to eq('sun') + expect(api_client_default.sanitize_filename('sun.gif')).to eq('sun.gif') + expect(api_client_default.sanitize_filename('../sun.gif')).to eq('sun.gif') + expect(api_client_default.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') + expect(api_client_default.sanitize_filename('./sun.gif')).to eq('sun.gif') + expect(api_client_default.sanitize_filename('..\sun.gif')).to eq('sun.gif') + expect(api_client_default.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client_default.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client_default.sanitize_filename('.\sun.gif')).to eq('sun.gif') end - - it 'works for multi' do - expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) + end + + describe '#build_request_url' do + it 'adds leading and trailing slashes to path' do + expect(api_client_default.build_request_url('test/path')).to eq('/test/path') end - - it 'fails for invalid collection format' do - expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') + end + + describe '#update_params_for_auth' do + it 'updates header and query params based on authentication settings' do + end end - - describe '#json_mime?' do - let(:api_client) { Bandwidth::ApiClient.new } - - it 'works' do - expect(api_client.json_mime?(nil)).to eq false - expect(api_client.json_mime?('')).to eq false - - expect(api_client.json_mime?('application/json')).to eq true - expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true - expect(api_client.json_mime?('APPLICATION/JSON')).to eq true - - expect(api_client.json_mime?('application/xml')).to eq false - expect(api_client.json_mime?('text/plain')).to eq false - expect(api_client.json_mime?('application/jsonp')).to eq false + + describe '#user_agent=' do + it 'sets user agent in HTTP header' do + api_client_default.user_agent = 'test-user-agent' + expect(api_client_default.default_headers['User-Agent']).to eq('test-user-agent') end end describe '#select_header_accept' do - let(:api_client) { Bandwidth::ApiClient.new } - - it 'works' do - expect(api_client.select_header_accept(nil)).to be_nil - expect(api_client.select_header_accept([])).to be_nil + it 'returns Accept header based on an array of accepts provided' do + expect(api_client_default.select_header_accept(nil)).to be_nil + expect(api_client_default.select_header_accept([])).to be_nil - expect(api_client.select_header_accept(['application/json'])).to eq('application/json') - expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + expect(api_client_default.select_header_accept(['application/json'])).to eq('application/json') + expect(api_client_default.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client_default.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') + expect(api_client_default.select_header_accept(['application/xml'])).to eq('application/xml') + expect(api_client_default.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') end end describe '#select_header_content_type' do - let(:api_client) { Bandwidth::ApiClient.new } + it 'returns Content-Type header based on an array of content types provided' do + expect(api_client_default.select_header_content_type(nil)).to be_nil + expect(api_client_default.select_header_content_type([])).to be_nil + + expect(api_client_default.select_header_content_type(['application/json'])).to eq('application/json') + expect(api_client_default.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client_default.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + expect(api_client_default.select_header_content_type(['application/xml'])).to eq('application/xml') + expect(api_client_default.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') + end + end + + describe '#object_to_http_body' do + it 'converts array to JSON string' do + model = [1, 2, 3] + expect(api_client_default.object_to_http_body(model)).to eq('[1,2,3]') + end - it 'works' do - expect(api_client.select_header_content_type(nil)).to be_nil - expect(api_client.select_header_content_type([])).to be_nil + it 'converts hash to JSON string' do + model = { id: 1 } + expect(api_client_default.object_to_http_body(model)).to eq('{"id":1}') + end + end + + describe '#object_to_hash' do + it 'returns object when object cannot be converted to hash' do + model = Object.new + model.instance_variable_set(:@id, 1) + expect(api_client_default.object_to_hash(model)).to be_instance_of(Object) + expect(api_client_default.object_to_hash(model).instance_variable_get('@id')).to eq(1) + end - expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') - expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') - expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') - expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml') - expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') + it 'returns hash when object can be converted to hash' do + model = Bandwidth::DeferredResult.new({ + set_or_expired: true + }) + expected = { setOrExpired: true } + expect(api_client_default.object_to_hash(model)).to eq(expected) end end - describe '#sanitize_filename' do - let(:api_client) { Bandwidth::ApiClient.new } - - it 'works' do - expect(api_client.sanitize_filename('sun')).to eq('sun') - expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') - expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif') + describe '#build_collection_param' do + it 'builds parameter value according to the given collection format' do + param = ['aa', 'bb', 'cc'] + expect(api_client_default.build_collection_param(param, :csv)).to eq('aa,bb,cc') + expect(api_client_default.build_collection_param(param, :ssv)).to eq('aa bb cc') + expect(api_client_default.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") + expect(api_client_default.build_collection_param(param, :pipes)).to eq('aa|bb|cc') + expect(api_client_default.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) + expect { + api_client_default.build_collection_param(param, :INVALID) + }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') end end end diff --git a/spec/api_error_spec.rb b/spec/api_error_spec.rb new file mode 100644 index 00000000..934e5cfb --- /dev/null +++ b/spec/api_error_spec.rb @@ -0,0 +1,23 @@ +# Unit tests for Bandwidth::ApiError +describe Bandwidth::ApiError do + describe '#initialize' do + it 'initializes an instance of ApiError with message' do + api_error = Bandwidth::ApiError.new({ message: 'test' }) + expect(api_error.message).to eq('test') + end + end + + describe '#to_s' do + it 'returns message when to_s is called' do + api_error = Bandwidth::ApiError.new('test') + expect(api_error.to_s).to eq('test') + end + end + + describe '#message' do + it 'returns default error message when none supplied' do + api_error = Bandwidth::ApiError.new + expect(api_error.message).to eq('Error message: the server returns an error') + end + end +end diff --git a/spec/call_utils.rb b/spec/call_utils.rb index 60743be0..d1ff4131 100644 --- a/spec/call_utils.rb +++ b/spec/call_utils.rb @@ -7,7 +7,7 @@ def setup_manteca(type) language: RUBY_VERSION, type: type } - manteca_test_url = URI(MANTECA_BASE_URL + "/tests") + manteca_test_url = URI(MANTECA_BASE_URL + '/tests') manteca_header = { 'Content-Type': 'application/json' } begin @@ -18,7 +18,7 @@ def setup_manteca(type) end end -def create_manteca_call(tag = "ruby", answer_path = "/bxml/pause", calls_api) +def create_manteca_call(tag = 'ruby', answer_path = '/bxml/pause', calls_api) manteca_call_body = Bandwidth::CreateCall.new( application_id: MANTECA_APPLICATION_ID, to: MANTECA_IDLE_NUMBER, @@ -33,7 +33,7 @@ def create_manteca_call(tag = "ruby", answer_path = "/bxml/pause", calls_api) end def get_manteca_test_status(test_id) - manteca_status_url = URI(MANTECA_BASE_URL + "/tests/" + test_id) + manteca_status_url = URI(MANTECA_BASE_URL + '/tests/' + test_id) response = JSON.parse(Net::HTTP.get(manteca_status_url)) response end @@ -48,7 +48,7 @@ def cleanup_calls(calls, calls_api) end if (calls.length > 0) - error_message = "Failed to terminate all calls" + calls.to_s + error_message = 'Failed to terminate all calls' + calls.to_s raise StandardError.new error_message end end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index eb25f795..c0b3da99 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -1,82 +1,178 @@ -=begin -#Bandwidth +require 'uri' -#Bandwidth's Communication APIs +# Unit tests for Bandwidth::Configuration +describe Bandwidth::Configuration do + let(:config) { Bandwidth::Configuration.new } + let(:faraday_connection) { Faraday::Connection.new } + let(:uri) { URI.parse(BASE_CALLBACK_URL + '/path') } + let(:token) { 'abcd1234' } + let(:server) { [ + { + url: 'https://voice.bandwidth.com/api/{enum_var}/{default_var}', + description: 'Production', + variables: { + enum_var: { + enum_values: ['v1', 'v2', 'v3'], + default_value: 'v2' + }, + default_var: { + default_value: 'default_value' + } + } + } + ] } + + describe '#configure' do + it 'configures a Configuration instance using a a block' do + config.configure do |c| + c.scheme = uri.scheme + c.host = uri.host + c.base_path = uri.path + end + expect(config.scheme).to eq(uri.scheme) + expect(config.host).to eq(uri.host) + expect(config.base_path).to eq(uri.path) + end + end -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 + describe 'custom attribute writers' do + it '#scheme=' do + config.scheme = 'scheme://' + expect(config.scheme).to eq('scheme') + end -=end + it '#host=' do + config.host = 'https://hostname' + expect(config.host).to eq('hostname') + end + it '#base_path=' do + config.base_path = 'basepath' + expect(config.base_path).to eq('/basepath') + end + end + describe '#base_url' do + it 'Returns default base URL when server_index is nil' do + config.server_index = nil + expect(config.base_url).to eq('http://localhost') + end -describe Bandwidth::Configuration do - let(:config) { Bandwidth::Configuration.new } + it 'returns empty string when invalid operation is passed' do + expect(config.base_url('invalid_operation')).to eq('') + end - before(:each) do - # uncomment below to setup host and base_path - # require 'URI' - # uri = URI.parse("http://localhost") - # Bandwidth.configure do |c| - # c.host = uri.host - # c.base_path = uri.path - # end + it 'returns proper base URL when server index is set' do + operation, server = config.operation_server_settings.first + expect(config.base_url(operation)).to eq(server[0][:url]) + end end - describe '#base_url' do - it 'should have the default value' do - # uncomment below to test default value of the base path - expect(config.base_url).to eq("") + describe '#api_key_with_prefix' do + it 'gets API key without prefix' do + config.api_key['Authorization'] = token + expect(config.api_key_with_prefix('Authorization')).to eq(token) end - it 'should remove trailing slashes' do - [nil, '', '/', '//'].each do |base_path| - config.base_path = base_path - # uncomment below to test trailing slashes - # expect(config.base_url).to eq("http://localhost") - end + it 'gets API key wit prefix' do + config.api_key_prefix['Authorization'] = 'Token' + config.api_key['Authorization'] = token + expect(config.api_key_with_prefix('Authorization')).to eq("Token #{token}") end end - describe '#configure_faraday_connection' do - let(:faraday_connection) { Faraday::Connection.new } + describe '#access_token_with_refresh' do + it 'gets the static access_token when no access_token_getter is defined' do + config.access_token = token + expect(config.access_token_with_refresh).to eq(token) + end - before do - stub_const('CustomAdapter', Class.new(Faraday::Adapter)) - stub_const('AnotherCustomAdapter', Class.new(Faraday::Adapter)) + it 'gets access_token using access_token_getter' do + config.access_token_getter = proc { token } + expect(config.access_token_with_refresh).to eq(token) + end + end - config.configure_faraday_connection do |conn| - conn.adapter CustomAdapter - conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger| - logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]') - end - end + describe '#basic_auth_token' do + it 'gets Basic Auth token string' do + config.username = 'username' + config.password = 'password' + expect(config.basic_auth_token).to eq('Basic dXNlcm5hbWU6cGFzc3dvcmQ=') end + end - it 'adds a block that will be used to configure the connection' do - expect(faraday_connection.adapter).to eq(Faraday::Adapter::NetHttp) - expect(faraday_connection.builder.handlers).to_not include(Faraday::Response::Logger) + describe '#auth_settings' do + it 'returns Auth Settings hash for api client' do + basic_auth = config.auth_settings['Basic'] + expect(basic_auth[:type]).to eq('basic') + expect(basic_auth[:in]).to eq('header') + expect(basic_auth[:key]).to eq('Authorization') + expect(basic_auth[:value]).to eq('Basic Og==') + end + end - config.configure_connection(faraday_connection) + describe '#server_url' do + it 'returns URL with enum variable substitued' do + expect(config.server_url(0, { enum_var: 'v3' }, server)).to eq('https://voice.bandwidth.com/api/v3/default_value') + end - expect(faraday_connection.adapter).to eq(CustomAdapter) - expect(faraday_connection.builder.handlers).to include(Faraday::Response::Logger) + it 'causes an ArgumentError by passing an invalid index' do + expect { + config.server_url(100) + }.to raise_error(ArgumentError) end - it 'supports multiple configuration blocks' do - config.configure_faraday_connection do |conn| - conn.adapter AnotherCustomAdapter + it 'causes an ArgumentError by passing an invalid value to an enum variable' do + expect { + config.server_url(0, { enum_var: 'v4' }, server) + }.to raise_error(ArgumentError) + end + end + + describe 'configure faraday connection' do + it '#configure_faraday_connection #configure_connection' do + config.configure_faraday_connection do |c| + config.username = 'username' end + config.configure_connection(faraday_connection) + expect(config.username).to eq('username') + end + end - expect(faraday_connection.adapter).to eq(Faraday::Adapter::NetHttp) - expect(faraday_connection.builder.handlers).to_not include(Faraday::Response::Logger) + describe '#set_faraday_middleware' do + it '#use' do + config.use(Faraday::Request::UrlEncoded) + expect(config.instance_variable_get('@middlewares')[:use]).to eq([[Faraday::Request::UrlEncoded, [], nil]]) + end - config.configure_connection(faraday_connection) + it '#request' do + config.request(:retry, max: 3, methods: [:get, :post], retry_statuses: [503]) + expect(config.instance_variable_get('@middlewares')[:request]).to eq([[:retry, [{ :max => 3, :methods => [:get, :post], :retry_statuses => [503] }], nil]]) + end + + it '#response' do + config.response(:logger, nil, { bodies: true, log_level: :debug }) + expect(config.instance_variable_get('@middlewares')[:response]).to eq([[:logger, [nil, { :bodies => true, :log_level => :debug }], nil]]) + end - expect(faraday_connection.adapter).to eq(AnotherCustomAdapter) + it 'causes an ArgumentError by passing an invalid middleware operation' do + expect { + config.set_faraday_middleware(:invalid_operation, Faraday::Request::UrlEncoded) + }.to raise_error(ArgumentError) + end + end + + describe '#configure_middleware' do + it 'builds connection using supplied response middleware' do + config.response(:logger) + config.configure_middleware(faraday_connection) expect(faraday_connection.builder.handlers).to include(Faraday::Response::Logger) end + + it 'builds connection using deleted middleware' do + config.set_faraday_middleware(:delete, Faraday::Request::UrlEncoded) + config.configure_middleware(faraday_connection) + expect(faraday_connection.builder.handlers).to eq([]) + end end end diff --git a/spec/integration/calls_api_integration_spec.rb b/spec/integration/calls_api_integration_spec.rb index 24eecda5..b0bca263 100644 --- a/spec/integration/calls_api_integration_spec.rb +++ b/spec/integration/calls_api_integration_spec.rb @@ -1,29 +1,45 @@ - -require 'json' require_relative '../call_utils' # Integration Tests for Bandwidth::CallsApi describe 'CallsApi Integration Tests' do + # call info + let(:answer_method) { Bandwidth::CallbackMethodEnum::POST } + let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' } + let(:answer_fallback_method) { Bandwidth::CallbackMethodEnum::POST } + let(:disconnect_method) { Bandwidth::CallbackMethodEnum::GET } + let(:disconnect_url) { BASE_CALLBACK_URL + '/callbacks/disconnect' } + let(:priority) { 5 } + let(:direction) { Bandwidth::CallDirectionEnum::OUTBOUND } + let(:call_timeout) { 30.0 } + let(:callback_timeout) { 15.0 } + before(:all) do + WebMock.allow_net_connect! Bandwidth.configure do |config| config.username = BW_USERNAME config.password = BW_PASSWORD end - @api_instance_calls = Bandwidth::CallsApi.new - $call_info_id = "" + @calls_api_instance = Bandwidth::CallsApi.new + + # call id + $call_info_id = '' + end + + after(:all) do + WebMock.disable_net_connect! end # Create Call describe 'create_call' do it 'creates a call with amd' do amd_config = Bandwidth::MachineDetectionConfiguration.new( - mode: "async", + mode: 'async', detection_timeout: 5.0, silence_timeout: 5.0, speech_threshold: 5.0, speech_end_threshold: 5.0, delay_result: true, - callback_url: BASE_CALLBACK_URL + "/machineDetection", + callback_url: BASE_CALLBACK_URL + '/machineDetection', callback_method: Bandwidth::CallbackMethodEnum::POST ) @@ -31,34 +47,34 @@ application_id: BW_VOICE_APPLICATION_ID, to: USER_NUMBER, from: BW_NUMBER, - answer_url: BASE_CALLBACK_URL + "/callbacks/answer", - answer_method: "POST", - disconnect_url: BASE_CALLBACK_URL + "/callbacks/disconnect", - disconnect_method: "GET", + answer_url: answer_url, + answer_method: answer_method, + disconnect_url: disconnect_url, + disconnect_method: disconnect_method, machine_detection: amd_config, - call_timeout: 30.0, - callback_timeout: 15.0 + call_timeout: call_timeout, + callback_timeout: callback_timeout ) - response = @api_instance_calls.create_call_with_http_info(BW_ACCOUNT_ID, call_body) - - expect(response[CODE]).to eq(201) - expect(response[DATA]).to be_instance_of(Bandwidth::CreateCallResponse) - expect(response[DATA].call_id.length).to eq(47) - expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) - expect(response[DATA].application_id).to eq(BW_VOICE_APPLICATION_ID) - expect(response[DATA].to).to eq(USER_NUMBER) - expect(response[DATA].from).to eq(BW_NUMBER) - expect(response[DATA].call_id) - expect(response[DATA].call_timeout).to eq(30.0) - expect(response[DATA].callback_timeout).to eq(15.0) - expect(response[DATA].enqueued_time).to be_instance_of(Time) - expect(response[DATA].answer_method).to eq(Bandwidth::CallbackMethodEnum::POST) - expect(response[DATA].disconnect_method).to eq("GET") - expect(response[DATA].answer_url).to eq(BASE_CALLBACK_URL + "/callbacks/answer") - expect(response[DATA].disconnect_url).to eq(BASE_CALLBACK_URL + "/callbacks/disconnect") - - $call_info_id = response[DATA].call_id + data, status_code, headers = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body) + + expect(status_code).to eq(201) + expect(data).to be_instance_of(Bandwidth::CreateCallResponse) + expect(data.call_id.length).to eq(47) + expect(data.account_id).to eq(BW_ACCOUNT_ID) + expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID) + expect(data.to).to eq(USER_NUMBER) + expect(data.from).to eq(BW_NUMBER) + expect(data.call_timeout).to eq(call_timeout) + expect(data.callback_timeout).to eq(callback_timeout) + expect(data.enqueued_time).to be_instance_of(Time) + expect(data.answer_method).to eq(answer_method) + expect(data.answer_fallback_method).to eq(answer_fallback_method) + expect(data.disconnect_method).to eq(disconnect_method) + expect(data.answer_url).to eq(answer_url) + expect(data.disconnect_url).to eq(disconnect_url) + + $call_info_id = data.call_id $active_calls.append($call_info_id) end end @@ -67,17 +83,18 @@ describe 'get_call_state' do it 'gets the call state' do begin - response = @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id) + sleep(SLEEP_TIME_S) + data, status_code, headers = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::CallState) - expect(response[DATA].call_id).to eq($call_info_id) - expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) - expect(response[DATA].application_id).to eq(BW_VOICE_APPLICATION_ID) - expect(response[DATA].start_time).to be_instance_of(Time) - expect(response[DATA].last_update).to be_instance_of(Time) - expect(response[DATA].state).to be_instance_of(String) - expect(response[DATA].direction).to eq(Bandwidth::CallDirectionEnum::OUTBOUND) + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::CallState) + expect(data.call_id).to eq($call_info_id) + expect(data.account_id).to eq(BW_ACCOUNT_ID) + expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID) + expect(data.start_time).to be_instance_of(Time) + expect(data.last_update).to be_instance_of(Time) + expect(data.state).to be_instance_of(String) + expect(data.direction).to eq(direction) rescue Bandwidth::ApiError => e if e.code != 404 raise e @@ -91,34 +108,34 @@ it 'creates and updates a call' do update_call_body = Bandwidth::UpdateCall.new( state: Bandwidth::CallStateEnum::ACTIVE, - redirect_url: MANTECA_BASE_URL + "/bxml/pause" + redirect_url: MANTECA_BASE_URL + '/bxml/pause' ) - update_call_id = create_manteca_call(@api_instance_calls) + update_call_id = create_manteca_call(@calls_api_instance) sleep(SLEEP_TIME_S) - update_response = @api_instance_calls.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, update_call_body) - expect(update_response[CODE]).to eq(200) + update_data, update_status_code, update_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, update_call_body) + expect(update_status_code).to eq(200) sleep(SLEEP_TIME_S) - complete_response = @api_instance_calls.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body) - expect(complete_response[CODE]).to eq(200) + complete_data, complete_status_code, complete_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body) + expect(complete_status_code).to eq(200) end end # Update Call BXML describe 'update_call_bxml' do it 'updates a call using bxml' do - update_call_id = create_manteca_call(@api_instance_calls) + update_call_id = create_manteca_call(@calls_api_instance) sleep(SLEEP_TIME_S) - update_bxml = "This is a test bxml response" - update_response = @api_instance_calls.update_call_bxml_with_http_info(BW_ACCOUNT_ID, update_call_id, update_bxml) - expect(update_response[CODE]).to eq(204) + update_bxml = 'This is a test bxml response' + update_data, update_status_code, update_headers = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, update_call_id, update_bxml) + expect(update_status_code).to eq(204) sleep(SLEEP_TIME_S) - complete_response = @api_instance_calls.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body) - expect(complete_response[CODE]).to eq(200) + complete_data, complete_status_code, complete_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body) + expect(complete_status_code).to eq(200) end end @@ -127,16 +144,16 @@ it 'causes a 400 error' do call_body_bad = Bandwidth::CreateCall.new( application_id: BW_VOICE_APPLICATION_ID, - to: "+1invalid", + to: '+1invalid', from: BW_NUMBER, - answer_url: BASE_CALLBACK_URL + "/callbacks/answer", - answer_method: "POST", - disconnect_url: BASE_CALLBACK_URL + "/callbacks/disconnect", - disconnect_method: "GET" + answer_url: answer_url, + answer_method: answer_method, + disconnect_url: disconnect_url, + disconnect_method: disconnect_method ) expect { - @api_instance_calls.create_call_with_http_info(BW_ACCOUNT_ID, call_body_bad) + @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body_bad) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(400) @@ -144,10 +161,8 @@ end it 'causes a 404 error' do - dne_id = "does-not-exist" - expect { - @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, dne_id) + @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, 'does-not-exist') }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(404) @@ -156,12 +171,12 @@ it 'causes a 401 error' do Bandwidth.configure do |config| - config.username = 'bad_username' - config.password = 'bad_password' + config.username = UNAUTHORIZED_USERNAME + config.password = UNAUTHORIZED_PASSWORD end expect { - @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id) + @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(401) @@ -175,12 +190,11 @@ end expect { - @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id) + @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(403) } end end - end diff --git a/spec/integration/conferences_api_integration_spec.rb b/spec/integration/conferences_api_integration_spec.rb index 844842bd..8db69f47 100644 --- a/spec/integration/conferences_api_integration_spec.rb +++ b/spec/integration/conferences_api_integration_spec.rb @@ -1,21 +1,26 @@ - -require 'json' require_relative '../call_utils' # Integration Tests for Bandwidth::ConferencesApi describe 'ConferencesApi Integration Tests' do before(:all) do + WebMock.allow_net_connect! Bandwidth.configure do |config| config.username = BW_USERNAME config.password = BW_PASSWORD config.return_binary_data = true end - @api_instance_conferences = Bandwidth::ConferencesApi.new - @api_instance_calls = Bandwidth::CallsApi.new + @conferences_api_instance = Bandwidth::ConferencesApi.new + @calls_api_instance = Bandwidth::CallsApi.new + + # conference info $manteca_test_id = setup_manteca('conference') - $manteca_call_id = create_manteca_call($manteca_test_id, "/bxml/joinConferencePause", @api_instance_calls) - $conference_id = "" - $recording_id = "" + $manteca_call_id = create_manteca_call($manteca_test_id, '/bxml/joinConferencePause', @calls_api_instance) + $conference_id = '' + $recording_id = '' + end + + after(:all) do + WebMock.disable_net_connect! end # Get Conferences @@ -26,37 +31,38 @@ } sleep(SLEEP_TIME_S) - response = @api_instance_conferences.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts) + data, status_code, headers = @conferences_api_instance.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts) - expect(response[CODE]).to eq(200) - expect(response[DATA][0]).to be_instance_of(Bandwidth::Conference) - expect(response[DATA][0].id).to be_instance_of(String) - $conference_id = response[DATA][0].id + expect(status_code).to eq(200) + expect(data).to be_instance_of(Array) + expect(data[0]).to be_instance_of(Bandwidth::Conference) + expect(data[0].id).to be_instance_of(String) + $conference_id = data[0].id end end # Get Conference Information describe 'get_conference' do it 'get a conference by id' do - response = @api_instance_conferences.get_conference_with_http_info(BW_ACCOUNT_ID, $conference_id) + data, status_code, headers = @conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, $conference_id) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::Conference) - expect(response[DATA].id).to eq($conference_id) - expect(response[DATA].name).to eq($manteca_test_id) - expect(response[DATA].tag).to eq($manteca_test_id) + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::Conference) + expect(data.id).to eq($conference_id) + expect(data.name).to eq($manteca_test_id) + expect(data.tag).to eq($manteca_test_id) end end # Get Conference Member describe 'get_conference_member' do it 'gets a conference member by call id' do - response = @api_instance_conferences.get_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id) + data, status_code, headers = @conferences_api_instance.get_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::ConferenceMember) - expect(response[DATA].conference_id).to eq($conference_id) - expect(response[DATA].call_id).to eq($manteca_call_id) + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::ConferenceMember) + expect(data.conference_id).to eq($conference_id) + expect(data.call_id).to eq($manteca_call_id) end end @@ -67,8 +73,8 @@ mute: false ) - response = @api_instance_conferences.update_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id, update_conference_member) - expect(response[CODE]).to eq(204) + data, status_code, headers = @conferences_api_instance.update_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id, update_conference_member) + expect(status_code).to eq(204) end end @@ -77,34 +83,34 @@ it 'updates a conference' do update_conference_body = Bandwidth::UpdateConference.new( status: Bandwidth::ConferenceStateEnum::ACTIVE, - redirect_url: MANTECA_BASE_URL + "/bxml/pause", + redirect_url: MANTECA_BASE_URL + '/bxml/pause', redirect_method: Bandwidth::RedirectMethodEnum::POST, - username: "username", - password: "password", - redirect_fallback_url: MANTECA_BASE_URL + "/bxml/pause", + username: 'username', + password: 'password', + redirect_fallback_url: MANTECA_BASE_URL + '/bxml/pause', redirect_fallback_method: Bandwidth::RedirectMethodEnum::POST, - fallback_username: "username", - fallback_password: "password" + fallback_username: 'username', + fallback_password: 'password' ) - response = @api_instance_conferences.update_conference_with_http_info(BW_ACCOUNT_ID, $conference_id, update_conference_body) - expect(response[CODE]).to eq(204) + data, status_code, headers = @conferences_api_instance.update_conference_with_http_info(BW_ACCOUNT_ID, $conference_id, update_conference_body) + expect(status_code).to eq(204) end end # Update Conference BXML describe 'update_conference_bxml' do it 'updates a conference using bxml' do - update_bxml = "This should be a conference recording." + update_bxml = 'This should be a conference recording.' - response = @api_instance_conferences.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, $conference_id, update_bxml) - expect(response[CODE]).to eq(204) + data, status_code, headers = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, $conference_id, update_bxml) + expect(status_code).to eq(204) retries = 0 recording_complete = false begin while !recording_complete && retries < MAX_RETRIES - recording_complete = get_manteca_test_status($manteca_test_id)["callRecorded"] + recording_complete = get_manteca_test_status($manteca_test_id)['callRecorded'] retries += 1 sleep(SLEEP_TIME_S) end @@ -112,52 +118,52 @@ puts e.inspect end - expect(recording_complete).to be_instance_of(TrueClass) + expect(recording_complete).to be true end end # Get Conference Recordings describe 'list_conference_recordings' do it 'lists recordings for a conference' do - response = @api_instance_conferences.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, $conference_id) - - expect(response[CODE]).to eq(200) - expect(response[DATA][0]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) - expect(response[DATA][0].conference_id).to eq($conference_id) - expect(response[DATA][0].account_id).to eq(BW_ACCOUNT_ID) - expect(response[DATA][0].name).to eq($manteca_test_id) - expect(response[DATA][0].status).to eq('complete').or eq('partial') - expect(response[DATA][0].recording_id).to be_instance_of(String) - expect(response[DATA][0].file_format).to eq(Bandwidth::FileFormatEnum::WAV) - - $recording_id = response[DATA][0].recording_id + data, status_code, headers = @conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, $conference_id) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Array) + expect(data[0]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) + expect(data[0].conference_id).to eq($conference_id) + expect(data[0].account_id).to eq(BW_ACCOUNT_ID) + expect(data[0].name).to eq($manteca_test_id) + expect(data[0].status).to eq('complete').or eq('partial') + expect(data[0].recording_id).to be_instance_of(String) + expect(data[0].file_format).to eq(Bandwidth::FileFormatEnum::WAV) + + $recording_id = data[0].recording_id end end # Get Conference Recording Information describe 'get_conference_recording' do it 'gets a conference recording by id' do - response = @api_instance_conferences.get_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id) - - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) - expect(response[DATA].conference_id).to eq($conference_id) - expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) - expect(response[DATA].name).to eq($manteca_test_id) - expect(response[DATA].status).to eq('complete').or eq('partial') - expect(response[DATA].recording_id).to be_instance_of(String) - expect(response[DATA].file_format).to eq(Bandwidth::FileFormatEnum::WAV) + data, status_code, headers = @conferences_api_instance.get_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) + expect(data.conference_id).to eq($conference_id) + expect(data.account_id).to eq(BW_ACCOUNT_ID) + expect(data.name).to eq($manteca_test_id) + expect(data.status).to eq('complete').or eq('partial') + expect(data.recording_id).to be_instance_of(String) + expect(data.file_format).to eq(Bandwidth::FileFormatEnum::WAV) end end # Download Conference Recording describe 'download_conference_recording test' do it 'should work' do - response = @api_instance_conferences.download_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id) + data, status_code, headers = @conferences_api_instance.download_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(String) + expect(status_code).to eq(200) + expect(data).to be_instance_of(String) end end - end diff --git a/spec/integration/media_api_integration_spec.rb b/spec/integration/media_api_integration_spec.rb index e5aeb5ba..77b04642 100644 --- a/spec/integration/media_api_integration_spec.rb +++ b/spec/integration/media_api_integration_spec.rb @@ -1,73 +1,80 @@ - -require 'json' - # Integration Tests for Bandwidth::MediaApi describe 'MediaApi Integration Tests' do + # media info + let(:binary_media_data) { '123456' } + let(:media_file_data) { File.open('spec/fixtures/ruby_cat.jpeg').read } + let(:media_file_md5) { Digest::MD5.hexdigest(media_file_data) } + before(:all) do + WebMock.allow_net_connect! Bandwidth.configure do |config| config.username = BW_USERNAME config.password = BW_PASSWORD config.return_binary_data = true end @api_instance_media = Bandwidth::MediaApi.new + + # media names @binary_media_name = 'ruby_binary_media' + SecureRandom.uuid - @binary_media_data = '123456' @media_file_name = 'ruby_media_file' + SecureRandom.uuid - @media_file_data = File.open("spec/fixtures/ruby_cat.jpeg").read - @media_file_md5 = Digest::MD5.hexdigest(@media_file_data) + end + + after(:all) do + WebMock.disable_net_connect! end # Upload Media describe 'upload_media' do it 'uploads binary media' do - response = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, @binary_media_data) - expect(response[CODE]).to eq(204) + data, status_code, headers = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, binary_media_data) + expect(status_code).to eq(204) end it 'uploads media file' do - response = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @media_file_name, @media_file_data) - expect(response[CODE]).to eq(204) + data, status_code, headers = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @media_file_name, media_file_data) + expect(status_code).to eq(204) end end # List Media describe 'list_media' do it 'lists media' do - response = @api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID) - expect(response[CODE]).to eq(200) - expect(response[DATA][0]).to be_instance_of(Bandwidth::Media) - expect(response[DATA][0].content).to be_instance_of(String) - expect(response[DATA][0].content_length).to be > 0 + data, status_code, headers = @api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID) + expect(status_code).to eq(200) + expect(data).to be_instance_of(Array) + expect(data[0]).to be_instance_of(Bandwidth::Media) + expect(data[0].content).to be_instance_of(String) + expect(data[0].content_length).to be > 0 end end # Get Media describe 'get_media' do it 'gets uploaded binary media' do - response = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, debug_return_type: 'String') - expect(response[CODE]).to eq(200) - expect(response[DATA]).to eq(@binary_media_data) + data, status_code, headers = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name) + expect(status_code).to eq(200) + expect(data).to eq(binary_media_data) end it 'gets uploaded media file' do - response = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @media_file_name) - response_md5 = Digest::MD5.hexdigest(response[DATA]) + data, status_code, headers = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @media_file_name) + response_md5 = Digest::MD5.hexdigest(data) - expect(response[CODE]).to eq(200) - expect(response_md5).to eq(@media_file_md5) + expect(status_code).to eq(200) + expect(response_md5).to eq(media_file_md5) end end # Delete Media describe 'delete_media' do it 'deletes the binary media' do - response = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name) - expect(response[CODE]).to eq(204) + data, status_code, headers = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name) + expect(status_code).to eq(204) end it 'deletes the media file' do - response = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @media_file_name) - expect(response[CODE]).to eq(204) + data, status_code, headers = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @media_file_name) + expect(status_code).to eq(204) end end @@ -75,12 +82,11 @@ describe 'http error' do it 'causes a 404 error' do expect { - response = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, "does_not_exist") + @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, 'does_not_exist') }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(404) } end end - end diff --git a/spec/integration/messages_api_integration_spec.rb b/spec/integration/messages_api_integration_spec.rb index f393dcf5..e5ed4a95 100644 --- a/spec/integration/messages_api_integration_spec.rb +++ b/spec/integration/messages_api_integration_spec.rb @@ -1,14 +1,28 @@ - -require 'json' - # Integration Tests for Bandwidth::MessagesApi describe 'MessagesApi Integration Tests' do + # message info + let(:mms_text) { 'ruby sdk test MMS' } + let(:sms_text) { 'ruby sdk test SMS' } + let(:mms_tag) { 'ruby sdk test MMS tag' } + let(:sms_tag) { 'ruby sdk test SMS tag' } + let(:media_url) { 'https://cdn2.thecatapi.com/images/MTY3ODIyMQ.jpg' } + let(:priority) { Bandwidth::PriorityEnum::HIGH } + let(:list_message_direction) { Bandwidth::ListMessageDirectionEnum::OUTBOUND } + before(:all) do + WebMock.allow_net_connect! Bandwidth.configure do |config| config.username = BW_USERNAME config.password = BW_PASSWORD end - @api_instance_msg = Bandwidth::MessagesApi.new() + @messaging_api_instance = Bandwidth::MessagesApi.new() + + # expiration time + @expiration_time = (Time.now + 60).round.to_datetime.rfc3339 + end + + after(:all) do + WebMock.disable_net_connect! end # Create Message @@ -18,49 +32,47 @@ application_id: BW_MESSAGING_APPLICATION_ID, to: [USER_NUMBER], from: BW_NUMBER, - text: "ruby sdk test MMS", - media: ["https://cdn2.thecatapi.com/images/MTY3ODIyMQ.jpg"], - tag: "ruby sdk test MMS tag" + text: mms_text, + media: [media_url], + tag: mms_tag ) - response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, message_request) + data, status_code, headers = @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, message_request) - expect(response[CODE]).to eq(202) - expect(response[DATA]).to be_instance_of(Bandwidth::Message) - expect(response[DATA].id.length).to eq(29) - expect(response[DATA].owner).to eq(BW_NUMBER) - expect(response[DATA].to).to eq([USER_NUMBER]) - expect(response[DATA].from).to eq(BW_NUMBER) - expect(response[DATA].text).to eq(message_request.text) - expect(response[DATA].media).to eq(message_request.media) - expect(response[DATA].tag).to eq(message_request.tag) + expect(status_code).to eq(202) + expect(data).to be_instance_of(Bandwidth::Message) + expect(data.id.length).to eq(29) + expect(data.owner).to eq(BW_NUMBER) + expect(data.to).to eq([USER_NUMBER]) + expect(data.from).to eq(BW_NUMBER) + expect(data.text).to eq(mms_text) + expect(data.media).to eq([media_url]) + expect(data.tag).to eq(mms_tag) end it 'creates an sms message' do - expiration_time = Time.now + 60 - expiration_time = expiration_time.round message_request = Bandwidth::MessageRequest.new( application_id: BW_MESSAGING_APPLICATION_ID, to: [USER_NUMBER], from: BW_NUMBER, - text: "ruby sdk test SMS", - tag: "ruby sdk test SMS tag", - priority: Bandwidth::PriorityEnum::HIGH, - expiration: expiration_time.to_datetime.rfc3339 + text: sms_text, + tag: sms_tag, + priority: priority, + expiration: @expiration_time ) - response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, message_request) + data, status_code, headers = @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, message_request) - expect(response[CODE]).to eq(202) - expect(response[DATA]).to be_instance_of(Bandwidth::Message) - expect(response[DATA].id.length).to eq(29) - expect(response[DATA].owner).to eq(BW_NUMBER) - expect(response[DATA].to).to eq([USER_NUMBER]) - expect(response[DATA].from).to eq(BW_NUMBER) - expect(response[DATA].text).to eq(message_request.text) - expect(response[DATA].tag).to eq(message_request.tag) - expect(response[DATA].priority).to eq(message_request.priority) - expect(response[DATA].expiration).to eq(expiration_time) + expect(status_code).to eq(202) + expect(data).to be_instance_of(Bandwidth::Message) + expect(data.id.length).to eq(29) + expect(data.owner).to eq(BW_NUMBER) + expect(data.to).to eq([USER_NUMBER]) + expect(data.from).to eq(BW_NUMBER) + expect(data.text).to eq(sms_text) + expect(data.tag).to eq(sms_tag) + expect(data.priority).to eq(priority) + expect(data.expiration).to eq(Time.parse(@expiration_time)) end end @@ -68,17 +80,18 @@ describe 'list_messages' do it 'lists messages' do get_opts = { - :source_tn => BW_NUMBER, - :message_direction => "OUTBOUND" + source_tn: BW_NUMBER, + message_direction: list_message_direction } - response = @api_instance_msg.list_messages_with_http_info(BW_ACCOUNT_ID, get_opts) + data, status_code, headers = @messaging_api_instance.list_messages_with_http_info(BW_ACCOUNT_ID, get_opts) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::MessagesList) - expect(response[DATA].messages[0]).to be_instance_of(Bandwidth::ListMessageItem) - expect(response[DATA].messages[0].account_id).to eq(BW_ACCOUNT_ID) - expect(response[DATA].messages[0].message_direction).to eq("OUTBOUND") - expect(response[DATA].messages[0].source_tn).to eq(BW_NUMBER) + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::MessagesList) + expect(data.messages).to be_instance_of(Array) + expect(data.messages[0]).to be_instance_of(Bandwidth::ListMessageItem) + expect(data.messages[0].account_id).to eq(BW_ACCOUNT_ID) + expect(data.messages[0].message_direction).to eq(list_message_direction) + expect(data.messages[0].source_tn).to eq(BW_NUMBER) end end @@ -87,13 +100,13 @@ it 'causes a 400 error' do body = Bandwidth::MessageRequest.new( application_id: BW_MESSAGING_APPLICATION_ID, - to: ["+1invalid"], + to: ['+1invalid'], from: BW_NUMBER, - text: "ruby sdk 400 test" + text: 'ruby sdk 400 test' ) expect { - $response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) + @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, body) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(400) @@ -102,19 +115,19 @@ it 'causes a 401 error' do Bandwidth.configure do |config| - config.username = 'bad_username' - config.password = 'bad_password' + config.username = UNAUTHORIZED_USERNAME + config.password = UNAUTHORIZED_PASSWORD end body = Bandwidth::MessageRequest.new( application_id: BW_MESSAGING_APPLICATION_ID, to: [USER_NUMBER], from: BW_NUMBER, - text: "ruby sdk 401 test" + text: 'ruby sdk 401 test' ) expect { - $response = @api_instance_msg.create_message_with_http_info(BW_ACCOUNT_ID, body) + @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, body) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(401) diff --git a/spec/integration/mfa_api_integration_spec.rb b/spec/integration/mfa_api_integration_spec.rb index d269352f..945c3c32 100644 --- a/spec/integration/mfa_api_integration_spec.rb +++ b/spec/integration/mfa_api_integration_spec.rb @@ -1,14 +1,20 @@ - -require 'json' - # Integration Tests for Bandwidth::MFAApi describe 'MFAApi Integration Tests' do + # mfa info + let(:message) { 'Your temporary {NAME} {SCOPE} code is: {CODE}' } + let(:digits) { 6 } + before(:all) do + WebMock.allow_net_connect! Bandwidth.configure do |config| config.username = BW_USERNAME config.password = BW_PASSWORD end - @api_instance_mfa = Bandwidth::MFAApi.new + @mfa_api_instance = Bandwidth::MFAApi.new + end + + after(:all) do + WebMock.disable_net_connect! end # Messaging Authentication Code @@ -18,14 +24,15 @@ to: USER_NUMBER, from: BW_NUMBER, application_id: BW_MESSAGING_APPLICATION_ID, - message: "Your temporary {NAME} {SCOPE} code is: {CODE}", - digits: 6 + message: message, + digits: digits ) - response = @api_instance_mfa.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::MessagingCodeResponse) - expect(response[DATA].message_id.length).to eq(29) + data, status_code, headers = @mfa_api_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::MessagingCodeResponse) + expect(data.message_id.length).to eq(29) end end @@ -36,14 +43,15 @@ to: USER_NUMBER, from: BW_NUMBER, application_id: BW_VOICE_APPLICATION_ID, - message: "Your temporary {NAME} {SCOPE} code is: {CODE}", - digits: 6 + message: message, + digits: digits ) - response = @api_instance_mfa.generate_voice_code_with_http_info(BW_ACCOUNT_ID, req_schema) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::VoiceCodeResponse) - expect(response[DATA].call_id.length).to eq(47) + data, status_code, headers = @mfa_api_instance.generate_voice_code_with_http_info(BW_ACCOUNT_ID, req_schema) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::VoiceCodeResponse) + expect(data.call_id.length).to eq(47) end end @@ -51,16 +59,17 @@ describe 'verify_code' do it 'verifies mfa code' do req_schema = Bandwidth::VerifyCodeRequest.new( - to: "+1000" + rand(1...10000000).to_s, - scope: "2FA", + to: '+1000' + rand(1...10000000).to_s, + scope: '2FA', expiration_time_in_minutes: 3, - code: "12345" + code: '12345' ) - response = @api_instance_mfa.verify_code_with_http_info(BW_ACCOUNT_ID, req_schema) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::VerifyCodeResponse) - expect(response[DATA].valid).to be_instance_of(FalseClass) + data, status_code, headers = @mfa_api_instance.verify_code_with_http_info(BW_ACCOUNT_ID, req_schema) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::VerifyCodeResponse) + expect(data.valid).to be false end end @@ -70,13 +79,13 @@ req_schema = Bandwidth::CodeRequest.new( to: USER_NUMBER, from: BW_NUMBER, - application_id: "not_an_application_id", - message: "Your temporary {NAME} {SCOPE} code is: {CODE}", - digits: 6 + application_id: 'not_an_application_id', + message: message, + digits: digits ) expect { - response = @api_instance_mfa.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) + @mfa_api_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(400) @@ -85,25 +94,24 @@ it 'causes a 403 error' do Bandwidth.configure do |config| - config.username = 'bad_username' - config.password = 'bad_password' + config.username = UNAUTHORIZED_USERNAME + config.password = UNAUTHORIZED_PASSWORD end req_schema = Bandwidth::CodeRequest.new( to: USER_NUMBER, from: BW_NUMBER, application_id: BW_MESSAGING_APPLICATION_ID, - message: "Your temporary {NAME} {SCOPE} code is: {CODE}", - digits: 6 + message: message, + digits: digits ) expect { - response = @api_instance_mfa.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) + @mfa_api_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(403) } end end - end diff --git a/spec/integration/phone_number_lookup_api_integration_spec.rb b/spec/integration/phone_number_lookup_api_integration_spec.rb index e674862b..e19279f7 100644 --- a/spec/integration/phone_number_lookup_api_integration_spec.rb +++ b/spec/integration/phone_number_lookup_api_integration_spec.rb @@ -1,15 +1,19 @@ - -require 'json' - # Integration Tests for Bandwidth::PhoneNumberLookupApi describe 'PhoneNumberLookupApi Integration Tests' do before(:all) do + WebMock.allow_net_connect! Bandwidth.configure do |config| config.username = BW_USERNAME config.password = BW_PASSWORD end @api_instance_tnlookup = Bandwidth::PhoneNumberLookupApi.new - $lookup_request_id = "" + + # lookup info + $lookup_request_id = '' + end + + after(:all) do + WebMock.disable_net_connect! end # Create Lookup @@ -18,14 +22,14 @@ tn_body = Bandwidth::LookupRequest.new( tns: [BW_NUMBER] ) - response = @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body) + data, status_code, headers = @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body) - expect(response[CODE]).to eq(202) - expect(response[DATA]).to be_instance_of(Bandwidth::CreateLookupResponse) - expect(response[DATA].request_id.length).to eq(36) - expect(response[DATA].status).to be_instance_of(String) + expect(status_code).to eq(202) + expect(data).to be_instance_of(Bandwidth::CreateLookupResponse) + expect(data.request_id.length).to eq(36) + expect(data.status).to be_instance_of(String) - $lookup_request_id = response[DATA].request_id + $lookup_request_id = data.request_id sleep(1) end end @@ -33,14 +37,15 @@ # Get Lookup Status describe 'get_lookup_status' do it 'gets lookup status' do - response = @api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, $lookup_request_id) + data, status_code, headers = @api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, $lookup_request_id) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::LookupStatus) - expect(response[DATA].request_id).to eq($lookup_request_id) - expect(response[DATA].status).to be_instance_of(String) - expect(response[DATA].result[0].response_code).to be_instance_of(Integer) - expect(response[DATA].result[0].e_164_format).to eq(BW_NUMBER) + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::LookupStatus) + expect(data.request_id).to eq($lookup_request_id) + expect(data.status).to be_instance_of(String) + expect(data.result).to be_instance_of(Array) + expect(data.result[0].response_code).to be_instance_of(Integer) + expect(data.result[0].e_164_format).to eq(BW_NUMBER) end end @@ -48,7 +53,7 @@ describe 'http error' do it 'causes a 400 error' do tn_body_bad = Bandwidth::LookupRequest.new( - tns: ["+1invalid"] + tns: ['+1invalid'] ) expect { @@ -60,7 +65,7 @@ end it 'causes a 404 error' do - req_id_dne = "12345678-abcd-cdef-9876-12345678abcd" + req_id_dne = '12345678-abcd-cdef-9876-12345678abcd' expect { @api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, req_id_dne) @@ -72,8 +77,8 @@ it 'causes a 401 error' do Bandwidth.configure do |config| - config.username = 'bad_username' - config.password = 'bad_password' + config.username = UNAUTHORIZED_USERNAME + config.password = UNAUTHORIZED_PASSWORD end tn_body = Bandwidth::LookupRequest.new( @@ -88,5 +93,4 @@ } end end - end diff --git a/spec/integration/recordings_api_integration_spec.rb b/spec/integration/recordings_api_integration_spec.rb index 0ff8b207..d4d85419 100644 --- a/spec/integration/recordings_api_integration_spec.rb +++ b/spec/integration/recordings_api_integration_spec.rb @@ -1,20 +1,25 @@ - -require 'json' require_relative '../call_utils' # Integration Tests for Bandwidth::RecordingsApi describe 'RecordingsApi Integration Tests' do before(:all) do + WebMock.allow_net_connect! Bandwidth.configure do |config| config.username = BW_USERNAME config.password = BW_PASSWORD config.return_binary_data = true end - @api_instance_recordings = Bandwidth::RecordingsApi.new - @api_instance_calls = Bandwidth::CallsApi.new + @recordings_api_instance = Bandwidth::RecordingsApi.new + @calls_api_instance = Bandwidth::CallsApi.new + + # recording info $manteca_test_id = setup_manteca('CALL') - $manteca_call_id = create_manteca_call($manteca_test_id, "/bxml/startLongRecording", @api_instance_calls) - $recording_id = "" + $manteca_call_id = create_manteca_call($manteca_test_id, '/bxml/startLongRecording', @calls_api_instance) + $recording_id = '' + end + + after(:all) do + WebMock.disable_net_connect! end # Update Recording @@ -29,21 +34,21 @@ ) sleep(SLEEP_TIME_S * 2) - pause_response = @api_instance_recordings.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, pause_recording) - expect(pause_response[CODE]).to eq(200) + pause_data, pause_status_code, pause_headers = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, pause_recording) + expect(pause_status_code).to eq(200) sleep(SLEEP_TIME_S) - record_response = @api_instance_recordings.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, start_recording) - expect(record_response[CODE]).to eq(200) + record_data, record_status_code, record_headers = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, start_recording) + expect(record_status_code).to eq(200) - complete_response = @api_instance_calls.update_call_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $complete_call_body) - expect(complete_response[CODE]).to eq(200) + complete_data, complete_status_code, complete_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $complete_call_body) + expect(complete_status_code).to eq(200) retries = 0 recording_complete = false begin while !recording_complete && retries < MAX_RETRIES - recording_complete = get_manteca_test_status($manteca_test_id)["callRecorded"] + recording_complete = get_manteca_test_status($manteca_test_id)['callRecorded'] retries += 1 sleep(SLEEP_TIME_S) end @@ -51,61 +56,63 @@ puts e.inspect end - expect(recording_complete).to be_instance_of(TrueClass) + expect(recording_complete).to be true end end # Get Call Recordings describe 'list_account_call_recordings' do it 'lists account call recordings' do - response = @api_instance_recordings.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID) + data, status_code, headers = @recordings_api_instance.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID) - expect(response[CODE]).to eq(200) - expect(response[DATA][0]).to be_instance_of(Bandwidth::CallRecordingMetadata) - expect(response[DATA][0].application_id).to be_instance_of(String) - expect(response[DATA][0].account_id).to eq(BW_ACCOUNT_ID) + expect(status_code).to eq(200) + expect(data).to be_instance_of(Array) + expect(data[0]).to be_instance_of(Bandwidth::CallRecordingMetadata) + expect(data[0].application_id).to be_instance_of(String) + expect(data[0].account_id).to eq(BW_ACCOUNT_ID) end end # List Call Recordings describe 'list_call_recordings' do it 'lists all recordings for a single call' do - response = @api_instance_recordings.list_call_recordings_with_http_info(BW_ACCOUNT_ID, $manteca_call_id) - - expect(response[CODE]).to eq(200) - expect(response[DATA][0]).to be_instance_of(Bandwidth::CallRecordingMetadata) - expect(response[DATA][0].application_id).to eq(MANTECA_APPLICATION_ID) - expect(response[DATA][0].account_id).to eq(BW_ACCOUNT_ID) - expect(response[DATA][0].call_id).to eq($manteca_call_id) - expect(response[DATA][0].recording_id).to be_instance_of(String) - expect(response[DATA][0].status).to eq('complete').or eq('partial') + data, status_code, headers = @recordings_api_instance.list_call_recordings_with_http_info(BW_ACCOUNT_ID, $manteca_call_id) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Array) + expect(data[0]).to be_instance_of(Bandwidth::CallRecordingMetadata) + expect(data[0].application_id).to eq(MANTECA_APPLICATION_ID) + expect(data[0].account_id).to eq(BW_ACCOUNT_ID) + expect(data[0].call_id).to eq($manteca_call_id) + expect(data[0].recording_id).to be_instance_of(String) + expect(data[0].status).to eq('complete').or eq('partial') - $recording_id = response[DATA][0].recording_id + $recording_id = data[0].recording_id end end # Get Call Recording describe 'get_call_recording' do it 'gets a call recording by id' do - response = @api_instance_recordings.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + data, status_code, headers = @recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::CallRecordingMetadata) - expect(response[DATA].application_id).to eq(MANTECA_APPLICATION_ID) - expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID) - expect(response[DATA].call_id).to eq($manteca_call_id) - expect(response[DATA].status).to eq('complete').or eq('partial') - expect(response[DATA].recording_id).to eq($recording_id) + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::CallRecordingMetadata) + expect(data.application_id).to eq(MANTECA_APPLICATION_ID) + expect(data.account_id).to eq(BW_ACCOUNT_ID) + expect(data.call_id).to eq($manteca_call_id) + expect(data.status).to eq('complete').or eq('partial') + expect(data.recording_id).to eq($recording_id) end end # Download Recording describe 'download_call_recording' do it 'downloads a call recording by id' do - response = @api_instance_recordings.download_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + data, status_code, headers = @recordings_api_instance.download_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(String) + expect(status_code).to eq(200) + expect(data).to be_instance_of(String) end end @@ -113,19 +120,19 @@ describe 'transcribe_call_recording' do it 'creates a transcription request' do transcribe_recording = Bandwidth::TranscribeRecording.new( - callback_url: MANTECA_BASE_URL + "/transcriptions", + callback_url: MANTECA_BASE_URL + '/transcriptions', tag: $manteca_test_id ) - response = @api_instance_recordings.transcribe_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id, transcribe_recording) - expect(response[CODE]).to eq(204) + data, status_code, headers = @recordings_api_instance.transcribe_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id, transcribe_recording) + expect(status_code).to eq(204) retries = 0 transcription_complete = false sleep(SLEEP_TIME_S * 10) begin while !transcription_complete && retries < MAX_RETRIES - transcription_complete = get_manteca_test_status($manteca_test_id)["callTranscribed"] + transcription_complete = get_manteca_test_status($manteca_test_id)['callTranscribed'] retries += 1 sleep(SLEEP_TIME_S) end @@ -133,54 +140,55 @@ puts e.inspect end - expect(transcription_complete).to be_instance_of(TrueClass) + expect(transcription_complete).to be true end end # Get Transcription describe 'get_call_transcription' do it 'gets the completed call recording transcription' do - response = @api_instance_recordings.get_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) - - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::TranscriptionList) - expect(response[DATA].transcripts[0]).to be_instance_of(Bandwidth::Transcription) - expect(response[DATA].transcripts[0].text).to be_instance_of(String) - expect(response[DATA].transcripts[0].confidence).to be_instance_of(Float) + data, status_code, headers = @recordings_api_instance.get_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::TranscriptionList) + expect(data.transcripts).to be_instance_of(Array) + expect(data.transcripts[0]).to be_instance_of(Bandwidth::Transcription) + expect(data.transcripts[0].text).to be_instance_of(String) + expect(data.transcripts[0].confidence).to be_instance_of(Float) end end # Delete Transcription describe 'delete_call_transcription' do it 'deletes the completed call recording transcription' do - response = @api_instance_recordings.delete_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) - expect(response[CODE]).to eq(204) + data, status_code, headers = @recordings_api_instance.delete_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + expect(status_code).to eq(204) end end # Delete Recording Media describe 'delete_recording_media' do it 'deletes the completed call recording media' do - response = @api_instance_recordings.delete_recording_media_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) - expect(response[CODE]).to eq(204) + data, status_code, headers = @recordings_api_instance.delete_recording_media_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + expect(status_code).to eq(204) end end # Delete Recording describe 'delete_recording' do it 'deletes the completed call recording data' do - response = @api_instance_recordings.delete_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) - expect(response[CODE]).to eq(204) + data, status_code, headers = @recordings_api_instance.delete_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + expect(status_code).to eq(204) end end # HTTP 4XX Errors describe 'http error' do it 'causes a 404 error' do - dne_id = "does-not-exist" + dne_id = 'does-not-exist' expect { - @api_instance_recordings.get_call_recording_with_http_info(BW_ACCOUNT_ID, dne_id, dne_id) + @recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, dne_id, dne_id) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(404) @@ -189,12 +197,12 @@ it 'causes a 401 error' do Bandwidth.configure do |config| - config.username = 'bad_username' - config.password = 'bad_password' + config.username = UNAUTHORIZED_USERNAME + config.password = UNAUTHORIZED_PASSWORD end expect { - @api_instance_recordings.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + @recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(401) @@ -208,12 +216,11 @@ end expect { - @api_instance_recordings.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) + @recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(403) } end end - end diff --git a/spec/integration/statistics_api_integration_spec.rb b/spec/integration/statistics_api_integration_spec.rb index fc33bad2..73f7382d 100644 --- a/spec/integration/statistics_api_integration_spec.rb +++ b/spec/integration/statistics_api_integration_spec.rb @@ -1,25 +1,27 @@ - -require 'json' - # Integration Tests for Bandwidth::StatisticsApi describe 'StatisticsApi Integration Tests' do before(:all) do + WebMock.allow_net_connect! Bandwidth.configure do |config| config.username = BW_USERNAME config.password = BW_PASSWORD end - @api_instance_statistics = Bandwidth::StatisticsApi.new + @statistics_api_instance = Bandwidth::StatisticsApi.new + end + + after(:all) do + WebMock.disable_net_connect! end # Get Account Statistics describe 'get_statistics' do it 'gets account statistics' do - response = @api_instance_statistics.get_statistics_with_http_info(BW_ACCOUNT_ID) + data, status_code, headers = @statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID) - expect(response[CODE]).to eq(200) - expect(response[DATA]).to be_instance_of(Bandwidth::AccountStatistics) - expect(response[DATA].current_call_queue_size).to be_instance_of(Integer) - expect(response[DATA].max_call_queue_size).to eq(7500) + expect(status_code).to eq(200) + expect(data).to be_instance_of(Bandwidth::AccountStatistics) + expect(data.current_call_queue_size).to be_instance_of(Integer) + expect(data.max_call_queue_size).to eq(7500) end end @@ -27,12 +29,12 @@ describe 'http error' do it 'causes a 401 error' do Bandwidth.configure do |config| - config.username = 'bad_username' - config.password = 'bad_password' + config.username = UNAUTHORIZED_USERNAME + config.password = UNAUTHORIZED_PASSWORD end expect { - @api_instance_statistics.get_statistics_with_http_info(BW_ACCOUNT_ID) + @statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(401) @@ -46,12 +48,11 @@ end expect { - @api_instance_statistics.get_statistics_with_http_info(BW_ACCOUNT_ID) + @statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID) }.to raise_error { |e| expect(e).to be_instance_of(Bandwidth::ApiError) expect(e.code).to eq(403) } end end - end diff --git a/spec/models/account_statistics_spec.rb b/spec/models/account_statistics_spec.rb deleted file mode 100644 index e9c70e42..00000000 --- a/spec/models/account_statistics_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::AccountStatistics -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::AccountStatistics do - let(:instance) { Bandwidth::AccountStatistics.new } - - describe 'test an instance of AccountStatistics' do - it 'should create an instance of AccountStatistics' do - expect(instance).to be_instance_of(Bandwidth::AccountStatistics) - end - end - describe 'test attribute "current_call_queue_size"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "max_call_queue_size"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/answer_callback_spec.rb b/spec/models/answer_callback_spec.rb deleted file mode 100644 index b0eb6487..00000000 --- a/spec/models/answer_callback_spec.rb +++ /dev/null @@ -1,112 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::AnswerCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::AnswerCallback do - let(:instance) { Bandwidth::AnswerCallback.new } - - describe 'test an instance of AnswerCallback' do - it 'should create an instance of AnswerCallback' do - expect(instance).to be_instance_of(Bandwidth::AnswerCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "machine_detection_result"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/bridge_complete_callback_spec.rb b/spec/models/bridge_complete_callback_spec.rb deleted file mode 100644 index d320903d..00000000 --- a/spec/models/bridge_complete_callback_spec.rb +++ /dev/null @@ -1,124 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::BridgeCompleteCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::BridgeCompleteCallback do - let(:instance) { Bandwidth::BridgeCompleteCallback.new } - - describe 'test an instance of BridgeCompleteCallback' do - it 'should create an instance of BridgeCompleteCallback' do - expect(instance).to be_instance_of(Bandwidth::BridgeCompleteCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cause"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/bridge_target_complete_callback_spec.rb b/spec/models/bridge_target_complete_callback_spec.rb deleted file mode 100644 index ef1ce186..00000000 --- a/spec/models/bridge_target_complete_callback_spec.rb +++ /dev/null @@ -1,106 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::BridgeTargetCompleteCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::BridgeTargetCompleteCallback do - let(:instance) { Bandwidth::BridgeTargetCompleteCallback.new } - - describe 'test an instance of BridgeTargetCompleteCallback' do - it 'should create an instance of BridgeTargetCompleteCallback' do - expect(instance).to be_instance_of(Bandwidth::BridgeTargetCompleteCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/bxml/bxml_spec.rb b/spec/models/bxml/bxml_spec.rb index d0ad3a86..b68ce1f0 100644 --- a/spec/models/bxml/bxml_spec.rb +++ b/spec/models/bxml/bxml_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Bxml describe 'Bandwidth::Bxml::Bxml' do let(:instance) { Bandwidth::Bxml::Bxml.new } diff --git a/spec/models/bxml/nestable_verb_spec.rb b/spec/models/bxml/nestable_verb_spec.rb index 393e3705..db017139 100644 --- a/spec/models/bxml/nestable_verb_spec.rb +++ b/spec/models/bxml/nestable_verb_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::NestableVerb describe 'Bandwidth::Bxml::NestableVerb' do let(:instance) { Class.new.include(Bandwidth::Bxml::NestableVerb).new('Test') } diff --git a/spec/models/bxml/response_spec.rb b/spec/models/bxml/response_spec.rb index c846631e..21c7c8fc 100644 --- a/spec/models/bxml/response_spec.rb +++ b/spec/models/bxml/response_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Response describe 'Bandwidth::Bxml::Response' do let(:instance) { Bandwidth::Bxml::Response.new } diff --git a/spec/models/bxml/verb_spec.rb b/spec/models/bxml/verb_spec.rb index 477431d6..caee63cd 100644 --- a/spec/models/bxml/verb_spec.rb +++ b/spec/models/bxml/verb_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Verb describe 'Bandwidth::Bxml::Verb' do let(:instance) { Class.new.include(Bandwidth::Bxml::Verb).new('Test') } @@ -13,16 +11,5 @@ expected = "\n\n" expect(instance.to_bxml).to eq(expected) end - - it 'tests invalid attribute' do - attributes = { 'invalid_attribute' => 'invalid' } - instance.set_attributes(attributes) - - expect { - instance.generate_xml - }.to raise_error { |e| - expect(e).to be_a(NoMethodError) - } - end end end diff --git a/spec/models/bxml/verbs/bridge_spec.rb b/spec/models/bxml/verbs/bridge_spec.rb index 888ff7da..89d30481 100644 --- a/spec/models/bxml/verbs/bridge_spec.rb +++ b/spec/models/bxml/verbs/bridge_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Bridge describe 'Bandwidth::Bxml::Bridge' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/conference_spec.rb b/spec/models/bxml/verbs/conference_spec.rb index 43adc55a..82def922 100644 --- a/spec/models/bxml/verbs/conference_spec.rb +++ b/spec/models/bxml/verbs/conference_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Conference describe 'Bandwidth::Bxml::Conference' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/custom_param_spec.rb b/spec/models/bxml/verbs/custom_param_spec.rb index 781b67cd..4efc5e52 100644 --- a/spec/models/bxml/verbs/custom_param_spec.rb +++ b/spec/models/bxml/verbs/custom_param_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::CustomParam describe 'Bandwidth::Bxml::CustomParam' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/forward_spec.rb b/spec/models/bxml/verbs/forward_spec.rb index 1cb6f231..099ecef6 100644 --- a/spec/models/bxml/verbs/forward_spec.rb +++ b/spec/models/bxml/verbs/forward_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Forward describe 'Bandwidth::Bxml::Forward' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/gather_spec.rb b/spec/models/bxml/verbs/gather_spec.rb index 94ce34ba..9144ccbf 100644 --- a/spec/models/bxml/verbs/gather_spec.rb +++ b/spec/models/bxml/verbs/gather_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Gather describe 'Bandwidth::Bxml::Gather' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/hangup_spec.rb b/spec/models/bxml/verbs/hangup_spec.rb index eb99878f..dd0be2ee 100644 --- a/spec/models/bxml/verbs/hangup_spec.rb +++ b/spec/models/bxml/verbs/hangup_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Hangup describe 'Bandwidth::Bxml::Hangup' do let(:instance) { Bandwidth::Bxml::Hangup.new } diff --git a/spec/models/bxml/verbs/pause_recording_spec.rb b/spec/models/bxml/verbs/pause_recording_spec.rb index 195942bb..100e7732 100644 --- a/spec/models/bxml/verbs/pause_recording_spec.rb +++ b/spec/models/bxml/verbs/pause_recording_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::PauseRecording describe 'Bandwidth::Bxml::PauseRecording' do let(:instance) { Bandwidth::Bxml::PauseRecording.new } diff --git a/spec/models/bxml/verbs/pause_spec.rb b/spec/models/bxml/verbs/pause_spec.rb index 6dc2b26d..34782c80 100644 --- a/spec/models/bxml/verbs/pause_spec.rb +++ b/spec/models/bxml/verbs/pause_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Pause describe 'Bandwidth::Bxml::Pause' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/phone_number_spec.rb b/spec/models/bxml/verbs/phone_number_spec.rb index cccb980b..14b709b8 100644 --- a/spec/models/bxml/verbs/phone_number_spec.rb +++ b/spec/models/bxml/verbs/phone_number_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::PhoneNumber describe 'Bandwidth::Bxml::PhoneNumber' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/play_audio_spec.rb b/spec/models/bxml/verbs/play_audio_spec.rb index a1aa95b8..a9858ebf 100644 --- a/spec/models/bxml/verbs/play_audio_spec.rb +++ b/spec/models/bxml/verbs/play_audio_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::PlayAudio describe 'Bandwidth::Bxml::PlayAudio' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/record_spec.rb b/spec/models/bxml/verbs/record_spec.rb index f55d3e4a..d125b2ea 100644 --- a/spec/models/bxml/verbs/record_spec.rb +++ b/spec/models/bxml/verbs/record_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Record describe 'Bandwidth::Bxml::Record' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/redirect_spec.rb b/spec/models/bxml/verbs/redirect_spec.rb index eae7b1ea..b45c5b39 100644 --- a/spec/models/bxml/verbs/redirect_spec.rb +++ b/spec/models/bxml/verbs/redirect_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Redirect describe 'Bandwidth::Bxml::Redirect' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/resume_recording_spec.rb b/spec/models/bxml/verbs/resume_recording_spec.rb index a76de778..d2bd46d4 100644 --- a/spec/models/bxml/verbs/resume_recording_spec.rb +++ b/spec/models/bxml/verbs/resume_recording_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::ResumeRecording describe 'Bandwidth::Bxml::ResumeRecording' do let(:instance) { Bandwidth::Bxml::ResumeRecording.new } diff --git a/spec/models/bxml/verbs/ring_spec.rb b/spec/models/bxml/verbs/ring_spec.rb index 2e35ec33..14b5f01b 100644 --- a/spec/models/bxml/verbs/ring_spec.rb +++ b/spec/models/bxml/verbs/ring_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Ring describe 'Bandwidth::Bxml::Ring' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/send_dtmf_spec.rb b/spec/models/bxml/verbs/send_dtmf_spec.rb index dbaacff1..e7fd5216 100644 --- a/spec/models/bxml/verbs/send_dtmf_spec.rb +++ b/spec/models/bxml/verbs/send_dtmf_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::SendDtmf describe 'Bandwidth::Bxml::SendDtmf' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/sip_uri_spec.rb b/spec/models/bxml/verbs/sip_uri_spec.rb index 4d830f98..be78eaf2 100644 --- a/spec/models/bxml/verbs/sip_uri_spec.rb +++ b/spec/models/bxml/verbs/sip_uri_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::SipUri describe 'Bandwidth::Bxml::SipUri' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/speak_sentence_spec.rb b/spec/models/bxml/verbs/speak_sentence_spec.rb index 2aaafd7d..e91ec3b8 100644 --- a/spec/models/bxml/verbs/speak_sentence_spec.rb +++ b/spec/models/bxml/verbs/speak_sentence_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::SpeakSentence describe 'Bandwidth::Bxml::SpeakSentence' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/start_gather_spec.rb b/spec/models/bxml/verbs/start_gather_spec.rb index a9113335..007f61f3 100644 --- a/spec/models/bxml/verbs/start_gather_spec.rb +++ b/spec/models/bxml/verbs/start_gather_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::StartGather describe 'Bandwidth::Bxml::StartGather' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/start_recording_spec.rb b/spec/models/bxml/verbs/start_recording_spec.rb index 7ac14b11..d3bb5131 100644 --- a/spec/models/bxml/verbs/start_recording_spec.rb +++ b/spec/models/bxml/verbs/start_recording_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::StartRecording describe 'Bandwidth::Bxml::StartRecording' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/start_stream_spec.rb b/spec/models/bxml/verbs/start_stream_spec.rb index 95d73a3c..3f645da1 100644 --- a/spec/models/bxml/verbs/start_stream_spec.rb +++ b/spec/models/bxml/verbs/start_stream_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::StartStream describe 'Bandwidth::Bxml::StartStream' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/start_transcription_spec.rb b/spec/models/bxml/verbs/start_transcription_spec.rb index e5fb3973..56dcc0a0 100644 --- a/spec/models/bxml/verbs/start_transcription_spec.rb +++ b/spec/models/bxml/verbs/start_transcription_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::StartTranscription describe 'Bandwidth::Bxml::StartTranscription' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/stop_gather_spec.rb b/spec/models/bxml/verbs/stop_gather_spec.rb index d25eed61..db03d06d 100644 --- a/spec/models/bxml/verbs/stop_gather_spec.rb +++ b/spec/models/bxml/verbs/stop_gather_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::StopGather describe 'Bandwidth::Bxml::StopGather' do let(:instance) { Bandwidth::Bxml::StopGather.new } diff --git a/spec/models/bxml/verbs/stop_recording_spec.rb b/spec/models/bxml/verbs/stop_recording_spec.rb index 02df752d..a381d083 100644 --- a/spec/models/bxml/verbs/stop_recording_spec.rb +++ b/spec/models/bxml/verbs/stop_recording_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::StopRecording describe 'Bandwidth::Bxml::StopRecording' do let(:instance) { Bandwidth::Bxml::StopRecording.new } diff --git a/spec/models/bxml/verbs/stop_stream_spec.rb b/spec/models/bxml/verbs/stop_stream_spec.rb index 094fad84..9d5f9a7c 100644 --- a/spec/models/bxml/verbs/stop_stream_spec.rb +++ b/spec/models/bxml/verbs/stop_stream_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::StopStream describe 'Bandwidth::Bxml::StopStream' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/stop_transcription_spec.rb b/spec/models/bxml/verbs/stop_transcription_spec.rb index b60fae69..d3a11b67 100644 --- a/spec/models/bxml/verbs/stop_transcription_spec.rb +++ b/spec/models/bxml/verbs/stop_transcription_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::StopTranscription describe 'Bandwidth::Bxml::StopTranscription' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/stream_param_spec.rb b/spec/models/bxml/verbs/stream_param_spec.rb index fd9db0de..cdc804d6 100644 --- a/spec/models/bxml/verbs/stream_param_spec.rb +++ b/spec/models/bxml/verbs/stream_param_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::StreamParam describe 'Bandwidth::Bxml::StreamParam' do let(:initial_attributes) { diff --git a/spec/models/bxml/verbs/tag_spec.rb b/spec/models/bxml/verbs/tag_spec.rb index 3120c27a..4c53b945 100644 --- a/spec/models/bxml/verbs/tag_spec.rb +++ b/spec/models/bxml/verbs/tag_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Tag describe 'Bandwidth::Bxml::Tag' do let(:instance) { Bandwidth::Bxml::Tag.new('test_tag') } diff --git a/spec/models/bxml/verbs/transfer_spec.rb b/spec/models/bxml/verbs/transfer_spec.rb index 3ee2aa26..5d48279c 100644 --- a/spec/models/bxml/verbs/transfer_spec.rb +++ b/spec/models/bxml/verbs/transfer_spec.rb @@ -1,5 +1,3 @@ - - # Unit tests for Bandwidth::Bxml::Transfer describe 'Bandwidth::Bxml::Transfer' do let(:initial_attributes) { diff --git a/spec/models/call_direction_enum_spec.rb b/spec/models/call_direction_enum_spec.rb deleted file mode 100644 index 17de660f..00000000 --- a/spec/models/call_direction_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::CallDirectionEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::CallDirectionEnum do - let(:instance) { Bandwidth::CallDirectionEnum.new } - - describe 'test an instance of CallDirectionEnum' do - it 'should create an instance of CallDirectionEnum' do - expect(instance).to be_instance_of(Bandwidth::CallDirectionEnum) - end - end -end diff --git a/spec/models/call_recording_metadata_spec.rb b/spec/models/call_recording_metadata_spec.rb deleted file mode 100644 index 08b67d0a..00000000 --- a/spec/models/call_recording_metadata_spec.rb +++ /dev/null @@ -1,136 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::CallRecordingMetadata -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::CallRecordingMetadata do - let(:instance) { Bandwidth::CallRecordingMetadata.new } - - describe 'test an instance of CallRecordingMetadata' do - it 'should create an instance of CallRecordingMetadata' do - expect(instance).to be_instance_of(Bandwidth::CallRecordingMetadata) - end - end - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent_call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "recording_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_caller_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "duration"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "channels"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "end_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "file_format"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transcription"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/call_state_enum_spec.rb b/spec/models/call_state_enum_spec.rb index 6aa27bf8..4dad702d 100644 --- a/spec/models/call_state_enum_spec.rb +++ b/spec/models/call_state_enum_spec.rb @@ -1,28 +1,16 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - # Unit tests for Bandwidth::CallStateEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate describe Bandwidth::CallStateEnum do let(:instance) { Bandwidth::CallStateEnum.new } describe 'test an instance of CallStateEnum' do - it 'should create an instance of CallStateEnum' do + it 'creates an instance of CallStateEnum' do expect(instance).to be_instance_of(Bandwidth::CallStateEnum) end + + it 'raises an error for an invalid enum value' do + expect { + Bandwidth::CallStateEnum.build_from_hash('invalid') + }.to raise_error(RuntimeError) + end end end diff --git a/spec/models/call_state_spec.rb b/spec/models/call_state_spec.rb index 0703aac1..55c5a6dd 100644 --- a/spec/models/call_state_spec.rb +++ b/spec/models/call_state_spec.rb @@ -1,136 +1,181 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - # Unit tests for Bandwidth::CallState -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate describe Bandwidth::CallState do - let(:instance) { Bandwidth::CallState.new } - - describe 'test an instance of CallState' do - it 'should create an instance of CallState' do - expect(instance).to be_instance_of(Bandwidth::CallState) - end - end - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + let(:call_state_default) { Bandwidth::CallState.new } + let(:call_state_values) { Bandwidth::CallState.new({ + 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', + from: '+19195554321', + direction: 'inbound', + state: 'disconnected', + stir_shaken: { + 'verstat': 'TN-Verification-Passed', + 'attestationIndicator': 'A', + 'originatingId': 'abc123' + }, + identity: 'eyJhbGciOiJFUzI1NiI', + 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: 'hangup', + error_message: nil, + error_id: nil, + last_update: '2022-06-16T13:15:18.314Z' + }) } + + describe '#initialize' do + it 'causes an ArgumentError by passing an Array to the initialize method' do + expect { + Bandwidth::CallState.new([]) + }.to raise_error(ArgumentError) + end + + it 'causes an ArgumentError by passing an invalid attribute to the initialize method' do + expect { + Bandwidth::CallState.new({ invalid: true }) + }.to raise_error(ArgumentError) + end + end + + describe '#acceptable_attributes' do + it 'expects acceptable JSON attributes to be those in the attribute map' do + expect(Bandwidth::CallState.acceptable_attributes).to eq(Bandwidth::CallState.attribute_map.values) + end + end + + describe 'EnumAttributeValidator' do + it 'validates string enum' do + validator = Bandwidth::CallState::EnumAttributeValidator.new(String, ['valid']) + expect(validator.valid?('valid')).to be true + expect(validator.valid?('invalid')).to be false + end + + it 'validates integer enum' do + validator = Bandwidth::CallState::EnumAttributeValidator.new(Integer, [1]) + expect(validator.valid?(1)).to be true + expect(validator.valid?('invalid')).to be false + end + + it 'validates float enum' do + validator = Bandwidth::CallState::EnumAttributeValidator.new(Float, [1.0]) + expect(validator.valid?(1.0)).to be true + expect(validator.valid?('invalid')).to be false + end + end + + describe '#build_from_hash' do + it 'validates instance of CallState created by the build_from_hash method' do + call_state_from_hash = Bandwidth::CallState.build_from_hash({ + applicationId: '04e88489-df02-4e34-a0ee-27a91849555f', + accountId: '9900000', + callId: 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parentCallId: 'c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + to: '+19195551234', + from: '+19195554321', + direction: 'inbound', + state: 'disconnected', + stirShaken: { + 'verstat': 'TN-Verification-Passed', + 'attestationIndicator': 'A', + 'originatingId': 'abc123' + }, + identity: 'eyJhbGciOiJFUzI1NiI', + enqueuedTime: '2022-06-16T13:15:07.160Z', + startTime: '2022-06-16T13:15:07.160Z', + answerTime: '2022-06-16T13:15:18.126Z', + endTime: '2022-06-16T13:15:18.314Z', + disconnectCause: 'hangup', + errorMessage: nil, + errorId: nil, + lastUpdate: '2022-06-16T13:15:18.314Z' + }) + expect(call_state_from_hash).to be_instance_of(Bandwidth::CallState) + expect(call_state_from_hash.application_id).to eq('04e88489-df02-4e34-a0ee-27a91849555f') + expect(call_state_from_hash.account_id).to eq('9900000') + expect(call_state_from_hash.call_id).to eq('c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85') + expect(call_state_from_hash.parent_call_id).to eq('c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85') + expect(call_state_from_hash.to).to eq('+19195551234') + expect(call_state_from_hash.from).to eq('+19195554321') + expect(call_state_from_hash.direction).to eq('inbound') + expect(call_state_from_hash.state).to eq('disconnected') + expect(call_state_from_hash.stir_shaken).to eq({ + 'verstat' => 'TN-Verification-Passed', + 'attestationIndicator' => 'A', + 'originatingId' => 'abc123' + }) + expect(call_state_from_hash.identity).to eq('eyJhbGciOiJFUzI1NiI') + expect(call_state_from_hash.enqueued_time).to eq(Time.parse('2022-06-16T13:15:07.160Z')) + expect(call_state_from_hash.start_time).to eq(Time.parse('2022-06-16T13:15:07.160Z')) + expect(call_state_from_hash.answer_time).to eq(Time.parse('2022-06-16T13:15:18.126Z')) + expect(call_state_from_hash.end_time).to eq(Time.parse('2022-06-16T13:15:18.314Z')) + expect(call_state_from_hash.disconnect_cause).to eq('hangup') + expect(call_state_from_hash.error_message).to eq(nil) + expect(call_state_from_hash.error_id).to eq(nil) + expect(call_state_from_hash.last_update).to eq(Time.parse('2022-06-16T13:15:18.314Z')) + end + end + + describe '#list_invalid_properties' do + it 'returns list of invalid properties' do + expect(call_state_default.list_invalid_properties).to eq([]) + end + end + + describe '#hash' do + it 'returns a hash code according to attributes' do + expect(call_state_default.hash).to be_instance_of(Integer) + end + end + + describe '#to_s' do + it 'returns a string representation of the object' do + expect(call_state_default.to_s).to eq('{}') + end + end + + describe '#valid?' do + it 'validates instances with and without attributes set' do + expect(call_state_default).to be_valid + expect(call_state_values).to be_valid + end + end + + describe '#eq? #==' do + it 'returns true/false when comparing objects' do + expect(call_state_default.eql?(Bandwidth::CallState.new)).to be true + expect(call_state_default.eql?(call_state_values)).to be false + end + end + + describe '#to_body #to_hash' do + it 'returns a hash representation of the object' do + expect(call_state_values.to_body).to eq({ + applicationId: '04e88489-df02-4e34-a0ee-27a91849555f', + accountId: '9900000', + callId: 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parentCallId: 'c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + to: '+19195551234', + from: '+19195554321', + direction: 'inbound', + state: 'disconnected', + stirShaken: { + 'verstat': 'TN-Verification-Passed', + 'attestationIndicator': 'A', + 'originatingId': 'abc123' + }, + identity: 'eyJhbGciOiJFUzI1NiI', + enqueuedTime: '2022-06-16T13:15:07.160Z', + startTime: '2022-06-16T13:15:07.160Z', + answerTime: '2022-06-16T13:15:18.126Z', + endTime: '2022-06-16T13:15:18.314Z', + disconnectCause: 'hangup', + errorMessage: nil, + errorId: nil, + lastUpdate: '2022-06-16T13:15:18.314Z' + }) end end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent_call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "stir_shaken"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "identity"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "end_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "disconnect_cause"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "last_update"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - end diff --git a/spec/models/callback_method_enum_spec.rb b/spec/models/callback_method_enum_spec.rb deleted file mode 100644 index 7ce6421e..00000000 --- a/spec/models/callback_method_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::CallbackMethodEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::CallbackMethodEnum do - let(:instance) { Bandwidth::CallbackMethodEnum.new } - - describe 'test an instance of CallbackMethodEnum' do - it 'should create an instance of CallbackMethodEnum' do - expect(instance).to be_instance_of(Bandwidth::CallbackMethodEnum) - end - end -end diff --git a/spec/models/code_request_spec.rb b/spec/models/code_request_spec.rb deleted file mode 100644 index 160c8cc2..00000000 --- a/spec/models/code_request_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::CodeRequest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::CodeRequest do - let(:instance) { Bandwidth::CodeRequest.new } - - describe 'test an instance of CodeRequest' do - it 'should create an instance of CodeRequest' do - expect(instance).to be_instance_of(Bandwidth::CodeRequest) - end - end - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "scope"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "digits"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/conference_completed_callback_spec.rb b/spec/models/conference_completed_callback_spec.rb deleted file mode 100644 index ec439e79..00000000 --- a/spec/models/conference_completed_callback_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::ConferenceCompletedCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ConferenceCompletedCallback do - let(:instance) { Bandwidth::ConferenceCompletedCallback.new } - - describe 'test an instance of ConferenceCompletedCallback' do - it 'should create an instance of ConferenceCompletedCallback' do - expect(instance).to be_instance_of(Bandwidth::ConferenceCompletedCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "conference_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/conference_created_callback_spec.rb b/spec/models/conference_created_callback_spec.rb deleted file mode 100644 index dfa3d60f..00000000 --- a/spec/models/conference_created_callback_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::ConferenceCreatedCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ConferenceCreatedCallback do - let(:instance) { Bandwidth::ConferenceCreatedCallback.new } - - describe 'test an instance of ConferenceCreatedCallback' do - it 'should create an instance of ConferenceCreatedCallback' do - expect(instance).to be_instance_of(Bandwidth::ConferenceCreatedCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "conference_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/conference_member_exit_callback_spec.rb b/spec/models/conference_member_exit_callback_spec.rb deleted file mode 100644 index a1ce6b36..00000000 --- a/spec/models/conference_member_exit_callback_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::ConferenceMemberExitCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ConferenceMemberExitCallback do - let(:instance) { Bandwidth::ConferenceMemberExitCallback.new } - - describe 'test an instance of ConferenceMemberExitCallback' do - it 'should create an instance of ConferenceMemberExitCallback' do - expect(instance).to be_instance_of(Bandwidth::ConferenceMemberExitCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "conference_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/conference_member_join_callback_spec.rb b/spec/models/conference_member_join_callback_spec.rb deleted file mode 100644 index 291acb51..00000000 --- a/spec/models/conference_member_join_callback_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::ConferenceMemberJoinCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ConferenceMemberJoinCallback do - let(:instance) { Bandwidth::ConferenceMemberJoinCallback.new } - - describe 'test an instance of ConferenceMemberJoinCallback' do - it 'should create an instance of ConferenceMemberJoinCallback' do - expect(instance).to be_instance_of(Bandwidth::ConferenceMemberJoinCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "conference_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/conference_member_spec.rb b/spec/models/conference_member_spec.rb deleted file mode 100644 index 5c8060e8..00000000 --- a/spec/models/conference_member_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::ConferenceMember -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ConferenceMember do - let(:instance) { Bandwidth::ConferenceMember.new } - - describe 'test an instance of ConferenceMember' do - it 'should create an instance of ConferenceMember' do - expect(instance).to be_instance_of(Bandwidth::ConferenceMember) - end - end - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "conference_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "member_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "mute"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "hold"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_ids_to_coach"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/conference_recording_available_callback_spec.rb b/spec/models/conference_recording_available_callback_spec.rb deleted file mode 100644 index fa4e29d8..00000000 --- a/spec/models/conference_recording_available_callback_spec.rb +++ /dev/null @@ -1,112 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::ConferenceRecordingAvailableCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ConferenceRecordingAvailableCallback do - let(:instance) { Bandwidth::ConferenceRecordingAvailableCallback.new } - - describe 'test an instance of ConferenceRecordingAvailableCallback' do - it 'should create an instance of ConferenceRecordingAvailableCallback' do - expect(instance).to be_instance_of(Bandwidth::ConferenceRecordingAvailableCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "conference_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "recording_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "channels"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "end_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "duration"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "file_format"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/conference_recording_metadata_spec.rb b/spec/models/conference_recording_metadata_spec.rb deleted file mode 100644 index dc968bd1..00000000 --- a/spec/models/conference_recording_metadata_spec.rb +++ /dev/null @@ -1,94 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::ConferenceRecordingMetadata -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ConferenceRecordingMetadata do - let(:instance) { Bandwidth::ConferenceRecordingMetadata.new } - - describe 'test an instance of ConferenceRecordingMetadata' do - it 'should create an instance of ConferenceRecordingMetadata' do - expect(instance).to be_instance_of(Bandwidth::ConferenceRecordingMetadata) - end - end - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "conference_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "recording_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "duration"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "channels"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "end_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "file_format"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/conference_redirect_callback_spec.rb b/spec/models/conference_redirect_callback_spec.rb deleted file mode 100644 index 81efec54..00000000 --- a/spec/models/conference_redirect_callback_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::ConferenceRedirectCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ConferenceRedirectCallback do - let(:instance) { Bandwidth::ConferenceRedirectCallback.new } - - describe 'test an instance of ConferenceRedirectCallback' do - it 'should create an instance of ConferenceRedirectCallback' do - expect(instance).to be_instance_of(Bandwidth::ConferenceRedirectCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "conference_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/conference_spec.rb b/spec/models/conference_spec.rb deleted file mode 100644 index de4eee64..00000000 --- a/spec/models/conference_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::Conference -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::Conference do - let(:instance) { Bandwidth::Conference.new } - - describe 'test an instance of Conference' do - it 'should create an instance of Conference' do - expect(instance).to be_instance_of(Bandwidth::Conference) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "created_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "completed_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "conference_event_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "conference_event_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "active_members"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/conference_state_enum_spec.rb b/spec/models/conference_state_enum_spec.rb deleted file mode 100644 index 808f58b3..00000000 --- a/spec/models/conference_state_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::ConferenceStateEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ConferenceStateEnum do - let(:instance) { Bandwidth::ConferenceStateEnum.new } - - describe 'test an instance of ConferenceStateEnum' do - it 'should create an instance of ConferenceStateEnum' do - expect(instance).to be_instance_of(Bandwidth::ConferenceStateEnum) - end - end -end diff --git a/spec/models/create_call_response_spec.rb b/spec/models/create_call_response_spec.rb deleted file mode 100644 index d6db6dfa..00000000 --- a/spec/models/create_call_response_spec.rb +++ /dev/null @@ -1,154 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::CreateCallResponse -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::CreateCallResponse do - let(:instance) { Bandwidth::CreateCallResponse.new } - - describe 'test an instance of CreateCallResponse' do - it 'should create an instance of CreateCallResponse' do - expect(instance).to be_instance_of(Bandwidth::CreateCallResponse) - end - end - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_timeout"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "callback_timeout"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_fallback_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_fallback_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "disconnect_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "disconnect_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "priority"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/create_call_spec.rb b/spec/models/create_call_spec.rb deleted file mode 100644 index a2163d6f..00000000 --- a/spec/models/create_call_spec.rb +++ /dev/null @@ -1,142 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::CreateCall -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::CreateCall do - let(:instance) { Bandwidth::CreateCall.new } - - describe 'test an instance of CreateCall' do - it 'should create an instance of CreateCall' do - expect(instance).to be_instance_of(Bandwidth::CreateCall) - end - end - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "uui"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_fallback_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_fallback_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "disconnect_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "disconnect_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_timeout"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "callback_timeout"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "machine_detection"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "priority"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/create_lookup_response_spec.rb b/spec/models/create_lookup_response_spec.rb deleted file mode 100644 index a61a39d1..00000000 --- a/spec/models/create_lookup_response_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::CreateLookupResponse -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::CreateLookupResponse do - let(:instance) { Bandwidth::CreateLookupResponse.new } - - describe 'test an instance of CreateLookupResponse' do - it 'should create an instance of CreateLookupResponse' do - expect(instance).to be_instance_of(Bandwidth::CreateLookupResponse) - end - end - describe 'test attribute "request_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/create_message_request_error_spec.rb b/spec/models/create_message_request_error_spec.rb deleted file mode 100644 index 9a214e93..00000000 --- a/spec/models/create_message_request_error_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::CreateMessageRequestError -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::CreateMessageRequestError do - let(:instance) { Bandwidth::CreateMessageRequestError.new } - - describe 'test an instance of CreateMessageRequestError' do - it 'should create an instance of CreateMessageRequestError' do - expect(instance).to be_instance_of(Bandwidth::CreateMessageRequestError) - end - end - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "field_errors"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/deferred_result_spec.rb b/spec/models/deferred_result_spec.rb index c7740633..e092911c 100644 --- a/spec/models/deferred_result_spec.rb +++ b/spec/models/deferred_result_spec.rb @@ -1,40 +1,87 @@ -=begin -#Bandwidth +# Unit tests for Bandwidth::DeferredResult +describe Bandwidth::DeferredResult do + let(:deferred_result_default) { Bandwidth::DeferredResult.new } + let(:deferred_result_values) { Bandwidth::DeferredResult.new({ + result: { key: 'value' }, + set_or_expired: true + }) } -#Bandwidth's Communication APIs + describe '#initialize' do + it 'causes an ArgumentError by passing an Array to the initialize method' do + expect { + Bandwidth::DeferredResult.new([]) + }.to raise_error(ArgumentError) + end -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 + it 'causes an ArgumentError by passing an invalid attribute to the initialize method' do + expect { + Bandwidth::DeferredResult.new({ invalid: true }) + }.to raise_error(ArgumentError) + end + end -=end + describe '#acceptable_attributes' do + it 'expects acceptable JSON attributes to be those in the attribute map' do + expect(Bandwidth::DeferredResult.acceptable_attributes).to eq(Bandwidth::DeferredResult.attribute_map.values) + end + end + describe '#openapi_nullable' do + it 'expects nullable attributes to be an empty set' do + expect(Bandwidth::DeferredResult.openapi_nullable).to eq(Set.new([])) + end + end -require 'json' -require 'date' + describe '#build_from_hash' do + it 'validates instance of DeferredResult created by the build_from_hash method' do + deferred_result_from_hash = Bandwidth::DeferredResult.build_from_hash({ + result: { key: 'value' }, + setOrExpired: true + }) + expect(deferred_result_from_hash).to be_instance_of(Bandwidth::DeferredResult) + expect(deferred_result_from_hash.result).to eq({ key: 'value' }) + expect(deferred_result_from_hash.set_or_expired).to be true + end + end -# Unit tests for Bandwidth::DeferredResult -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::DeferredResult do - let(:instance) { Bandwidth::DeferredResult.new } + describe '#list_invalid_properties' do + it 'returns list of invalid properties' do + expect(deferred_result_default.list_invalid_properties).to eq([]) + end + end + + describe '#hash' do + it 'returns a hash code according to attributes' do + expect(deferred_result_default.hash).to be_instance_of(Integer) + end + end - describe 'test an instance of DeferredResult' do - it 'should create an instance of DeferredResult' do - expect(instance).to be_instance_of(Bandwidth::DeferredResult) + describe '#to_s' do + it 'returns a string representation of the object' do + expect(deferred_result_values.to_s).to eq('{:result=>{:key=>"value"}, :setOrExpired=>true}') end end - describe 'test attribute "result"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + + describe '#valid?' do + it 'validates instances with and without attributes set' do + expect(deferred_result_default).to be_valid + expect(deferred_result_values).to be_valid end end - describe 'test attribute "set_or_expired"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#eq? #==' do + it 'returns true/false when comparing objects' do + expect(deferred_result_default.eql?(Bandwidth::DeferredResult.new)).to be true + expect(deferred_result_default.eql?(deferred_result_values)).to be false end end + describe '#to_body #to_hash' do + it 'returns a hash representation of the object' do + expect(deferred_result_values.to_body).to eq({ + result: { key: 'value' }, + setOrExpired: true + }) + end + end end diff --git a/spec/models/disconnect_callback_spec.rb b/spec/models/disconnect_callback_spec.rb deleted file mode 100644 index 4c88ef92..00000000 --- a/spec/models/disconnect_callback_spec.rb +++ /dev/null @@ -1,130 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::DisconnectCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::DisconnectCallback do - let(:instance) { Bandwidth::DisconnectCallback.new } - - describe 'test an instance of DisconnectCallback' do - it 'should create an instance of DisconnectCallback' do - expect(instance).to be_instance_of(Bandwidth::DisconnectCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "end_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cause"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/diversion_spec.rb b/spec/models/diversion_spec.rb deleted file mode 100644 index 012d5c35..00000000 --- a/spec/models/diversion_spec.rb +++ /dev/null @@ -1,70 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::Diversion -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::Diversion do - let(:instance) { Bandwidth::Diversion.new } - - describe 'test an instance of Diversion' do - it 'should create an instance of Diversion' do - expect(instance).to be_instance_of(Bandwidth::Diversion) - end - end - describe 'test attribute "reason"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "screen"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "counter"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "limit"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "unknown"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "orig_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/dtmf_callback_spec.rb b/spec/models/dtmf_callback_spec.rb deleted file mode 100644 index ea3f75a1..00000000 --- a/spec/models/dtmf_callback_spec.rb +++ /dev/null @@ -1,130 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::DtmfCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::DtmfCallback do - let(:instance) { Bandwidth::DtmfCallback.new } - - describe 'test an instance of DtmfCallback' do - it 'should create an instance of DtmfCallback' do - expect(instance).to be_instance_of(Bandwidth::DtmfCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "digit"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent_call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_caller_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/field_error_spec.rb b/spec/models/field_error_spec.rb deleted file mode 100644 index 41835ce9..00000000 --- a/spec/models/field_error_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::FieldError -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::FieldError do - let(:instance) { Bandwidth::FieldError.new } - - describe 'test an instance of FieldError' do - it 'should create an instance of FieldError' do - expect(instance).to be_instance_of(Bandwidth::FieldError) - end - end - describe 'test attribute "field_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/file_format_enum_spec.rb b/spec/models/file_format_enum_spec.rb deleted file mode 100644 index 50baca20..00000000 --- a/spec/models/file_format_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::FileFormatEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::FileFormatEnum do - let(:instance) { Bandwidth::FileFormatEnum.new } - - describe 'test an instance of FileFormatEnum' do - it 'should create an instance of FileFormatEnum' do - expect(instance).to be_instance_of(Bandwidth::FileFormatEnum) - end - end -end diff --git a/spec/models/gather_callback_spec.rb b/spec/models/gather_callback_spec.rb deleted file mode 100644 index 9eb22818..00000000 --- a/spec/models/gather_callback_spec.rb +++ /dev/null @@ -1,136 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::GatherCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::GatherCallback do - let(:instance) { Bandwidth::GatherCallback.new } - - describe 'test an instance of GatherCallback' do - it 'should create an instance of GatherCallback' do - expect(instance).to be_instance_of(Bandwidth::GatherCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "digits"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent_call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "terminating_digit"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_caller_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/inbound_message_callback_message_spec.rb b/spec/models/inbound_message_callback_message_spec.rb deleted file mode 100644 index 54e6a724..00000000 --- a/spec/models/inbound_message_callback_message_spec.rb +++ /dev/null @@ -1,100 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::InboundMessageCallbackMessage -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::InboundMessageCallbackMessage do - let(:instance) { Bandwidth::InboundMessageCallbackMessage.new } - - describe 'test an instance of InboundMessageCallbackMessage' do - it 'should create an instance of InboundMessageCallbackMessage' do - expect(instance).to be_instance_of(Bandwidth::InboundMessageCallbackMessage) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "owner"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "segment_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "text"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "priority"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/inbound_message_callback_spec.rb b/spec/models/inbound_message_callback_spec.rb deleted file mode 100644 index 5af404da..00000000 --- a/spec/models/inbound_message_callback_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::InboundMessageCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::InboundMessageCallback do - let(:instance) { Bandwidth::InboundMessageCallback.new } - - describe 'test an instance of InboundMessageCallback' do - it 'should create an instance of InboundMessageCallback' do - expect(instance).to be_instance_of(Bandwidth::InboundMessageCallback) - end - end - describe 'test attribute "time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/initiate_callback_spec.rb b/spec/models/initiate_callback_spec.rb deleted file mode 100644 index 25e1a953..00000000 --- a/spec/models/initiate_callback_spec.rb +++ /dev/null @@ -1,100 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::InitiateCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::InitiateCallback do - let(:instance) { Bandwidth::InitiateCallback.new } - - describe 'test an instance of InitiateCallback' do - it 'should create an instance of InitiateCallback' do - expect(instance).to be_instance_of(Bandwidth::InitiateCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "diversion"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "stir_shaken"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/list_message_direction_enum_spec.rb b/spec/models/list_message_direction_enum_spec.rb deleted file mode 100644 index 14496900..00000000 --- a/spec/models/list_message_direction_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::ListMessageDirectionEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ListMessageDirectionEnum do - let(:instance) { Bandwidth::ListMessageDirectionEnum.new } - - describe 'test an instance of ListMessageDirectionEnum' do - it 'should create an instance of ListMessageDirectionEnum' do - expect(instance).to be_instance_of(Bandwidth::ListMessageDirectionEnum) - end - end -end diff --git a/spec/models/list_message_item_spec.rb b/spec/models/list_message_item_spec.rb deleted file mode 100644 index 1c84722e..00000000 --- a/spec/models/list_message_item_spec.rb +++ /dev/null @@ -1,130 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::ListMessageItem -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::ListMessageItem do - let(:instance) { Bandwidth::ListMessageItem.new } - - describe 'test an instance of ListMessageItem' do - it 'should create an instance of ListMessageItem' do - expect(instance).to be_instance_of(Bandwidth::ListMessageItem) - end - end - describe 'test attribute "message_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "source_tn"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "destination_tn"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message_status"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message_direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "segment_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_code"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "receive_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "carrier_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message_size"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message_length"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "attachment_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "recipient_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "campaign_class"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "campaign_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/lookup_request_spec.rb b/spec/models/lookup_request_spec.rb deleted file mode 100644 index 9240d6c2..00000000 --- a/spec/models/lookup_request_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::LookupRequest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::LookupRequest do - let(:instance) { Bandwidth::LookupRequest.new } - - describe 'test an instance of LookupRequest' do - it 'should create an instance of LookupRequest' do - expect(instance).to be_instance_of(Bandwidth::LookupRequest) - end - end - describe 'test attribute "tns"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/lookup_result_spec.rb b/spec/models/lookup_result_spec.rb deleted file mode 100644 index df7bda86..00000000 --- a/spec/models/lookup_result_spec.rb +++ /dev/null @@ -1,82 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::LookupResult -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::LookupResult do - let(:instance) { Bandwidth::LookupResult.new } - - describe 'test an instance of LookupResult' do - it 'should create an instance of LookupResult' do - expect(instance).to be_instance_of(Bandwidth::LookupResult) - end - end - describe 'test attribute "response_code"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "e_164_format"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "formatted"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "country"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "line_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "line_provider"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "mobile_country_code"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "mobile_network_code"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/lookup_status_enum_spec.rb b/spec/models/lookup_status_enum_spec.rb deleted file mode 100644 index 6b457f21..00000000 --- a/spec/models/lookup_status_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::LookupStatusEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::LookupStatusEnum do - let(:instance) { Bandwidth::LookupStatusEnum.new } - - describe 'test an instance of LookupStatusEnum' do - it 'should create an instance of LookupStatusEnum' do - expect(instance).to be_instance_of(Bandwidth::LookupStatusEnum) - end - end -end diff --git a/spec/models/lookup_status_spec.rb b/spec/models/lookup_status_spec.rb deleted file mode 100644 index af0802fc..00000000 --- a/spec/models/lookup_status_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::LookupStatus -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::LookupStatus do - let(:instance) { Bandwidth::LookupStatus.new } - - describe 'test an instance of LookupStatus' do - it 'should create an instance of LookupStatus' do - expect(instance).to be_instance_of(Bandwidth::LookupStatus) - end - end - describe 'test attribute "request_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "result"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "failed_telephone_numbers"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/machine_detection_complete_callback_spec.rb b/spec/models/machine_detection_complete_callback_spec.rb deleted file mode 100644 index 233514d2..00000000 --- a/spec/models/machine_detection_complete_callback_spec.rb +++ /dev/null @@ -1,112 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MachineDetectionCompleteCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MachineDetectionCompleteCallback do - let(:instance) { Bandwidth::MachineDetectionCompleteCallback.new } - - describe 'test an instance of MachineDetectionCompleteCallback' do - it 'should create an instance of MachineDetectionCompleteCallback' do - expect(instance).to be_instance_of(Bandwidth::MachineDetectionCompleteCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "machine_detection_result"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/machine_detection_configuration_spec.rb b/spec/models/machine_detection_configuration_spec.rb deleted file mode 100644 index 884d4047..00000000 --- a/spec/models/machine_detection_configuration_spec.rb +++ /dev/null @@ -1,118 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MachineDetectionConfiguration -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MachineDetectionConfiguration do - let(:instance) { Bandwidth::MachineDetectionConfiguration.new } - - describe 'test an instance of MachineDetectionConfiguration' do - it 'should create an instance of MachineDetectionConfiguration' do - expect(instance).to be_instance_of(Bandwidth::MachineDetectionConfiguration) - end - end - describe 'test attribute "mode"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "detection_timeout"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "silence_timeout"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "speech_threshold"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "speech_end_threshold"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "machine_speech_end_threshold"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "delay_result"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "callback_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "callback_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/machine_detection_mode_enum_spec.rb b/spec/models/machine_detection_mode_enum_spec.rb deleted file mode 100644 index f471fca1..00000000 --- a/spec/models/machine_detection_mode_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MachineDetectionModeEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MachineDetectionModeEnum do - let(:instance) { Bandwidth::MachineDetectionModeEnum.new } - - describe 'test an instance of MachineDetectionModeEnum' do - it 'should create an instance of MachineDetectionModeEnum' do - expect(instance).to be_instance_of(Bandwidth::MachineDetectionModeEnum) - end - end -end diff --git a/spec/models/machine_detection_result_spec.rb b/spec/models/machine_detection_result_spec.rb deleted file mode 100644 index 95673156..00000000 --- a/spec/models/machine_detection_result_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MachineDetectionResult -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MachineDetectionResult do - let(:instance) { Bandwidth::MachineDetectionResult.new } - - describe 'test an instance of MachineDetectionResult' do - it 'should create an instance of MachineDetectionResult' do - expect(instance).to be_instance_of(Bandwidth::MachineDetectionResult) - end - end - describe 'test attribute "value"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "duration"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/media_spec.rb b/spec/models/media_spec.rb deleted file mode 100644 index e0749f39..00000000 --- a/spec/models/media_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::Media -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::Media do - let(:instance) { Bandwidth::Media.new } - - describe 'test an instance of Media' do - it 'should create an instance of Media' do - expect(instance).to be_instance_of(Bandwidth::Media) - end - end - describe 'test attribute "content"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "content_length"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/message_delivered_callback_message_spec.rb b/spec/models/message_delivered_callback_message_spec.rb deleted file mode 100644 index 2f6124dd..00000000 --- a/spec/models/message_delivered_callback_message_spec.rb +++ /dev/null @@ -1,100 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessageDeliveredCallbackMessage -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessageDeliveredCallbackMessage do - let(:instance) { Bandwidth::MessageDeliveredCallbackMessage.new } - - describe 'test an instance of MessageDeliveredCallbackMessage' do - it 'should create an instance of MessageDeliveredCallbackMessage' do - expect(instance).to be_instance_of(Bandwidth::MessageDeliveredCallbackMessage) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "owner"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "segment_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "text"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "priority"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/message_delivered_callback_spec.rb b/spec/models/message_delivered_callback_spec.rb deleted file mode 100644 index 8f11c0be..00000000 --- a/spec/models/message_delivered_callback_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessageDeliveredCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessageDeliveredCallback do - let(:instance) { Bandwidth::MessageDeliveredCallback.new } - - describe 'test an instance of MessageDeliveredCallback' do - it 'should create an instance of MessageDeliveredCallback' do - expect(instance).to be_instance_of(Bandwidth::MessageDeliveredCallback) - end - end - describe 'test attribute "time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/message_direction_enum_spec.rb b/spec/models/message_direction_enum_spec.rb deleted file mode 100644 index dcfd8336..00000000 --- a/spec/models/message_direction_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessageDirectionEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessageDirectionEnum do - let(:instance) { Bandwidth::MessageDirectionEnum.new } - - describe 'test an instance of MessageDirectionEnum' do - it 'should create an instance of MessageDirectionEnum' do - expect(instance).to be_instance_of(Bandwidth::MessageDirectionEnum) - end - end -end diff --git a/spec/models/message_failed_callback_message_spec.rb b/spec/models/message_failed_callback_message_spec.rb deleted file mode 100644 index 882a7062..00000000 --- a/spec/models/message_failed_callback_message_spec.rb +++ /dev/null @@ -1,100 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessageFailedCallbackMessage -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessageFailedCallbackMessage do - let(:instance) { Bandwidth::MessageFailedCallbackMessage.new } - - describe 'test an instance of MessageFailedCallbackMessage' do - it 'should create an instance of MessageFailedCallbackMessage' do - expect(instance).to be_instance_of(Bandwidth::MessageFailedCallbackMessage) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "owner"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "segment_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "text"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "priority"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/message_failed_callback_spec.rb b/spec/models/message_failed_callback_spec.rb deleted file mode 100644 index 7d4db766..00000000 --- a/spec/models/message_failed_callback_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessageFailedCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessageFailedCallback do - let(:instance) { Bandwidth::MessageFailedCallback.new } - - describe 'test an instance of MessageFailedCallback' do - it 'should create an instance of MessageFailedCallback' do - expect(instance).to be_instance_of(Bandwidth::MessageFailedCallback) - end - end - describe 'test attribute "time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_code"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/message_request_spec.rb b/spec/models/message_request_spec.rb deleted file mode 100644 index 2ea119cc..00000000 --- a/spec/models/message_request_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessageRequest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessageRequest do - let(:instance) { Bandwidth::MessageRequest.new } - - describe 'test an instance of MessageRequest' do - it 'should create an instance of MessageRequest' do - expect(instance).to be_instance_of(Bandwidth::MessageRequest) - end - end - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "text"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "priority"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "expiration"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/message_sending_callback_message_spec.rb b/spec/models/message_sending_callback_message_spec.rb deleted file mode 100644 index 9a73f9ff..00000000 --- a/spec/models/message_sending_callback_message_spec.rb +++ /dev/null @@ -1,100 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessageSendingCallbackMessage -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessageSendingCallbackMessage do - let(:instance) { Bandwidth::MessageSendingCallbackMessage.new } - - describe 'test an instance of MessageSendingCallbackMessage' do - it 'should create an instance of MessageSendingCallbackMessage' do - expect(instance).to be_instance_of(Bandwidth::MessageSendingCallbackMessage) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "owner"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "segment_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "text"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "priority"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/message_sending_callback_spec.rb b/spec/models/message_sending_callback_spec.rb deleted file mode 100644 index 5e5fea3f..00000000 --- a/spec/models/message_sending_callback_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessageSendingCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessageSendingCallback do - let(:instance) { Bandwidth::MessageSendingCallback.new } - - describe 'test an instance of MessageSendingCallback' do - it 'should create an instance of MessageSendingCallback' do - expect(instance).to be_instance_of(Bandwidth::MessageSendingCallback) - end - end - describe 'test attribute "time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/message_spec.rb b/spec/models/message_spec.rb index fb433d25..05f04423 100644 --- a/spec/models/message_spec.rb +++ b/spec/models/message_spec.rb @@ -1,106 +1,145 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - # Unit tests for Bandwidth::Message -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate describe Bandwidth::Message do - let(:instance) { Bandwidth::Message.new } - - describe 'test an instance of Message' do - it 'should create an instance of Message' do - expect(instance).to be_instance_of(Bandwidth::Message) + let(:message_default) { Bandwidth::Message.new } + let(:message_values) { Bandwidth::Message.new({ + id: '1589228074636lm4k2je7j7jklbn2', + owner: '+19195554321', + application_id: '93de2206-9669-4e07-948d-329f4b722ee2', + time: '2022-06-16T13:15:07.160Z', + segment_count: 2, + direction: 'in', + to: ['+19195551234'], + from: '+19195554321', + media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'], + text: 'Hello world', + tag: 'custom tag', + priority: 'default', + expiration: '2022-06-16T13:45:07.160Z' + }) } + + describe '#initialize' do + it 'causes an ArgumentError by passing an Array to the initialize method' do + expect { + Bandwidth::Message.new([]) + }.to raise_error(ArgumentError) end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - describe 'test attribute "owner"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + it 'causes an ArgumentError by passing an invalid attribute to the initialize method' do + expect { + Bandwidth::Message.new({ invalid: true }) + }.to raise_error(ArgumentError) end end - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#acceptable_attributes' do + it 'expects acceptable JSON attributes to be those in the attribute map' do + expect(Bandwidth::Message.acceptable_attributes).to eq(Bandwidth::Message.attribute_map.values) end end - describe 'test attribute "time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe 'EnumAttributeValidator' do + it 'validates string enum' do + validator = Bandwidth::Message::EnumAttributeValidator.new(String, ['valid']) + expect(validator.valid?('valid')).to be true + expect(validator.valid?('invalid')).to be false end - end - describe 'test attribute "segment_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + it 'validates integer enum' do + validator = Bandwidth::Message::EnumAttributeValidator.new(Integer, [1]) + expect(validator.valid?(1)).to be true + expect(validator.valid?('invalid')).to be false end - end - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + it 'validates float enum' do + validator = Bandwidth::Message::EnumAttributeValidator.new(Float, [1.0]) + expect(validator.valid?(1.0)).to be true + expect(validator.valid?('invalid')).to be false end end - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#build_from_hash' do + it 'validates instance of Message created by the build_from_hash method' do + message_from_hash = Bandwidth::Message.build_from_hash({ + id: '1589228074636lm4k2je7j7jklbn2', + owner: '+19195554321', + applicationId: '93de2206-9669-4e07-948d-329f4b722ee2', + time: '2022-06-16T13:15:07.160Z', + segmentCount: 2, + direction: 'in', + to: ['+19195551234'], + from: '+19195554321', + media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'], + text: 'Hello world', + tag: 'custom tag', + priority: 'default', + expiration: '2022-06-16T13:45:07.160Z' + }) + expect(message_from_hash).to be_instance_of(Bandwidth::Message) + expect(message_from_hash.id).to eq('1589228074636lm4k2je7j7jklbn2') + expect(message_from_hash.owner).to eq('+19195554321') + expect(message_from_hash.application_id).to eq('93de2206-9669-4e07-948d-329f4b722ee2') + expect(message_from_hash.time).to eq(Time.parse('2022-06-16T13:15:07.160Z')) + expect(message_from_hash.segment_count).to eq(2) + expect(message_from_hash.direction).to eq('in') + expect(message_from_hash.to).to eq(['+19195551234']) + expect(message_from_hash.from).to eq('+19195554321') + expect(message_from_hash.media).to eq(['https://dev.bandwidth.com/images/bandwidth-logo.png']) + expect(message_from_hash.text).to eq('Hello world') + expect(message_from_hash.tag).to eq('custom tag') + expect(message_from_hash.priority).to eq('default') + expect(message_from_hash.expiration).to eq(Time.parse('2022-06-16T13:45:07.160Z')) end end - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#list_invalid_properties' do + it 'returns list of invalid properties' do + expect(message_default.list_invalid_properties).to eq([]) end end - describe 'test attribute "media"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#hash' do + it 'returns a hash code according to attributes' do + expect(message_default.hash).to be_instance_of(Integer) end end - describe 'test attribute "text"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#to_s' do + it 'returns a string representation of the object' do + expect(message_default.to_s).to eq('{}') end end - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#valid?' do + it 'validates instances with and without attributes set' do + expect(message_default).to be_valid + expect(message_values).to be_valid end end - describe 'test attribute "priority"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#eq? #==' do + it 'returns true/false when comparing objects' do + expect(message_default.eql?(Bandwidth::Message.new)).to be true + expect(message_default.eql?(message_values)).to be false end end - describe 'test attribute "expiration"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#to_body #to_hash' do + it 'returns a hash representation of the object' do + expect(message_values.to_body).to eq({ + id: '1589228074636lm4k2je7j7jklbn2', + owner: '+19195554321', + applicationId: '93de2206-9669-4e07-948d-329f4b722ee2', + time: '2022-06-16T13:15:07.160Z', + segmentCount: 2, + direction: 'in', + to: ['+19195551234'], + from: '+19195554321', + media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'], + text: 'Hello world', + tag: 'custom tag', + priority: 'default', + expiration: '2022-06-16T13:45:07.160Z' + }) end end - end diff --git a/spec/models/message_status_enum_spec.rb b/spec/models/message_status_enum_spec.rb deleted file mode 100644 index 13d5f333..00000000 --- a/spec/models/message_status_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessageStatusEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessageStatusEnum do - let(:instance) { Bandwidth::MessageStatusEnum.new } - - describe 'test an instance of MessageStatusEnum' do - it 'should create an instance of MessageStatusEnum' do - expect(instance).to be_instance_of(Bandwidth::MessageStatusEnum) - end - end -end diff --git a/spec/models/message_type_enum_spec.rb b/spec/models/message_type_enum_spec.rb deleted file mode 100644 index e0ead866..00000000 --- a/spec/models/message_type_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessageTypeEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessageTypeEnum do - let(:instance) { Bandwidth::MessageTypeEnum.new } - - describe 'test an instance of MessageTypeEnum' do - it 'should create an instance of MessageTypeEnum' do - expect(instance).to be_instance_of(Bandwidth::MessageTypeEnum) - end - end -end diff --git a/spec/models/messages_list_spec.rb b/spec/models/messages_list_spec.rb deleted file mode 100644 index 997b22b7..00000000 --- a/spec/models/messages_list_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessagesList -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessagesList do - let(:instance) { Bandwidth::MessagesList.new } - - describe 'test an instance of MessagesList' do - it 'should create an instance of MessagesList' do - expect(instance).to be_instance_of(Bandwidth::MessagesList) - end - end - describe 'test attribute "total_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "page_info"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "messages"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/messaging_code_response_spec.rb b/spec/models/messaging_code_response_spec.rb deleted file mode 100644 index d21ee2cc..00000000 --- a/spec/models/messaging_code_response_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessagingCodeResponse -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessagingCodeResponse do - let(:instance) { Bandwidth::MessagingCodeResponse.new } - - describe 'test an instance of MessagingCodeResponse' do - it 'should create an instance of MessagingCodeResponse' do - expect(instance).to be_instance_of(Bandwidth::MessagingCodeResponse) - end - end - describe 'test attribute "message_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/messaging_request_error_spec.rb b/spec/models/messaging_request_error_spec.rb deleted file mode 100644 index 159a980b..00000000 --- a/spec/models/messaging_request_error_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MessagingRequestError -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MessagingRequestError do - let(:instance) { Bandwidth::MessagingRequestError.new } - - describe 'test an instance of MessagingRequestError' do - it 'should create an instance of MessagingRequestError' do - expect(instance).to be_instance_of(Bandwidth::MessagingRequestError) - end - end - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/mfa_forbidden_request_error_spec.rb b/spec/models/mfa_forbidden_request_error_spec.rb deleted file mode 100644 index 71330ae1..00000000 --- a/spec/models/mfa_forbidden_request_error_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MfaForbiddenRequestError -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MfaForbiddenRequestError do - let(:instance) { Bandwidth::MfaForbiddenRequestError.new } - - describe 'test an instance of MfaForbiddenRequestError' do - it 'should create an instance of MfaForbiddenRequestError' do - expect(instance).to be_instance_of(Bandwidth::MfaForbiddenRequestError) - end - end - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/mfa_request_error_spec.rb b/spec/models/mfa_request_error_spec.rb deleted file mode 100644 index 4d4d98f7..00000000 --- a/spec/models/mfa_request_error_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MfaRequestError -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MfaRequestError do - let(:instance) { Bandwidth::MfaRequestError.new } - - describe 'test an instance of MfaRequestError' do - it 'should create an instance of MfaRequestError' do - expect(instance).to be_instance_of(Bandwidth::MfaRequestError) - end - end - describe 'test attribute "error"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "request_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/mfa_unauthorized_request_error_spec.rb b/spec/models/mfa_unauthorized_request_error_spec.rb deleted file mode 100644 index e9521542..00000000 --- a/spec/models/mfa_unauthorized_request_error_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::MfaUnauthorizedRequestError -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::MfaUnauthorizedRequestError do - let(:instance) { Bandwidth::MfaUnauthorizedRequestError.new } - - describe 'test an instance of MfaUnauthorizedRequestError' do - it 'should create an instance of MfaUnauthorizedRequestError' do - expect(instance).to be_instance_of(Bandwidth::MfaUnauthorizedRequestError) - end - end - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/page_info_spec.rb b/spec/models/page_info_spec.rb deleted file mode 100644 index 61f47b44..00000000 --- a/spec/models/page_info_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::PageInfo -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::PageInfo do - let(:instance) { Bandwidth::PageInfo.new } - - describe 'test an instance of PageInfo' do - it 'should create an instance of PageInfo' do - expect(instance).to be_instance_of(Bandwidth::PageInfo) - end - end - describe 'test attribute "prev_page"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "next_page"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "prev_page_token"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "next_page_token"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/priority_enum_spec.rb b/spec/models/priority_enum_spec.rb deleted file mode 100644 index 365965d7..00000000 --- a/spec/models/priority_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::PriorityEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::PriorityEnum do - let(:instance) { Bandwidth::PriorityEnum.new } - - describe 'test an instance of PriorityEnum' do - it 'should create an instance of PriorityEnum' do - expect(instance).to be_instance_of(Bandwidth::PriorityEnum) - end - end -end diff --git a/spec/models/recording_available_callback_spec.rb b/spec/models/recording_available_callback_spec.rb deleted file mode 100644 index d79985df..00000000 --- a/spec/models/recording_available_callback_spec.rb +++ /dev/null @@ -1,160 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::RecordingAvailableCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::RecordingAvailableCallback do - let(:instance) { Bandwidth::RecordingAvailableCallback.new } - - describe 'test an instance of RecordingAvailableCallback' do - it 'should create an instance of RecordingAvailableCallback' do - expect(instance).to be_instance_of(Bandwidth::RecordingAvailableCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent_call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "recording_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "end_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "duration"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "file_format"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "channels"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_caller_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/recording_complete_callback_spec.rb b/spec/models/recording_complete_callback_spec.rb deleted file mode 100644 index 4fcc6324..00000000 --- a/spec/models/recording_complete_callback_spec.rb +++ /dev/null @@ -1,160 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::RecordingCompleteCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::RecordingCompleteCallback do - let(:instance) { Bandwidth::RecordingCompleteCallback.new } - - describe 'test an instance of RecordingCompleteCallback' do - it 'should create an instance of RecordingCompleteCallback' do - expect(instance).to be_instance_of(Bandwidth::RecordingCompleteCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent_call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "recording_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "end_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "duration"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "file_format"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "channels"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_caller_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/recording_state_enum_spec.rb b/spec/models/recording_state_enum_spec.rb deleted file mode 100644 index 5880f277..00000000 --- a/spec/models/recording_state_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::RecordingStateEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::RecordingStateEnum do - let(:instance) { Bandwidth::RecordingStateEnum.new } - - describe 'test an instance of RecordingStateEnum' do - it 'should create an instance of RecordingStateEnum' do - expect(instance).to be_instance_of(Bandwidth::RecordingStateEnum) - end - end -end diff --git a/spec/models/redirect_callback_spec.rb b/spec/models/redirect_callback_spec.rb deleted file mode 100644 index 7914bd54..00000000 --- a/spec/models/redirect_callback_spec.rb +++ /dev/null @@ -1,124 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::RedirectCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::RedirectCallback do - let(:instance) { Bandwidth::RedirectCallback.new } - - describe 'test an instance of RedirectCallback' do - it 'should create an instance of RedirectCallback' do - expect(instance).to be_instance_of(Bandwidth::RedirectCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent_call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_caller_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/redirect_method_enum_spec.rb b/spec/models/redirect_method_enum_spec.rb deleted file mode 100644 index f93245ab..00000000 --- a/spec/models/redirect_method_enum_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::RedirectMethodEnum -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::RedirectMethodEnum do - let(:instance) { Bandwidth::RedirectMethodEnum.new } - - describe 'test an instance of RedirectMethodEnum' do - it 'should create an instance of RedirectMethodEnum' do - expect(instance).to be_instance_of(Bandwidth::RedirectMethodEnum) - end - end -end diff --git a/spec/models/stir_shaken_spec.rb b/spec/models/stir_shaken_spec.rb deleted file mode 100644 index 5ea177e3..00000000 --- a/spec/models/stir_shaken_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::StirShaken -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::StirShaken do - let(:instance) { Bandwidth::StirShaken.new } - - describe 'test an instance of StirShaken' do - it 'should create an instance of StirShaken' do - expect(instance).to be_instance_of(Bandwidth::StirShaken) - end - end - describe 'test attribute "verstat"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "attestation_indicator"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "originating_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/tag_spec.rb b/spec/models/tag_spec.rb deleted file mode 100644 index bd8791fc..00000000 --- a/spec/models/tag_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::Tag -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::Tag do - let(:instance) { Bandwidth::Tag.new } - - describe 'test an instance of Tag' do - it 'should create an instance of Tag' do - expect(instance).to be_instance_of(Bandwidth::Tag) - end - end - describe 'test attribute "key"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "value"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/tn_lookup_request_error_spec.rb b/spec/models/tn_lookup_request_error_spec.rb deleted file mode 100644 index 970182bb..00000000 --- a/spec/models/tn_lookup_request_error_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::TnLookupRequestError -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::TnLookupRequestError do - let(:instance) { Bandwidth::TnLookupRequestError.new } - - describe 'test an instance of TnLookupRequestError' do - it 'should create an instance of TnLookupRequestError' do - expect(instance).to be_instance_of(Bandwidth::TnLookupRequestError) - end - end - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/transcribe_recording_spec.rb b/spec/models/transcribe_recording_spec.rb deleted file mode 100644 index 670f7390..00000000 --- a/spec/models/transcribe_recording_spec.rb +++ /dev/null @@ -1,70 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::TranscribeRecording -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::TranscribeRecording do - let(:instance) { Bandwidth::TranscribeRecording.new } - - describe 'test an instance of TranscribeRecording' do - it 'should create an instance of TranscribeRecording' do - expect(instance).to be_instance_of(Bandwidth::TranscribeRecording) - end - end - describe 'test attribute "callback_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "callback_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "callback_timeout"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "detect_language"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/transcription_available_callback_spec.rb b/spec/models/transcription_available_callback_spec.rb deleted file mode 100644 index b3142b02..00000000 --- a/spec/models/transcription_available_callback_spec.rb +++ /dev/null @@ -1,154 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::TranscriptionAvailableCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::TranscriptionAvailableCallback do - let(:instance) { Bandwidth::TranscriptionAvailableCallback.new } - - describe 'test an instance of TranscriptionAvailableCallback' do - it 'should create an instance of TranscriptionAvailableCallback' do - expect(instance).to be_instance_of(Bandwidth::TranscriptionAvailableCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent_call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "recording_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "end_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "duration"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "file_format"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transcription"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_caller_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/transcription_list_spec.rb b/spec/models/transcription_list_spec.rb deleted file mode 100644 index 0f6e4c9c..00000000 --- a/spec/models/transcription_list_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::TranscriptionList -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::TranscriptionList do - let(:instance) { Bandwidth::TranscriptionList.new } - - describe 'test an instance of TranscriptionList' do - it 'should create an instance of TranscriptionList' do - expect(instance).to be_instance_of(Bandwidth::TranscriptionList) - end - end - describe 'test attribute "transcripts"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/transcription_metadata_spec.rb b/spec/models/transcription_metadata_spec.rb deleted file mode 100644 index 345d3180..00000000 --- a/spec/models/transcription_metadata_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::TranscriptionMetadata -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::TranscriptionMetadata do - let(:instance) { Bandwidth::TranscriptionMetadata.new } - - describe 'test an instance of TranscriptionMetadata' do - it 'should create an instance of TranscriptionMetadata' do - expect(instance).to be_instance_of(Bandwidth::TranscriptionMetadata) - end - end - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "completed_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/transcription_spec.rb b/spec/models/transcription_spec.rb deleted file mode 100644 index 2c61d326..00000000 --- a/spec/models/transcription_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::Transcription -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::Transcription do - let(:instance) { Bandwidth::Transcription.new } - - describe 'test an instance of Transcription' do - it 'should create an instance of Transcription' do - expect(instance).to be_instance_of(Bandwidth::Transcription) - end - end - describe 'test attribute "text"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "confidence"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/transfer_answer_callback_spec.rb b/spec/models/transfer_answer_callback_spec.rb deleted file mode 100644 index 68a7064b..00000000 --- a/spec/models/transfer_answer_callback_spec.rb +++ /dev/null @@ -1,118 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::TransferAnswerCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::TransferAnswerCallback do - let(:instance) { Bandwidth::TransferAnswerCallback.new } - - describe 'test an instance of TransferAnswerCallback' do - it 'should create an instance of TransferAnswerCallback' do - expect(instance).to be_instance_of(Bandwidth::TransferAnswerCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_caller_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/transfer_complete_callback_spec.rb b/spec/models/transfer_complete_callback_spec.rb deleted file mode 100644 index a82e2cb5..00000000 --- a/spec/models/transfer_complete_callback_spec.rb +++ /dev/null @@ -1,136 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::TransferCompleteCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::TransferCompleteCallback do - let(:instance) { Bandwidth::TransferCompleteCallback.new } - - describe 'test an instance of TransferCompleteCallback' do - it 'should create an instance of TransferCompleteCallback' do - expect(instance).to be_instance_of(Bandwidth::TransferCompleteCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_caller_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cause"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/transfer_disconnect_callback_spec.rb b/spec/models/transfer_disconnect_callback_spec.rb deleted file mode 100644 index 75dfc0c4..00000000 --- a/spec/models/transfer_disconnect_callback_spec.rb +++ /dev/null @@ -1,148 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::TransferDisconnectCallback -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::TransferDisconnectCallback do - let(:instance) { Bandwidth::TransferDisconnectCallback.new } - - describe 'test an instance of TransferDisconnectCallback' do - it 'should create an instance of TransferDisconnectCallback' do - expect(instance).to be_instance_of(Bandwidth::TransferDisconnectCallback) - end - end - describe 'test attribute "event_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "account_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "application_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "from"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "direction"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent_call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enqueued_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "answer_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "end_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_caller_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "transfer_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cause"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/update_call_recording_spec.rb b/spec/models/update_call_recording_spec.rb deleted file mode 100644 index f3518761..00000000 --- a/spec/models/update_call_recording_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::UpdateCallRecording -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::UpdateCallRecording do - let(:instance) { Bandwidth::UpdateCallRecording.new } - - describe 'test an instance of UpdateCallRecording' do - it 'should create an instance of UpdateCallRecording' do - expect(instance).to be_instance_of(Bandwidth::UpdateCallRecording) - end - end - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/update_call_spec.rb b/spec/models/update_call_spec.rb deleted file mode 100644 index 038d5d50..00000000 --- a/spec/models/update_call_spec.rb +++ /dev/null @@ -1,88 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::UpdateCall -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::UpdateCall do - let(:instance) { Bandwidth::UpdateCall.new } - - describe 'test an instance of UpdateCall' do - it 'should create an instance of UpdateCall' do - expect(instance).to be_instance_of(Bandwidth::UpdateCall) - end - end - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "redirect_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "redirect_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "redirect_fallback_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "redirect_fallback_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tag"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/update_conference_member_spec.rb b/spec/models/update_conference_member_spec.rb deleted file mode 100644 index 51707995..00000000 --- a/spec/models/update_conference_member_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::UpdateConferenceMember -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::UpdateConferenceMember do - let(:instance) { Bandwidth::UpdateConferenceMember.new } - - describe 'test an instance of UpdateConferenceMember' do - it 'should create an instance of UpdateConferenceMember' do - expect(instance).to be_instance_of(Bandwidth::UpdateConferenceMember) - end - end - describe 'test attribute "mute"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "hold"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "call_ids_to_coach"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/update_conference_spec.rb b/spec/models/update_conference_spec.rb deleted file mode 100644 index b4d495d7..00000000 --- a/spec/models/update_conference_spec.rb +++ /dev/null @@ -1,82 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::UpdateConference -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::UpdateConference do - let(:instance) { Bandwidth::UpdateConference.new } - - describe 'test an instance of UpdateConference' do - it 'should create an instance of UpdateConference' do - expect(instance).to be_instance_of(Bandwidth::UpdateConference) - end - end - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "redirect_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "redirect_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "redirect_fallback_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "redirect_fallback_method"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fallback_password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/verify_code_request_spec.rb b/spec/models/verify_code_request_spec.rb index 2b5afc89..643a2ed7 100644 --- a/spec/models/verify_code_request_spec.rb +++ b/spec/models/verify_code_request_spec.rb @@ -1,52 +1,134 @@ -=begin -#Bandwidth +# Unit tests for Bandwidth::VerifyCodeRequest +describe Bandwidth::VerifyCodeRequest do + let(:verify_code_request_default) { Bandwidth::VerifyCodeRequest.new } + let(:verify_code_request_values) { Bandwidth::VerifyCodeRequest.new({ + to: '+19195551234', + scope: '2FA', + expiration_time_in_minutes: 1.0, + code: '123456' + }) } -#Bandwidth's Communication APIs + describe '#initialize' do + it 'causes an ArgumentError by passing an Array to the initialize method' do + expect { + Bandwidth::VerifyCodeRequest.new([]) + }.to raise_error(ArgumentError) + end -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 + it 'causes an ArgumentError by passing an invalid attribute to the initialize method' do + expect { + Bandwidth::VerifyCodeRequest.new({ invalid: true }) + }.to raise_error(ArgumentError) + end + end -=end + describe '#acceptable_attributes' do + it 'expects acceptable JSON attributes to be those in the attribute map' do + expect(Bandwidth::VerifyCodeRequest.acceptable_attributes).to eq(Bandwidth::VerifyCodeRequest.attribute_map.values) + end + end + describe '#openapi_nullable' do + it 'expects nullable attributes to be an empty set' do + expect(Bandwidth::VerifyCodeRequest.openapi_nullable).to eq(Set.new([])) + end + end -require 'json' -require 'date' + describe '#build_from_hash' do + it 'validates instance of VerifyCodeRequest created by the build_from_hash method' do + verify_code_request_from_hash = Bandwidth::VerifyCodeRequest.build_from_hash({ + to: '+19195551234', + scope: '2FA', + expirationTimeInMinutes: 1.0, + code: '123456' + }) + expect(verify_code_request_from_hash).to be_instance_of(Bandwidth::VerifyCodeRequest) + expect(verify_code_request_from_hash.to).to eq('+19195551234') + expect(verify_code_request_from_hash.scope).to eq('2FA') + expect(verify_code_request_from_hash.expiration_time_in_minutes).to eq(1.0) + expect(verify_code_request_from_hash.code).to eq('123456') + end + end -# Unit tests for Bandwidth::VerifyCodeRequest -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::VerifyCodeRequest do - let(:instance) { Bandwidth::VerifyCodeRequest.new } + describe '#list_invalid_properties' do + it 'returns list of invalid properties' do + expect(verify_code_request_values.list_invalid_properties).to eq([]) + end + end - describe 'test an instance of VerifyCodeRequest' do - it 'should create an instance of VerifyCodeRequest' do - expect(instance).to be_instance_of(Bandwidth::VerifyCodeRequest) + describe '#hash' do + it 'returns a hash code according to attributes' do + expect(verify_code_request_values.hash).to be_instance_of(Integer) end end - describe 'test attribute "to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + + describe '#to_s' do + it 'returns a string representation of the object' do + expect(verify_code_request_values.to_s).to eq('{:to=>"+19195551234", :scope=>"2FA", :expirationTimeInMinutes=>1.0, :code=>"123456"}') end end - describe 'test attribute "scope"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#valid?' do + it 'validates instances with and without attributes set' do + expect(verify_code_request_values).to be_valid end end - describe 'test attribute "expiration_time_in_minutes"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#eq? #==' do + it 'returns true/false when comparing objects' do + expect(verify_code_request_default.eql?(Bandwidth::VerifyCodeRequest.new)).to be true + expect(verify_code_request_default.eql?(verify_code_request_values)).to be false end end - describe 'test attribute "code"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + describe '#to_body #to_hash' do + it 'returns a hash representation of the object' do + expect(verify_code_request_values.to_body).to eq({ + to: '+19195551234', + scope: '2FA', + expirationTimeInMinutes: 1.0, + code: '123456' + }) end end + describe 'custom attribute writers' do + it '#to=' do + expect { + Bandwidth::VerifyCodeRequest.new({ to: nil }) + }.to raise_error(ArgumentError, 'to cannot be nil') + + expect { + Bandwidth::VerifyCodeRequest.new({ to: 'invalid' }) + }.to raise_error(ArgumentError, 'invalid value for "to", must conform to the pattern (?-mix:^\+[1-9]\d{1,14}$).') + end + + it '#expiration_time_in_minutes=' do + expect { + Bandwidth::VerifyCodeRequest.new({ to: '+19195551234', expiration_time_in_minutes: nil }) + }.to raise_error(ArgumentError, 'expiration_time_in_minutes cannot be nil') + + expect { + Bandwidth::VerifyCodeRequest.new({ to: '+19195551234', expiration_time_in_minutes: 16 }) + }.to raise_error(ArgumentError, 'invalid value for "expiration_time_in_minutes", must be smaller than or equal to 15.') + + expect { + Bandwidth::VerifyCodeRequest.new({ to: '+19195551234', expiration_time_in_minutes: 0 }) + }.to raise_error(ArgumentError, 'invalid value for "expiration_time_in_minutes", must be greater than or equal to 1.') + end + + it '#code=' do + expect { + Bandwidth::VerifyCodeRequest.new({ to: '+19195551234', expiration_time_in_minutes: 1, code: nil }) + }.to raise_error(ArgumentError, 'code cannot be nil') + + expect { + Bandwidth::VerifyCodeRequest.new({ to: '+19195551234', expiration_time_in_minutes: 1, code: '123456789' }) + }.to raise_error(ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 8.') + + expect { + Bandwidth::VerifyCodeRequest.new({ to: '+19195551234', expiration_time_in_minutes: 1, code: '123' }) + }.to raise_error(ArgumentError, 'invalid value for "code", the character length must be great than or equal to 4.') + end + end end diff --git a/spec/models/verify_code_response_spec.rb b/spec/models/verify_code_response_spec.rb deleted file mode 100644 index d0e87540..00000000 --- a/spec/models/verify_code_response_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::VerifyCodeResponse -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::VerifyCodeResponse do - let(:instance) { Bandwidth::VerifyCodeResponse.new } - - describe 'test an instance of VerifyCodeResponse' do - it 'should create an instance of VerifyCodeResponse' do - expect(instance).to be_instance_of(Bandwidth::VerifyCodeResponse) - end - end - describe 'test attribute "valid"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/voice_api_error_spec.rb b/spec/models/voice_api_error_spec.rb deleted file mode 100644 index 50566eb1..00000000 --- a/spec/models/voice_api_error_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::VoiceApiError -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::VoiceApiError do - let(:instance) { Bandwidth::VoiceApiError.new } - - describe 'test an instance of VoiceApiError' do - it 'should create an instance of VoiceApiError' do - expect(instance).to be_instance_of(Bandwidth::VoiceApiError) - end - end - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/voice_code_response_spec.rb b/spec/models/voice_code_response_spec.rb deleted file mode 100644 index a9c3e5d3..00000000 --- a/spec/models/voice_code_response_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.6.0 - -=end - - -require 'json' -require 'date' - -# Unit tests for Bandwidth::VoiceCodeResponse -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Bandwidth::VoiceCodeResponse do - let(:instance) { Bandwidth::VoiceCodeResponse.new } - - describe 'test an instance of VoiceCodeResponse' do - it 'should create an instance of VoiceCodeResponse' do - expect(instance).to be_instance_of(Bandwidth::VoiceCodeResponse) - end - end - describe 'test attribute "call_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e6672df9..29b3424b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,14 +1,25 @@ -=begin -#Bandwidth - -#Bandwidth's Communication APIs - -The version of the OpenAPI document: 1.0.0 -Contact: letstalk@bandwidth.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.4.0 - -=end +# Test Coverage Configuration +require 'simplecov' +SimpleCov.start do + add_filter 'spec/integration' + add_filter 'spec/call_utils.rb' + add_filter do |source_file| + if !source_file.filename.include? 'bandwidth-sdk/models' then + false + else + !(['/models/call_state_enum.rb', + '/models/call_state.rb', + '/models/deferred_result.rb', + '/models/message.rb', + '/models/verify_code_request.rb' + ].any? { |name| source_file.filename.include?(name) }) + end + end + add_group 'Models', 'lib/bandwidth-sdk/models/' + add_group 'APIs', 'lib/bandwidth-sdk/api/' + add_group 'Client', ['api_client.rb', 'api_error.rb', 'configuration.rb', 'bandwidth-sdk.rb'] + add_group 'Tests', 'spec' +end # load the gem require 'bandwidth-sdk' @@ -16,6 +27,9 @@ # load call utils every time. This prevents an error from occuring when running only unit tests require_relative './call_utils' +# use webmock to stub HTTP requests +require 'webmock/rspec' + # The following was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause @@ -37,31 +51,31 @@ RSpec.configure do |config| config.before(:suite) { begin - BW_USERNAME = ENV.fetch("BW_USERNAME") - BW_PASSWORD = ENV.fetch("BW_PASSWORD") - FORBIDDEN_USERNAME = ENV.fetch("BW_USERNAME_FORBIDDEN") - FORBIDDEN_PASSWORD = ENV.fetch("BW_PASSWORD_FORBIDDEN") - BW_ACCOUNT_ID = ENV.fetch("BW_ACCOUNT_ID") - BW_VOICE_APPLICATION_ID = ENV.fetch("BW_VOICE_APPLICATION_ID") - BW_MESSAGING_APPLICATION_ID = ENV.fetch("BW_MESSAGING_APPLICATION_ID") - BASE_CALLBACK_URL = ENV.fetch("BASE_CALLBACK_URL") - BW_NUMBER = ENV.fetch("BW_NUMBER") - USER_NUMBER = ENV.fetch("USER_NUMBER") - MANTECA_ACTIVE_NUMBER = ENV.fetch("MANTECA_ACTIVE_NUMBER") - MANTECA_IDLE_NUMBER = ENV.fetch("MANTECA_IDLE_NUMBER") - MANTECA_BASE_URL = ENV.fetch("MANTECA_BASE_URL") - MANTECA_APPLICATION_ID = ENV.fetch("MANTECA_APPLICATION_ID") - OPERATING_SYSTEM = ENV.fetch("OPERATING_SYSTEM") - RUBY_VERSION = ENV.fetch("RUBY_VERSION") + BW_USERNAME = ENV.fetch('BW_USERNAME') + BW_PASSWORD = ENV.fetch('BW_PASSWORD') + FORBIDDEN_USERNAME = ENV.fetch('BW_USERNAME_FORBIDDEN') + FORBIDDEN_PASSWORD = ENV.fetch('BW_PASSWORD_FORBIDDEN') + BW_ACCOUNT_ID = ENV.fetch('BW_ACCOUNT_ID') + BW_VOICE_APPLICATION_ID = ENV.fetch('BW_VOICE_APPLICATION_ID') + BW_MESSAGING_APPLICATION_ID = ENV.fetch('BW_MESSAGING_APPLICATION_ID') + BASE_CALLBACK_URL = ENV.fetch('BASE_CALLBACK_URL') + BW_NUMBER = ENV.fetch('BW_NUMBER') + USER_NUMBER = ENV.fetch('USER_NUMBER') + MANTECA_ACTIVE_NUMBER = ENV.fetch('MANTECA_ACTIVE_NUMBER') + MANTECA_IDLE_NUMBER = ENV.fetch('MANTECA_IDLE_NUMBER') + MANTECA_BASE_URL = ENV.fetch('MANTECA_BASE_URL') + MANTECA_APPLICATION_ID = ENV.fetch('MANTECA_APPLICATION_ID') + OPERATING_SYSTEM = ENV.fetch('OPERATING_SYSTEM') + RUBY_VERSION = ENV.fetch('RUBY_VERSION') rescue - puts "Environmental variables not found" + puts 'Environmental variables not found' exit(-1) end - DATA = 0 # index for response array related to the response data - CODE = 1 # index for response array related to the status code SLEEP_TIME_S = 3 # default sleep time in seconds MAX_RETRIES = 40 + UNAUTHORIZED_USERNAME = 'bad_username' + UNAUTHORIZED_PASSWORD = 'bad_password' $active_calls = [] $complete_call_body = Bandwidth::UpdateCall.new( From 0ddacd4cd99f8c9e187909e5fb5c8b66b9b30908 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Wed, 19 Jul 2023 10:55:10 -0400 Subject: [PATCH 21/30] SWI-2821 Improve BXML Library (#106) --- lib/bandwidth-sdk/models/bxml/bxml.rb | 4 +--- lib/bandwidth-sdk/models/bxml/nestable_verb.rb | 4 +--- lib/bandwidth-sdk/models/bxml/response.rb | 4 +--- lib/bandwidth-sdk/models/bxml/root.rb | 2 +- lib/bandwidth-sdk/models/bxml/verb.rb | 2 +- lib/bandwidth-sdk/models/bxml/verbs/bridge.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/conference.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/forward.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/gather.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/hangup.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/pause.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/record.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/redirect.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/ring.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/tag.rb | 4 +--- lib/bandwidth-sdk/models/bxml/verbs/transfer.rb | 4 +--- spec/models/bxml/nestable_verb_spec.rb | 2 +- spec/models/bxml/verb_spec.rb | 2 +- 35 files changed, 35 insertions(+), 97 deletions(-) diff --git a/lib/bandwidth-sdk/models/bxml/bxml.rb b/lib/bandwidth-sdk/models/bxml/bxml.rb index 0383ed7d..cd8c6b10 100644 --- a/lib/bandwidth-sdk/models/bxml/bxml.rb +++ b/lib/bandwidth-sdk/models/bxml/bxml.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Bxml - include Bandwidth::Bxml::Root - + class Bxml < Bandwidth::Bxml::Root # Initializer # @param nested_verbs [Array] XML element children. Defaults to an empty array. def initialize(nested_verbs = []) diff --git a/lib/bandwidth-sdk/models/bxml/nestable_verb.rb b/lib/bandwidth-sdk/models/bxml/nestable_verb.rb index 9b217455..bc0793d3 100644 --- a/lib/bandwidth-sdk/models/bxml/nestable_verb.rb +++ b/lib/bandwidth-sdk/models/bxml/nestable_verb.rb @@ -2,9 +2,7 @@ module Bandwidth module Bxml - module NestableVerb - include Bandwidth::Bxml::Verb - + class NestableVerb < Bandwidth::Bxml::Verb # Initializer # @param tag [String] Name of the XML element. # @param content [String] XML element content. Defaults to nil. diff --git a/lib/bandwidth-sdk/models/bxml/response.rb b/lib/bandwidth-sdk/models/bxml/response.rb index 195c2887..e0bbb7e4 100644 --- a/lib/bandwidth-sdk/models/bxml/response.rb +++ b/lib/bandwidth-sdk/models/bxml/response.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Response - include Bandwidth::Bxml::Root - + class Response < Bandwidth::Bxml::Root # Initializer # @param nested_verbs [Array] XML element children. Defaults to an empty array. def initialize(nested_verbs = []) diff --git a/lib/bandwidth-sdk/models/bxml/root.rb b/lib/bandwidth-sdk/models/bxml/root.rb index 9d32884d..1b1ee9a5 100644 --- a/lib/bandwidth-sdk/models/bxml/root.rb +++ b/lib/bandwidth-sdk/models/bxml/root.rb @@ -5,7 +5,7 @@ module Bxml SPEAK_SENTENCE_REGEX = /(.*?)<\/SpeakSentence>/ SSML_REGEX = /<([a-zA-Z\/\/].*?)>/ - module Root + class Root # Initializer # @param tag [String] Name of the XML element. # @param nested_verbs [Array] XML element children. Defaults to an empty array. diff --git a/lib/bandwidth-sdk/models/bxml/verb.rb b/lib/bandwidth-sdk/models/bxml/verb.rb index 16a3c8eb..f16b9a44 100644 --- a/lib/bandwidth-sdk/models/bxml/verb.rb +++ b/lib/bandwidth-sdk/models/bxml/verb.rb @@ -2,7 +2,7 @@ module Bandwidth module Bxml - module Verb + class Verb # Initializer # @param tag [String] Name of the XML element. # @param content [String] XML element content. Defaults to nil. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb b/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb index 8068ee07..e456404e 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Bridge - include Bandwidth::Bxml::Verb - + class Bridge < Bandwidth::Bxml::Verb # Initializer # @param target_call [String] The callId of the call to be bridged. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/conference.rb b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb index 08333eda..3f38c91a 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/conference.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Conference - include Bandwidth::Bxml::Verb - + class Conference < Bandwidth::Bxml::Verb # Initializer # @param name [String] The name of the conference. Can contain up to 100 characters of letters, numbers, and the symbols -, _, and . # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb b/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb index 46d8f171..caee962f 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class CustomParam - include Bandwidth::Bxml::Verb - + class CustomParam < Bandwidth::Bxml::Verb # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/forward.rb b/lib/bandwidth-sdk/models/bxml/verbs/forward.rb index 18567ab3..5f63110f 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/forward.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/forward.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Forward - include Bandwidth::Bxml::Verb - + class Forward < Bandwidth::Bxml::Verb # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb index d780b310..4fc76458 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Gather - include Bandwidth::Bxml::NestableVerb - + class Gather < Bandwidth::Bxml::NestableVerb # Initializer # @param audio_verbs [Array] XML element children. Defaults to an empty array. Valid nested audio verbs are: SpeakSentence, PlayAudio. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb b/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb index 51325abe..51d50565 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Hangup - include Bandwidth::Bxml::Verb - + class Hangup < Bandwidth::Bxml::Verb # Initializer def initialize super('Hangup', nil, {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/pause.rb b/lib/bandwidth-sdk/models/bxml/verbs/pause.rb index 981aeba4..d41a513d 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/pause.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/pause.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Pause - include Bandwidth::Bxml::Verb - + class Pause < Bandwidth::Bxml::Verb # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb index 8ce4990f..a0e52c2a 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class PauseRecording - include Bandwidth::Bxml::Verb - + class PauseRecording < Bandwidth::Bxml::Verb # Initializer def initialize super('PauseRecording', nil, {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb b/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb index b9f6b49d..db47f2c9 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class PhoneNumber - include Bandwidth::Bxml::Verb - + class PhoneNumber < Bandwidth::Bxml::Verb # Initializer # @param number [String] A phone number to transfer the call to. Value must be in E.164 format (e.g. +15555555555). # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb b/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb index 640fe37b..d178400b 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class PlayAudio - include Bandwidth::Bxml::Verb - + class PlayAudio < Bandwidth::Bxml::Verb # Initializer # @param audio_uri [String] The URL of the audio file to play. May be a relative URL. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/record.rb b/lib/bandwidth-sdk/models/bxml/verbs/record.rb index 86f7b317..c3bbb728 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/record.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/record.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Record - include Bandwidth::Bxml::Verb - + class Record < Bandwidth::Bxml::Verb # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb b/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb index 63c8c958..5b65fdbc 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Redirect - include Bandwidth::Bxml::Verb - + class Redirect < Bandwidth::Bxml::Verb # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb index 9e516865..05eed0fc 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class ResumeRecording - include Bandwidth::Bxml::Verb - + class ResumeRecording < Bandwidth::Bxml::Verb # Initializer def initialize super('ResumeRecording', nil, {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/ring.rb b/lib/bandwidth-sdk/models/bxml/verbs/ring.rb index 0006cf55..67f91ea3 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/ring.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/ring.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Ring - include Bandwidth::Bxml::Verb - + class Ring < Bandwidth::Bxml::Verb # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb b/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb index fdc04c6e..f0e84390 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class SendDtmf - include Bandwidth::Bxml::Verb - + class SendDtmf < Bandwidth::Bxml::Verb # Initializer # @param digits [String] String containing the DTMF characters to be sent in a call. Allows a maximum of 50 characters. The digits will be sent one-by-one with a marginal delay. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb b/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb index 09863a22..6f123a91 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class SipUri - include Bandwidth::Bxml::Verb - + class SipUri < Bandwidth::Bxml::Verb # Initializer # @param uri [String] A SIP URI to transfer the call to (e.g. sip:user@server.com) # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb index 030239df..ff3982ef 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class SpeakSentence - include Bandwidth::Bxml::Verb - + class SpeakSentence < Bandwidth::Bxml::Verb # Initializer # @param text [String] The text to speak. Cannot be blank. Can be a mixture of plain text and SSML tags. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb index b0f17a71..26644574 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class StartGather - include Bandwidth::Bxml::Verb - + class StartGather < Bandwidth::Bxml::Verb # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb index 5e2d14c7..0db4f0c0 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class StartRecording - include Bandwidth::Bxml::Verb - + class StartRecording < Bandwidth::Bxml::Verb # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb index 3b27f3e3..95b444a8 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class StartStream - include Bandwidth::Bxml::NestableVerb - + class StartStream < Bandwidth::Bxml::NestableVerb # Initializer # @param stream_params [Array] XML element children. Defaults to an empty array. Valid nested stream params are: StreamParam. You may specify up to 12 elements nested within a tag. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb index 6b7dfceb..e7661532 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class StartTranscription - include Bandwidth::Bxml::NestableVerb - + class StartTranscription < Bandwidth::Bxml::NestableVerb # Initializer # @param custom_params [Array] XML element children. Defaults to an empty array. Valid nested custom params are: CustomParam. You may specify up to 12 elements nested within a tag. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb index 4442c998..1377846a 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class StopGather - include Bandwidth::Bxml::Verb - + class StopGather < Bandwidth::Bxml::Verb # Initializer def initialize super('StopGather', nil, {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb index a3c78ac4..dfb690ac 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class StopRecording - include Bandwidth::Bxml::Verb - + class StopRecording < Bandwidth::Bxml::Verb # Initializer def initialize super('StopRecording', nil, {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb index 9ba7a0f0..770420ad 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class StopStream - include Bandwidth::Bxml::Verb - + class StopStream < Bandwidth::Bxml::Verb # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb index a2803cfb..59bdc4f0 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class StopTranscription - include Bandwidth::Bxml::Verb - + class StopTranscription < Bandwidth::Bxml::Verb # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb b/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb index a1fd7ea9..5aa0bb0d 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class StreamParam - include Bandwidth::Bxml::Verb - + class StreamParam < Bandwidth::Bxml::Verb # Initializer # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. def initialize(attributes = {}) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/tag.rb b/lib/bandwidth-sdk/models/bxml/verbs/tag.rb index a58c45a0..ec6ca9d0 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/tag.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/tag.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Tag - include Bandwidth::Bxml::Verb - + class Tag < Bandwidth::Bxml::Verb # Initializer # @param content [String] Custom tag value. Defaults to nil. def initialize(content = nil) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb b/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb index 7b94c4e3..ed913dd8 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb @@ -1,8 +1,6 @@ module Bandwidth module Bxml - class Transfer - include Bandwidth::Bxml::NestableVerb - + class Transfer < Bandwidth::Bxml::NestableVerb # Initializer # @param transfer_to [Array] XML element children. Defaults to an empty array. Valid nested transfer verbs are: PhoneNumber, SipUri. # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash. diff --git a/spec/models/bxml/nestable_verb_spec.rb b/spec/models/bxml/nestable_verb_spec.rb index db017139..62e368dc 100644 --- a/spec/models/bxml/nestable_verb_spec.rb +++ b/spec/models/bxml/nestable_verb_spec.rb @@ -1,6 +1,6 @@ # Unit tests for Bandwidth::Bxml::NestableVerb describe 'Bandwidth::Bxml::NestableVerb' do - let(:instance) { Class.new.include(Bandwidth::Bxml::NestableVerb).new('Test') } + let(:instance) { Bandwidth::Bxml::NestableVerb.new('Test') } describe 'test an instance of NestableVerb' do it 'validates instance of NestableVerb' do diff --git a/spec/models/bxml/verb_spec.rb b/spec/models/bxml/verb_spec.rb index caee63cd..bd55289d 100644 --- a/spec/models/bxml/verb_spec.rb +++ b/spec/models/bxml/verb_spec.rb @@ -1,6 +1,6 @@ # Unit tests for Bandwidth::Bxml::Verb describe 'Bandwidth::Bxml::Verb' do - let(:instance) { Class.new.include(Bandwidth::Bxml::Verb).new('Test') } + let(:instance) { Bandwidth::Bxml::Verb.new('Test') } describe 'test an instance of Verb' do it 'validates instance of Verb' do From 43eca927d44b590c4465c87e0399cb3e5f95a5bd Mon Sep 17 00:00:00 2001 From: ckoegel Date: Wed, 19 Jul 2023 11:35:14 -0400 Subject: [PATCH 22/30] fix deploy workflow --- .github/workflows/deploy.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e2683002..e0455763 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -58,12 +58,10 @@ jobs: - name: Deploy to Rubygems run: | mkdir ~/.gem - echo "---\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials + echo "---\n:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}\n" > ~/.gem/credentials chmod 0600 ~/.gem/credentials gem build *.gemspec gem push *.gem -k rubygems - env: - RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} - uses: Bandwidth/build-notify-slack-action@v1.0.0 if: always() From dbe496855c1db77d8ca6aefe2c0d5734b45a9804 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Wed, 19 Jul 2023 11:50:19 -0400 Subject: [PATCH 23/30] please deploy this time --- .github/workflows/deploy.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e0455763..cceafda1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -58,10 +58,11 @@ jobs: - name: Deploy to Rubygems run: | mkdir ~/.gem - echo "---\n:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}\n" > ~/.gem/credentials + touch ~/.gem/credentials chmod 0600 ~/.gem/credentials + printf -- "---\n:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}\n" > ~/.gem/credentials gem build *.gemspec - gem push *.gem -k rubygems + gem push *.gem - uses: Bandwidth/build-notify-slack-action@v1.0.0 if: always() From 68f60899f45568eacc906fe74883713b809c4430 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Wed, 26 Jul 2023 10:32:06 -0400 Subject: [PATCH 24/30] SWI-3149 Update to Generator Version 7.0.0 (#107) * SWI-3149 Update to Generator Version 7.0.0 * update tests * fix tests again --- .openapi-generator/VERSION | 2 +- bandwidth-sdk.gemspec | 2 +- lib/bandwidth-sdk.rb | 2 +- lib/bandwidth-sdk/api/calls_api.rb | 2 +- lib/bandwidth-sdk/api/conferences_api.rb | 2 +- lib/bandwidth-sdk/api/media_api.rb | 2 +- lib/bandwidth-sdk/api/messages_api.rb | 2 +- lib/bandwidth-sdk/api/mfa_api.rb | 2 +- .../api/phone_number_lookup_api.rb | 2 +- lib/bandwidth-sdk/api/recordings_api.rb | 2 +- lib/bandwidth-sdk/api/statistics_api.rb | 2 +- lib/bandwidth-sdk/api_client.rb | 2 +- lib/bandwidth-sdk/api_error.rb | 2 +- lib/bandwidth-sdk/configuration.rb | 18 ++++--- .../models/account_statistics.rb | 31 +++++------ lib/bandwidth-sdk/models/answer_callback.rb | 31 +++++------ .../models/bridge_complete_callback.rb | 31 +++++------ .../models/bridge_target_complete_callback.rb | 31 +++++------ .../models/call_direction_enum.rb | 2 +- .../models/call_recording_metadata.rb | 31 +++++------ lib/bandwidth-sdk/models/call_state.rb | 31 +++++------ lib/bandwidth-sdk/models/call_state_enum.rb | 2 +- .../models/callback_method_enum.rb | 2 +- lib/bandwidth-sdk/models/code_request.rb | 47 +++++++++------- lib/bandwidth-sdk/models/conference.rb | 31 +++++------ .../models/conference_completed_callback.rb | 31 +++++------ .../models/conference_created_callback.rb | 31 +++++------ lib/bandwidth-sdk/models/conference_member.rb | 31 +++++------ .../models/conference_member_exit_callback.rb | 31 +++++------ .../models/conference_member_join_callback.rb | 31 +++++------ ...conference_recording_available_callback.rb | 31 +++++------ .../models/conference_recording_metadata.rb | 31 +++++------ .../models/conference_redirect_callback.rb | 31 +++++------ .../models/conference_state_enum.rb | 2 +- lib/bandwidth-sdk/models/create_call.rb | 39 +++++++------- .../models/create_call_response.rb | 45 +++++++++------- .../models/create_lookup_response.rb | 31 +++++------ .../models/create_message_request_error.rb | 35 ++++++------ lib/bandwidth-sdk/models/deferred_result.rb | 31 +++++------ .../models/disconnect_callback.rb | 31 +++++------ lib/bandwidth-sdk/models/diversion.rb | 31 +++++------ lib/bandwidth-sdk/models/dtmf_callback.rb | 31 +++++------ lib/bandwidth-sdk/models/field_error.rb | 31 +++++------ lib/bandwidth-sdk/models/file_format_enum.rb | 2 +- lib/bandwidth-sdk/models/gather_callback.rb | 31 +++++------ .../models/inbound_message_callback.rb | 41 +++++++------- .../inbound_message_callback_message.rb | 49 ++++++++++------- lib/bandwidth-sdk/models/initiate_callback.rb | 31 +++++------ .../models/list_message_direction_enum.rb | 2 +- lib/bandwidth-sdk/models/list_message_item.rb | 31 +++++------ lib/bandwidth-sdk/models/lookup_request.rb | 33 ++++++------ lib/bandwidth-sdk/models/lookup_result.rb | 31 +++++------ lib/bandwidth-sdk/models/lookup_status.rb | 31 +++++------ .../models/lookup_status_enum.rb | 2 +- .../machine_detection_complete_callback.rb | 31 +++++------ .../models/machine_detection_configuration.rb | 31 +++++------ .../models/machine_detection_mode_enum.rb | 2 +- .../models/machine_detection_result.rb | 31 +++++------ lib/bandwidth-sdk/models/media.rb | 31 +++++------ lib/bandwidth-sdk/models/message.rb | 39 +++++++------- .../models/message_delivered_callback.rb | 41 +++++++------- .../message_delivered_callback_message.rb | 51 +++++++++++------- .../models/message_direction_enum.rb | 2 +- .../models/message_failed_callback.rb | 43 ++++++++------- .../models/message_failed_callback_message.rb | 53 ++++++++++++------- lib/bandwidth-sdk/models/message_request.rb | 43 ++++++++------- .../models/message_sending_callback.rb | 41 +++++++------- .../message_sending_callback_message.rb | 53 ++++++++++++------- .../models/message_status_enum.rb | 2 +- lib/bandwidth-sdk/models/message_type_enum.rb | 2 +- lib/bandwidth-sdk/models/messages_list.rb | 31 +++++------ .../models/messaging_code_response.rb | 31 +++++------ .../models/messaging_request_error.rb | 35 ++++++------ .../models/mfa_forbidden_request_error.rb | 31 +++++------ lib/bandwidth-sdk/models/mfa_request_error.rb | 31 +++++------ .../models/mfa_unauthorized_request_error.rb | 31 +++++------ lib/bandwidth-sdk/models/page_info.rb | 31 +++++------ lib/bandwidth-sdk/models/priority_enum.rb | 2 +- .../models/recording_available_callback.rb | 31 +++++------ .../models/recording_complete_callback.rb | 31 +++++------ .../models/recording_state_enum.rb | 2 +- lib/bandwidth-sdk/models/redirect_callback.rb | 31 +++++------ .../models/redirect_method_enum.rb | 2 +- lib/bandwidth-sdk/models/stir_shaken.rb | 31 +++++------ lib/bandwidth-sdk/models/tag.rb | 31 +++++------ .../models/tn_lookup_request_error.rb | 31 +++++------ .../models/transcribe_recording.rb | 31 +++++------ lib/bandwidth-sdk/models/transcription.rb | 31 +++++------ .../transcription_available_callback.rb | 31 +++++------ .../models/transcription_list.rb | 31 +++++------ .../models/transcription_metadata.rb | 31 +++++------ .../models/transfer_answer_callback.rb | 31 +++++------ .../models/transfer_complete_callback.rb | 31 +++++------ .../models/transfer_disconnect_callback.rb | 31 +++++------ lib/bandwidth-sdk/models/update_call.rb | 31 +++++------ .../models/update_call_recording.rb | 33 ++++++------ lib/bandwidth-sdk/models/update_conference.rb | 31 +++++------ .../models/update_conference_member.rb | 31 +++++------ .../models/verify_code_request.rb | 37 ++++++------- .../models/verify_code_response.rb | 31 +++++------ lib/bandwidth-sdk/models/voice_api_error.rb | 31 +++++------ .../models/voice_code_response.rb | 31 +++++------ lib/bandwidth-sdk/version.rb | 2 +- spec/api_client_spec.rb | 2 +- spec/configuration_spec.rb | 26 ++++++--- spec/models/call_state_spec.rb | 13 ----- spec/models/deferred_result_spec.rb | 15 +----- spec/models/message_spec.rb | 27 ++++------ spec/models/verify_code_request_spec.rb | 22 +++----- 109 files changed, 1236 insertions(+), 1437 deletions(-) diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 4be2c727..757e6740 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.5.0 \ No newline at end of file +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/bandwidth-sdk.gemspec b/bandwidth-sdk.gemspec index 4113fb03..74e8c475 100644 --- a/bandwidth-sdk.gemspec +++ b/bandwidth-sdk.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index e2b3caf6..27b6a9af 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/calls_api.rb b/lib/bandwidth-sdk/api/calls_api.rb index d9c5e439..b765186b 100644 --- a/lib/bandwidth-sdk/api/calls_api.rb +++ b/lib/bandwidth-sdk/api/calls_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/conferences_api.rb b/lib/bandwidth-sdk/api/conferences_api.rb index 6f396982..68f18f51 100644 --- a/lib/bandwidth-sdk/api/conferences_api.rb +++ b/lib/bandwidth-sdk/api/conferences_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/media_api.rb b/lib/bandwidth-sdk/api/media_api.rb index f7a698cb..52773ccf 100644 --- a/lib/bandwidth-sdk/api/media_api.rb +++ b/lib/bandwidth-sdk/api/media_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb index 61f2f3bc..b4d87cfd 100644 --- a/lib/bandwidth-sdk/api/messages_api.rb +++ b/lib/bandwidth-sdk/api/messages_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/mfa_api.rb b/lib/bandwidth-sdk/api/mfa_api.rb index b274830f..723d7699 100644 --- a/lib/bandwidth-sdk/api/mfa_api.rb +++ b/lib/bandwidth-sdk/api/mfa_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb index a7cdc355..b6f9d8d3 100644 --- a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +++ b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/recordings_api.rb b/lib/bandwidth-sdk/api/recordings_api.rb index bbce395a..3f1896da 100644 --- a/lib/bandwidth-sdk/api/recordings_api.rb +++ b/lib/bandwidth-sdk/api/recordings_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api/statistics_api.rb b/lib/bandwidth-sdk/api/statistics_api.rb index a74d64e1..6ed63282 100644 --- a/lib/bandwidth-sdk/api/statistics_api.rb +++ b/lib/bandwidth-sdk/api/statistics_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api_client.rb b/lib/bandwidth-sdk/api_client.rb index 374eaaa9..c662ea3c 100644 --- a/lib/bandwidth-sdk/api_client.rb +++ b/lib/bandwidth-sdk/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/api_error.rb b/lib/bandwidth-sdk/api_error.rb index 0d976daf..ae853593 100644 --- a/lib/bandwidth-sdk/api_error.rb +++ b/lib/bandwidth-sdk/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/configuration.rb b/lib/bandwidth-sdk/configuration.rb index 5130c52e..54a949b5 100644 --- a/lib/bandwidth-sdk/configuration.rb +++ b/lib/bandwidth-sdk/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -151,7 +151,7 @@ def initialize @scheme = 'http' @host = 'localhost' @base_path = '' - @server_index = 0 + @server_index = nil @server_operation_index = {} @server_variables = {} @server_operation_variables = {} @@ -204,10 +204,12 @@ def base_path=(base_path) # Returns base URL for specified operation based on server settings def base_url(operation = nil) - index = server_operation_index.fetch(operation, server_index) - return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil - - server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) + if operation_server_settings.key?(operation) then + index = server_operation_index.fetch(operation, server_index) + server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) + else + server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil) + end end # Gets API key (with prefix if set). @@ -479,8 +481,8 @@ def server_url(index, variables = {}, servers = nil) servers = server_settings if servers == nil # check array index out of bound - if (index < 0 || index >= servers.size) - fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" + if (index.nil? || index < 0 || index >= servers.size) + fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}" end server = servers[index] diff --git a/lib/bandwidth-sdk/models/account_statistics.rb b/lib/bandwidth-sdk/models/account_statistics.rb index d0a984b6..5c12bf9a 100644 --- a/lib/bandwidth-sdk/models/account_statistics.rb +++ b/lib/bandwidth-sdk/models/account_statistics.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -75,6 +75,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -82,6 +83,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -110,37 +112,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/answer_callback.rb b/lib/bandwidth-sdk/models/answer_callback.rb index 15a7ea15..5250e0e8 100644 --- a/lib/bandwidth-sdk/models/answer_callback.rb +++ b/lib/bandwidth-sdk/models/answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -208,6 +208,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -215,6 +216,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -255,37 +257,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/bridge_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_complete_callback.rb index d22cd347..547b5f94 100644 --- a/lib/bandwidth-sdk/models/bridge_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -228,6 +228,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -235,6 +236,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -277,37 +279,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb index 4f2aa82d..d5c41045 100644 --- a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -199,6 +199,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -206,6 +207,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -245,37 +247,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/call_direction_enum.rb b/lib/bandwidth-sdk/models/call_direction_enum.rb index 05694dc8..606582dc 100644 --- a/lib/bandwidth-sdk/models/call_direction_enum.rb +++ b/lib/bandwidth-sdk/models/call_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/call_recording_metadata.rb b/lib/bandwidth-sdk/models/call_recording_metadata.rb index 6dbb56a0..8b51da7f 100644 --- a/lib/bandwidth-sdk/models/call_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/call_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -240,6 +240,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -247,6 +248,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -291,37 +293,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/call_state.rb b/lib/bandwidth-sdk/models/call_state.rb index efe8db13..fe4d8da6 100644 --- a/lib/bandwidth-sdk/models/call_state.rb +++ b/lib/bandwidth-sdk/models/call_state.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -252,6 +252,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -259,6 +260,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -303,37 +305,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/call_state_enum.rb b/lib/bandwidth-sdk/models/call_state_enum.rb index 3972a42e..5177106d 100644 --- a/lib/bandwidth-sdk/models/call_state_enum.rb +++ b/lib/bandwidth-sdk/models/call_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/callback_method_enum.rb b/lib/bandwidth-sdk/models/callback_method_enum.rb index 5f6e1fd9..dee2fbb5 100644 --- a/lib/bandwidth-sdk/models/callback_method_enum.rb +++ b/lib/bandwidth-sdk/models/callback_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/code_request.rb b/lib/bandwidth-sdk/models/code_request.rb index aac1f586..8ae74b57 100644 --- a/lib/bandwidth-sdk/models/code_request.rb +++ b/lib/bandwidth-sdk/models/code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -85,14 +85,20 @@ def initialize(attributes = {}) if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'scope') @@ -101,16 +107,21 @@ def initialize(attributes = {}) if attributes.key?(:'message') self.message = attributes[:'message'] + else + self.message = nil end if attributes.key?(:'digits') self.digits = attributes[:'digits'] + else + self.digits = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @to.nil? invalid_properties.push('invalid value for "to", to cannot be nil.') @@ -172,6 +183,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @to.nil? return false if @to !~ Regexp.new(/^\+[1-9]\d{1,14}$/) return false if @from.nil? @@ -239,7 +251,11 @@ def application_id=(application_id) # Custom attribute writer method with validation # @param [Object] scope Value to be assigned def scope=(scope) - if !scope.nil? && scope.to_s.length > 25 + if scope.nil? + fail ArgumentError, 'scope cannot be nil' + end + + if scope.to_s.length > 25 fail ArgumentError, 'invalid value for "scope", the character length must be smaller than or equal to 25.' end @@ -307,37 +323,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference.rb b/lib/bandwidth-sdk/models/conference.rb index 4730f092..e8b908b2 100644 --- a/lib/bandwidth-sdk/models/conference.rb +++ b/lib/bandwidth-sdk/models/conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -159,6 +159,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -166,6 +167,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -200,37 +202,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_completed_callback.rb b/lib/bandwidth-sdk/models/conference_completed_callback.rb index c5b52d8e..b5e202fc 100644 --- a/lib/bandwidth-sdk/models/conference_completed_callback.rb +++ b/lib/bandwidth-sdk/models/conference_completed_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -104,6 +104,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -111,6 +112,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -142,37 +144,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_created_callback.rb b/lib/bandwidth-sdk/models/conference_created_callback.rb index 599acd96..cf684c87 100644 --- a/lib/bandwidth-sdk/models/conference_created_callback.rb +++ b/lib/bandwidth-sdk/models/conference_created_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -104,6 +104,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -111,6 +112,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -142,37 +144,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_member.rb b/lib/bandwidth-sdk/models/conference_member.rb index b57a684b..f12acfbd 100644 --- a/lib/bandwidth-sdk/models/conference_member.rb +++ b/lib/bandwidth-sdk/models/conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -114,6 +114,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -121,6 +122,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -153,37 +155,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb index 2481d04b..416cfd9d 100644 --- a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -131,6 +131,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -138,6 +139,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -172,37 +174,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_member_join_callback.rb b/lib/bandwidth-sdk/models/conference_member_join_callback.rb index 93ed79ed..f1b5f089 100644 --- a/lib/bandwidth-sdk/models/conference_member_join_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_join_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -131,6 +131,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -138,6 +139,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -172,37 +174,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb index f98d1fe4..edac9e57 100644 --- a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -207,6 +207,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -214,6 +215,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -254,37 +256,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_recording_metadata.rb b/lib/bandwidth-sdk/models/conference_recording_metadata.rb index 1db9827d..6035e5f8 100644 --- a/lib/bandwidth-sdk/models/conference_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/conference_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -178,6 +178,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -185,6 +186,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -222,37 +224,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_redirect_callback.rb b/lib/bandwidth-sdk/models/conference_redirect_callback.rb index 3611a0fb..f9af8846 100644 --- a/lib/bandwidth-sdk/models/conference_redirect_callback.rb +++ b/lib/bandwidth-sdk/models/conference_redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -104,6 +104,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -111,6 +112,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -142,37 +144,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/conference_state_enum.rb b/lib/bandwidth-sdk/models/conference_state_enum.rb index 56b59be3..06f1534b 100644 --- a/lib/bandwidth-sdk/models/conference_state_enum.rb +++ b/lib/bandwidth-sdk/models/conference_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/create_call.rb b/lib/bandwidth-sdk/models/create_call.rb index b729affd..dd1128de 100644 --- a/lib/bandwidth-sdk/models/create_call.rb +++ b/lib/bandwidth-sdk/models/create_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -182,10 +182,14 @@ def initialize(attributes = {}) if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'uui') @@ -194,10 +198,14 @@ def initialize(attributes = {}) if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'answer_url') self.answer_url = attributes[:'answer_url'] + else + self.answer_url = nil end if attributes.key?(:'answer_method') @@ -272,6 +280,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @to.nil? invalid_properties.push('invalid value for "to", to cannot be nil.') @@ -351,6 +360,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @to.nil? return false if @from.nil? return false if @application_id.nil? @@ -540,37 +550,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/create_call_response.rb b/lib/bandwidth-sdk/models/create_call_response.rb index 47ad1957..e91fecef 100644 --- a/lib/bandwidth-sdk/models/create_call_response.rb +++ b/lib/bandwidth-sdk/models/create_call_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -191,22 +191,32 @@ def initialize(attributes = {}) if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'account_id') self.account_id = attributes[:'account_id'] + else + self.account_id = nil end if attributes.key?(:'call_id') self.call_id = attributes[:'call_id'] + else + self.call_id = nil end if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'enqueued_time') @@ -215,6 +225,8 @@ def initialize(attributes = {}) if attributes.key?(:'call_url') self.call_url = attributes[:'call_url'] + else + self.call_url = nil end if attributes.key?(:'call_timeout') @@ -237,6 +249,8 @@ def initialize(attributes = {}) if attributes.key?(:'answer_url') self.answer_url = attributes[:'answer_url'] + else + self.answer_url = nil end if attributes.key?(:'answer_fallback_method') @@ -283,6 +297,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @application_id.nil? invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') @@ -334,6 +349,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @application_id.nil? return false if @account_id.nil? return false if @call_id.nil? @@ -432,37 +448,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/create_lookup_response.rb b/lib/bandwidth-sdk/models/create_lookup_response.rb index c1afe401..0b502a91 100644 --- a/lib/bandwidth-sdk/models/create_lookup_response.rb +++ b/lib/bandwidth-sdk/models/create_lookup_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -97,6 +97,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -104,6 +105,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -132,37 +134,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/create_message_request_error.rb b/lib/bandwidth-sdk/models/create_message_request_error.rb index db466f5a..081214f4 100644 --- a/lib/bandwidth-sdk/models/create_message_request_error.rb +++ b/lib/bandwidth-sdk/models/create_message_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -67,10 +67,14 @@ def initialize(attributes = {}) if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end if attributes.key?(:'field_errors') @@ -83,6 +87,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') @@ -98,6 +103,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @type.nil? return false if @description.nil? true @@ -129,37 +135,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/deferred_result.rb b/lib/bandwidth-sdk/models/deferred_result.rb index 39f7e9a0..6c667d76 100644 --- a/lib/bandwidth-sdk/models/deferred_result.rb +++ b/lib/bandwidth-sdk/models/deferred_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -73,6 +73,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -80,6 +81,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -108,37 +110,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/disconnect_callback.rb b/lib/bandwidth-sdk/models/disconnect_callback.rb index 72ff8110..192b6e6c 100644 --- a/lib/bandwidth-sdk/models/disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/disconnect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -237,6 +237,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -244,6 +245,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -287,37 +289,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/diversion.rb b/lib/bandwidth-sdk/models/diversion.rb index 5b475591..12b914e2 100644 --- a/lib/bandwidth-sdk/models/diversion.rb +++ b/lib/bandwidth-sdk/models/diversion.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -120,6 +120,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -127,6 +128,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -160,37 +162,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/dtmf_callback.rb b/lib/bandwidth-sdk/models/dtmf_callback.rb index 9454c09e..a67a2fbe 100644 --- a/lib/bandwidth-sdk/models/dtmf_callback.rb +++ b/lib/bandwidth-sdk/models/dtmf_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -235,6 +235,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -242,6 +243,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -285,37 +287,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/field_error.rb b/lib/bandwidth-sdk/models/field_error.rb index dfc3448c..a9c2ec36 100644 --- a/lib/bandwidth-sdk/models/field_error.rb +++ b/lib/bandwidth-sdk/models/field_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -75,6 +75,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -82,6 +83,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -110,37 +112,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/file_format_enum.rb b/lib/bandwidth-sdk/models/file_format_enum.rb index 3cb74bdb..7941e020 100644 --- a/lib/bandwidth-sdk/models/file_format_enum.rb +++ b/lib/bandwidth-sdk/models/file_format_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/gather_callback.rb b/lib/bandwidth-sdk/models/gather_callback.rb index af79fd01..7006ab02 100644 --- a/lib/bandwidth-sdk/models/gather_callback.rb +++ b/lib/bandwidth-sdk/models/gather_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -244,6 +244,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -251,6 +252,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -295,37 +297,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/inbound_message_callback.rb b/lib/bandwidth-sdk/models/inbound_message_callback.rb index 4b94c7a2..3d15b616 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -76,28 +76,39 @@ def initialize(attributes = {}) if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end if attributes.key?(:'message') self.message = attributes[:'message'] + else + self.message = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @time.nil? invalid_properties.push('invalid value for "time", time cannot be nil.') @@ -125,6 +136,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @time.nil? return false if @type.nil? return false if @to.nil? @@ -161,37 +173,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb index a90f2eb7..12fec95c 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -126,40 +126,58 @@ def initialize(attributes = {}) if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'owner') self.owner = attributes[:'owner'] + else + self.owner = nil end if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'segment_count') self.segment_count = attributes[:'segment_count'] + else + self.segment_count = nil end if attributes.key?(:'direction') self.direction = attributes[:'direction'] + else + self.direction = nil end if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'text') self.text = attributes[:'text'] + else + self.text = nil end if attributes.key?(:'tag') @@ -180,6 +198,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') @@ -223,6 +242,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @owner.nil? return false if @application_id.nil? @@ -280,37 +300,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/initiate_callback.rb b/lib/bandwidth-sdk/models/initiate_callback.rb index 1134e1f9..cb32b374 100644 --- a/lib/bandwidth-sdk/models/initiate_callback.rb +++ b/lib/bandwidth-sdk/models/initiate_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -185,6 +185,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -192,6 +193,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -230,37 +232,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/list_message_direction_enum.rb b/lib/bandwidth-sdk/models/list_message_direction_enum.rb index 93c5348e..07a2d72b 100644 --- a/lib/bandwidth-sdk/models/list_message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/list_message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/list_message_item.rb b/lib/bandwidth-sdk/models/list_message_item.rb index 832ad537..ea9da05e 100644 --- a/lib/bandwidth-sdk/models/list_message_item.rb +++ b/lib/bandwidth-sdk/models/list_message_item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -235,6 +235,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -242,6 +243,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -285,37 +287,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/lookup_request.rb b/lib/bandwidth-sdk/models/lookup_request.rb index e8128566..e5a96dec 100644 --- a/lib/bandwidth-sdk/models/lookup_request.rb +++ b/lib/bandwidth-sdk/models/lookup_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -62,12 +62,15 @@ def initialize(attributes = {}) if (value = attributes[:'tns']).is_a?(Array) self.tns = value end + else + self.tns = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @tns.nil? invalid_properties.push('invalid value for "tns", tns cannot be nil.') @@ -79,6 +82,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @tns.nil? true end @@ -107,37 +111,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/lookup_result.rb b/lib/bandwidth-sdk/models/lookup_result.rb index 22108bc3..b09c2126 100644 --- a/lib/bandwidth-sdk/models/lookup_result.rb +++ b/lib/bandwidth-sdk/models/lookup_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -139,6 +139,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -146,6 +147,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -181,37 +183,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/lookup_status.rb b/lib/bandwidth-sdk/models/lookup_status.rb index 8962f4cc..39d022ed 100644 --- a/lib/bandwidth-sdk/models/lookup_status.rb +++ b/lib/bandwidth-sdk/models/lookup_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -119,6 +119,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -126,6 +127,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -156,37 +158,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/lookup_status_enum.rb b/lib/bandwidth-sdk/models/lookup_status_enum.rb index 145152e1..7c10f914 100644 --- a/lib/bandwidth-sdk/models/lookup_status_enum.rb +++ b/lib/bandwidth-sdk/models/lookup_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb index de7dd399..236f33c9 100644 --- a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +++ b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -208,6 +208,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -215,6 +216,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -255,37 +257,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/machine_detection_configuration.rb b/lib/bandwidth-sdk/models/machine_detection_configuration.rb index 37e1bba3..d0e7b5d1 100644 --- a/lib/bandwidth-sdk/models/machine_detection_configuration.rb +++ b/lib/bandwidth-sdk/models/machine_detection_configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -242,6 +242,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@callback_url.nil? && @callback_url.to_s.length > 2048 invalid_properties.push('invalid value for "callback_url", the character length must be smaller than or equal to 2048.') @@ -273,6 +274,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@callback_url.nil? && @callback_url.to_s.length > 2048 return false if !@username.nil? && @username.to_s.length > 1024 return false if !@password.nil? && @password.to_s.length > 1024 @@ -380,37 +382,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb index 69191f24..f2ba8431 100644 --- a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +++ b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/machine_detection_result.rb b/lib/bandwidth-sdk/models/machine_detection_result.rb index f6bb40b2..acc9bfae 100644 --- a/lib/bandwidth-sdk/models/machine_detection_result.rb +++ b/lib/bandwidth-sdk/models/machine_detection_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -76,6 +76,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -83,6 +84,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -111,37 +113,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/media.rb b/lib/bandwidth-sdk/models/media.rb index 5002324e..7d658874 100644 --- a/lib/bandwidth-sdk/models/media.rb +++ b/lib/bandwidth-sdk/models/media.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -81,6 +81,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -88,6 +89,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -117,37 +119,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message.rb b/lib/bandwidth-sdk/models/message.rb index 01a5436c..5463b7ee 100644 --- a/lib/bandwidth-sdk/models/message.rb +++ b/lib/bandwidth-sdk/models/message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -198,6 +198,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -205,18 +206,27 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end # Custom attribute writer method with validation # @param [Object] to Value to be assigned def to=(to) + if to.nil? + fail ArgumentError, 'to cannot be nil' + end + @to = to end # Custom attribute writer method with validation # @param [Object] media Value to be assigned def media=(media) + if media.nil? + fail ArgumentError, 'media cannot be nil' + end + @media = media end @@ -256,37 +266,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_delivered_callback.rb b/lib/bandwidth-sdk/models/message_delivered_callback.rb index 87ef6c72..69e74004 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -76,28 +76,39 @@ def initialize(attributes = {}) if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end if attributes.key?(:'message') self.message = attributes[:'message'] + else + self.message = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @time.nil? invalid_properties.push('invalid value for "time", time cannot be nil.') @@ -125,6 +136,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @time.nil? return false if @type.nil? return false if @to.nil? @@ -161,37 +173,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb index 5ca0b7fe..ed0a91ad 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -126,44 +126,64 @@ def initialize(attributes = {}) if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'owner') self.owner = attributes[:'owner'] + else + self.owner = nil end if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'segment_count') self.segment_count = attributes[:'segment_count'] + else + self.segment_count = nil end if attributes.key?(:'direction') self.direction = attributes[:'direction'] + else + self.direction = nil end if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'text') self.text = attributes[:'text'] + else + self.text = nil end if attributes.key?(:'tag') self.tag = attributes[:'tag'] + else + self.tag = nil end if attributes.key?(:'media') @@ -180,6 +200,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') @@ -227,6 +248,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @owner.nil? return false if @application_id.nil? @@ -285,37 +307,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_direction_enum.rb b/lib/bandwidth-sdk/models/message_direction_enum.rb index 993da1ac..45b72c4b 100644 --- a/lib/bandwidth-sdk/models/message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/message_failed_callback.rb b/lib/bandwidth-sdk/models/message_failed_callback.rb index 8e1620b1..855464d4 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -80,32 +80,45 @@ def initialize(attributes = {}) if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end if attributes.key?(:'message') self.message = attributes[:'message'] + else + self.message = nil end if attributes.key?(:'error_code') self.error_code = attributes[:'error_code'] + else + self.error_code = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @time.nil? invalid_properties.push('invalid value for "time", time cannot be nil.') @@ -137,6 +150,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @time.nil? return false if @type.nil? return false if @to.nil? @@ -175,37 +189,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_failed_callback_message.rb b/lib/bandwidth-sdk/models/message_failed_callback_message.rb index 579b1e48..b7811538 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -126,44 +126,64 @@ def initialize(attributes = {}) if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'owner') self.owner = attributes[:'owner'] + else + self.owner = nil end if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'segment_count') self.segment_count = attributes[:'segment_count'] + else + self.segment_count = nil end if attributes.key?(:'direction') self.direction = attributes[:'direction'] + else + self.direction = nil end if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'text') self.text = attributes[:'text'] + else + self.text = nil end if attributes.key?(:'tag') self.tag = attributes[:'tag'] + else + self.tag = nil end if attributes.key?(:'media') @@ -174,12 +194,15 @@ def initialize(attributes = {}) if attributes.key?(:'priority') self.priority = attributes[:'priority'] + else + self.priority = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') @@ -231,6 +254,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @owner.nil? return false if @application_id.nil? @@ -290,37 +314,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_request.rb b/lib/bandwidth-sdk/models/message_request.rb index 6be9d8eb..c204be9e 100644 --- a/lib/bandwidth-sdk/models/message_request.rb +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -116,16 +116,22 @@ def initialize(attributes = {}) if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'text') @@ -154,6 +160,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @application_id.nil? invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') @@ -177,6 +184,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @application_id.nil? return false if @to.nil? return false if @from.nil? @@ -197,7 +205,11 @@ def to=(to) # Custom attribute writer method with validation # @param [Object] text Value to be assigned def text=(text) - if !text.nil? && text.to_s.length > 2048 + if text.nil? + fail ArgumentError, 'text cannot be nil' + end + + if text.to_s.length > 2048 fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 2048.' end @@ -235,37 +247,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_sending_callback.rb b/lib/bandwidth-sdk/models/message_sending_callback.rb index 6123c2f2..2fb923d2 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -76,28 +76,39 @@ def initialize(attributes = {}) if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end if attributes.key?(:'message') self.message = attributes[:'message'] + else + self.message = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @time.nil? invalid_properties.push('invalid value for "time", time cannot be nil.') @@ -125,6 +136,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @time.nil? return false if @type.nil? return false if @to.nil? @@ -161,37 +173,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_sending_callback_message.rb b/lib/bandwidth-sdk/models/message_sending_callback_message.rb index 5e132032..74526012 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -126,40 +126,58 @@ def initialize(attributes = {}) if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'owner') self.owner = attributes[:'owner'] + else + self.owner = nil end if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] + else + self.application_id = nil end if attributes.key?(:'time') self.time = attributes[:'time'] + else + self.time = nil end if attributes.key?(:'segment_count') self.segment_count = attributes[:'segment_count'] + else + self.segment_count = nil end if attributes.key?(:'direction') self.direction = attributes[:'direction'] + else + self.direction = nil end if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end + else + self.to = nil end if attributes.key?(:'from') self.from = attributes[:'from'] + else + self.from = nil end if attributes.key?(:'text') self.text = attributes[:'text'] + else + self.text = nil end if attributes.key?(:'tag') @@ -170,16 +188,21 @@ def initialize(attributes = {}) if (value = attributes[:'media']).is_a?(Array) self.media = value end + else + self.media = nil end if attributes.key?(:'priority') self.priority = attributes[:'priority'] + else + self.priority = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') @@ -231,6 +254,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @owner.nil? return false if @application_id.nil? @@ -290,37 +314,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/message_status_enum.rb b/lib/bandwidth-sdk/models/message_status_enum.rb index e30fb931..1762e105 100644 --- a/lib/bandwidth-sdk/models/message_status_enum.rb +++ b/lib/bandwidth-sdk/models/message_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/message_type_enum.rb b/lib/bandwidth-sdk/models/message_type_enum.rb index 5250d3aa..3418b2a0 100644 --- a/lib/bandwidth-sdk/models/message_type_enum.rb +++ b/lib/bandwidth-sdk/models/message_type_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/messages_list.rb b/lib/bandwidth-sdk/models/messages_list.rb index 613369bf..5baa2cf1 100644 --- a/lib/bandwidth-sdk/models/messages_list.rb +++ b/lib/bandwidth-sdk/models/messages_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -84,6 +84,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -91,6 +92,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -120,37 +122,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/messaging_code_response.rb b/lib/bandwidth-sdk/models/messaging_code_response.rb index c155752e..db230699 100644 --- a/lib/bandwidth-sdk/models/messaging_code_response.rb +++ b/lib/bandwidth-sdk/models/messaging_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/messaging_request_error.rb b/lib/bandwidth-sdk/models/messaging_request_error.rb index 634d822f..18172206 100644 --- a/lib/bandwidth-sdk/models/messaging_request_error.rb +++ b/lib/bandwidth-sdk/models/messaging_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -63,16 +63,21 @@ def initialize(attributes = {}) if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') @@ -88,6 +93,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @type.nil? return false if @description.nil? true @@ -118,37 +124,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb index 4ab2469e..d8cb5463 100644 --- a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/mfa_request_error.rb b/lib/bandwidth-sdk/models/mfa_request_error.rb index 163f5d13..d809f1dd 100644 --- a/lib/bandwidth-sdk/models/mfa_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -75,6 +75,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -82,6 +83,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -110,37 +112,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb index 78ab188e..3e926bdf 100644 --- a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/page_info.rb b/lib/bandwidth-sdk/models/page_info.rb index c705492b..ba0d2b4e 100644 --- a/lib/bandwidth-sdk/models/page_info.rb +++ b/lib/bandwidth-sdk/models/page_info.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -93,6 +93,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -100,6 +101,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -130,37 +132,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/priority_enum.rb b/lib/bandwidth-sdk/models/priority_enum.rb index 0bf5aa30..e28c54cc 100644 --- a/lib/bandwidth-sdk/models/priority_enum.rb +++ b/lib/bandwidth-sdk/models/priority_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/recording_available_callback.rb b/lib/bandwidth-sdk/models/recording_available_callback.rb index a964f677..1ad492f9 100644 --- a/lib/bandwidth-sdk/models/recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -279,6 +279,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -286,6 +287,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -334,37 +336,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/recording_complete_callback.rb b/lib/bandwidth-sdk/models/recording_complete_callback.rb index cf13042d..8414189c 100644 --- a/lib/bandwidth-sdk/models/recording_complete_callback.rb +++ b/lib/bandwidth-sdk/models/recording_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -280,6 +280,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -287,6 +288,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -335,37 +337,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/recording_state_enum.rb b/lib/bandwidth-sdk/models/recording_state_enum.rb index b4fcdc2d..6950cca6 100644 --- a/lib/bandwidth-sdk/models/recording_state_enum.rb +++ b/lib/bandwidth-sdk/models/recording_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/redirect_callback.rb b/lib/bandwidth-sdk/models/redirect_callback.rb index 0f0dfcec..a91b7ecb 100644 --- a/lib/bandwidth-sdk/models/redirect_callback.rb +++ b/lib/bandwidth-sdk/models/redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -226,6 +226,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -233,6 +234,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -275,37 +277,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/redirect_method_enum.rb b/lib/bandwidth-sdk/models/redirect_method_enum.rb index 9399170c..901afb20 100644 --- a/lib/bandwidth-sdk/models/redirect_method_enum.rb +++ b/lib/bandwidth-sdk/models/redirect_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/lib/bandwidth-sdk/models/stir_shaken.rb b/lib/bandwidth-sdk/models/stir_shaken.rb index 33beb330..909e6f29 100644 --- a/lib/bandwidth-sdk/models/stir_shaken.rb +++ b/lib/bandwidth-sdk/models/stir_shaken.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -84,6 +84,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -91,6 +92,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -120,37 +122,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/tag.rb b/lib/bandwidth-sdk/models/tag.rb index 4bfe0c70..c77c90d5 100644 --- a/lib/bandwidth-sdk/models/tag.rb +++ b/lib/bandwidth-sdk/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -73,6 +73,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -80,6 +81,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -108,37 +110,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb index 07eda0b5..c847b9ed 100644 --- a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +++ b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transcribe_recording.rb b/lib/bandwidth-sdk/models/transcribe_recording.rb index e59bfc62..babafd2e 100644 --- a/lib/bandwidth-sdk/models/transcribe_recording.rb +++ b/lib/bandwidth-sdk/models/transcribe_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -153,6 +153,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@username.nil? && @username.to_s.length > 1024 invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') @@ -176,6 +177,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@username.nil? && @username.to_s.length > 1024 return false if !@password.nil? && @password.to_s.length > 1024 return false if !@callback_timeout.nil? && @callback_timeout > 25 @@ -247,37 +249,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transcription.rb b/lib/bandwidth-sdk/models/transcription.rb index 40e4fc5b..ac98b024 100644 --- a/lib/bandwidth-sdk/models/transcription.rb +++ b/lib/bandwidth-sdk/models/transcription.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -75,6 +75,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -82,6 +83,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -110,37 +112,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transcription_available_callback.rb b/lib/bandwidth-sdk/models/transcription_available_callback.rb index c0ba4200..37c70d89 100644 --- a/lib/bandwidth-sdk/models/transcription_available_callback.rb +++ b/lib/bandwidth-sdk/models/transcription_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -269,6 +269,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -276,6 +277,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -323,37 +325,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transcription_list.rb b/lib/bandwidth-sdk/models/transcription_list.rb index 8cc2b34e..7a45c478 100644 --- a/lib/bandwidth-sdk/models/transcription_list.rb +++ b/lib/bandwidth-sdk/models/transcription_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -67,6 +67,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -74,6 +75,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -101,37 +103,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transcription_metadata.rb b/lib/bandwidth-sdk/models/transcription_metadata.rb index bdfcda12..9c90ce27 100644 --- a/lib/bandwidth-sdk/models/transcription_metadata.rb +++ b/lib/bandwidth-sdk/models/transcription_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -94,6 +94,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -101,6 +102,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -131,37 +133,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transfer_answer_callback.rb b/lib/bandwidth-sdk/models/transfer_answer_callback.rb index 5c4a22e2..ecd78321 100644 --- a/lib/bandwidth-sdk/models/transfer_answer_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -217,6 +217,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -224,6 +225,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -265,37 +267,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transfer_complete_callback.rb b/lib/bandwidth-sdk/models/transfer_complete_callback.rb index 12158800..c6bbd2c7 100644 --- a/lib/bandwidth-sdk/models/transfer_complete_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -246,6 +246,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -253,6 +254,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -297,37 +299,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb index de8c0128..fcdbe423 100644 --- a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -264,6 +264,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -271,6 +272,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -317,37 +319,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/update_call.rb b/lib/bandwidth-sdk/models/update_call.rb index e932fc63..bde07500 100644 --- a/lib/bandwidth-sdk/models/update_call.rb +++ b/lib/bandwidth-sdk/models/update_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -182,6 +182,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@username.nil? && @username.to_s.length > 1024 invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') @@ -209,6 +210,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@username.nil? && @username.to_s.length > 1024 return false if !@password.nil? && @password.to_s.length > 1024 return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 @@ -300,37 +302,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/update_call_recording.rb b/lib/bandwidth-sdk/models/update_call_recording.rb index 3ab55e7e..edbb6e8c 100644 --- a/lib/bandwidth-sdk/models/update_call_recording.rb +++ b/lib/bandwidth-sdk/models/update_call_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -81,12 +81,15 @@ def initialize(attributes = {}) if attributes.key?(:'state') self.state = attributes[:'state'] + else + self.state = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @state.nil? invalid_properties.push('invalid value for "state", state cannot be nil.') @@ -98,6 +101,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @state.nil? true end @@ -126,37 +130,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/update_conference.rb b/lib/bandwidth-sdk/models/update_conference.rb index decb8270..909ac83c 100644 --- a/lib/bandwidth-sdk/models/update_conference.rb +++ b/lib/bandwidth-sdk/models/update_conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -172,6 +172,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@username.nil? && @username.to_s.length > 1024 invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.') @@ -195,6 +196,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@username.nil? && @username.to_s.length > 1024 return false if !@password.nil? && @password.to_s.length > 1024 return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 @@ -274,37 +276,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/update_conference_member.rb b/lib/bandwidth-sdk/models/update_conference_member.rb index 496557cf..2fa48dc5 100644 --- a/lib/bandwidth-sdk/models/update_conference_member.rb +++ b/lib/bandwidth-sdk/models/update_conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -87,6 +87,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -94,6 +95,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -123,37 +125,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/verify_code_request.rb b/lib/bandwidth-sdk/models/verify_code_request.rb index cc03f213..6552bc26 100644 --- a/lib/bandwidth-sdk/models/verify_code_request.rb +++ b/lib/bandwidth-sdk/models/verify_code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -75,6 +75,8 @@ def initialize(attributes = {}) if attributes.key?(:'to') self.to = attributes[:'to'] + else + self.to = nil end if attributes.key?(:'scope') @@ -83,16 +85,21 @@ def initialize(attributes = {}) if attributes.key?(:'expiration_time_in_minutes') self.expiration_time_in_minutes = attributes[:'expiration_time_in_minutes'] + else + self.expiration_time_in_minutes = nil end if attributes.key?(:'code') self.code = attributes[:'code'] + else + self.code = nil end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @to.nil? invalid_properties.push('invalid value for "to", to cannot be nil.') @@ -133,6 +140,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' return false if @to.nil? return false if @to !~ Regexp.new(/^\+[1-9]\d{1,14}$/) return false if @expiration_time_in_minutes.nil? @@ -222,37 +230,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/verify_code_response.rb b/lib/bandwidth-sdk/models/verify_code_response.rb index ecf713f0..b2708e28 100644 --- a/lib/bandwidth-sdk/models/verify_code_response.rb +++ b/lib/bandwidth-sdk/models/verify_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/voice_api_error.rb b/lib/bandwidth-sdk/models/voice_api_error.rb index 2e695780..d7700ea2 100644 --- a/lib/bandwidth-sdk/models/voice_api_error.rb +++ b/lib/bandwidth-sdk/models/voice_api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -82,6 +82,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -89,6 +90,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -118,37 +120,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/models/voice_code_response.rb b/lib/bandwidth-sdk/models/voice_code_response.rb index ebf0b0ea..3d201145 100644 --- a/lib/bandwidth-sdk/models/voice_code_response.rb +++ b/lib/bandwidth-sdk/models/voice_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end @@ -66,6 +66,7 @@ def initialize(attributes = {}) # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end @@ -73,6 +74,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' true end @@ -100,37 +102,30 @@ def hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end - - self + new(transformed_hash) end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data - def _deserialize(type, value) + def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) diff --git a/lib/bandwidth-sdk/version.rb b/lib/bandwidth-sdk/version.rb index b63906fc..b4dfe81c 100644 --- a/lib/bandwidth-sdk/version.rb +++ b/lib/bandwidth-sdk/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0 +OpenAPI Generator version: 7.0.0-SNAPSHOT =end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index b6ac4cae..9fa7df7a 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -288,7 +288,7 @@ describe '#build_request_url' do it 'adds leading and trailing slashes to path' do - expect(api_client_default.build_request_url('test/path')).to eq('/test/path') + expect(api_client_default.build_request_url('test/path')).to eq('http://localhost/test/path') end end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index c0b3da99..dc65ef63 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -53,19 +53,31 @@ end describe '#base_url' do - it 'Returns default base URL when server_index is nil' do - config.server_index = nil - expect(config.base_url).to eq('http://localhost') - end - - it 'returns empty string when invalid operation is passed' do - expect(config.base_url('invalid_operation')).to eq('') + it 'returns default value when invalid operation is passed' do + expect(config.base_url('invalid_operation')).to eq('http://localhost') end it 'returns proper base URL when server index is set' do operation, server = config.operation_server_settings.first expect(config.base_url(operation)).to eq(server[0][:url]) end + + it 'should have the default value' do + expect(config.base_url).to eq('http://localhost') + end + + it 'returns default value when invalid operation is passed' do + expect(config.base_url('invalid_operation')).to eq('http://localhost') + end + + it 'throws argument error when attempting to use a server index that is out of bounds' do + config.server_operation_index = { + :'MediaApi.upload_media' => 10 + } + expect { + config.base_url(:'MediaApi.upload_media') + }.to raise_error(ArgumentError, 'Invalid index 10 when selecting the server. Must not be nil and must be less than 1') + end end describe '#api_key_with_prefix' do diff --git a/spec/models/call_state_spec.rb b/spec/models/call_state_spec.rb index 55c5a6dd..41b549aa 100644 --- a/spec/models/call_state_spec.rb +++ b/spec/models/call_state_spec.rb @@ -118,12 +118,6 @@ end end - describe '#list_invalid_properties' do - it 'returns list of invalid properties' do - expect(call_state_default.list_invalid_properties).to eq([]) - end - end - describe '#hash' do it 'returns a hash code according to attributes' do expect(call_state_default.hash).to be_instance_of(Integer) @@ -136,13 +130,6 @@ end end - describe '#valid?' do - it 'validates instances with and without attributes set' do - expect(call_state_default).to be_valid - expect(call_state_values).to be_valid - end - end - describe '#eq? #==' do it 'returns true/false when comparing objects' do expect(call_state_default.eql?(Bandwidth::CallState.new)).to be true diff --git a/spec/models/deferred_result_spec.rb b/spec/models/deferred_result_spec.rb index e092911c..8a0c2e0b 100644 --- a/spec/models/deferred_result_spec.rb +++ b/spec/models/deferred_result_spec.rb @@ -43,13 +43,7 @@ expect(deferred_result_from_hash.set_or_expired).to be true end end - - describe '#list_invalid_properties' do - it 'returns list of invalid properties' do - expect(deferred_result_default.list_invalid_properties).to eq([]) - end - end - + describe '#hash' do it 'returns a hash code according to attributes' do expect(deferred_result_default.hash).to be_instance_of(Integer) @@ -62,13 +56,6 @@ end end - describe '#valid?' do - it 'validates instances with and without attributes set' do - expect(deferred_result_default).to be_valid - expect(deferred_result_values).to be_valid - end - end - describe '#eq? #==' do it 'returns true/false when comparing objects' do expect(deferred_result_default.eql?(Bandwidth::DeferredResult.new)).to be true diff --git a/spec/models/message_spec.rb b/spec/models/message_spec.rb index 05f04423..c2c745b6 100644 --- a/spec/models/message_spec.rb +++ b/spec/models/message_spec.rb @@ -7,7 +7,7 @@ application_id: '93de2206-9669-4e07-948d-329f4b722ee2', time: '2022-06-16T13:15:07.160Z', segment_count: 2, - direction: 'in', + direction: Bandwidth::MessageDirectionEnum::IN, to: ['+19195551234'], from: '+19195554321', media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'], @@ -37,6 +37,12 @@ end end + describe 'enum validation' do + it 'works' do + + end + end + describe 'EnumAttributeValidator' do it 'validates string enum' do validator = Bandwidth::Message::EnumAttributeValidator.new(String, ['valid']) @@ -65,7 +71,7 @@ applicationId: '93de2206-9669-4e07-948d-329f4b722ee2', time: '2022-06-16T13:15:07.160Z', segmentCount: 2, - direction: 'in', + direction: Bandwidth::MessageDirectionEnum::IN, to: ['+19195551234'], from: '+19195554321', media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'], @@ -80,7 +86,7 @@ expect(message_from_hash.application_id).to eq('93de2206-9669-4e07-948d-329f4b722ee2') expect(message_from_hash.time).to eq(Time.parse('2022-06-16T13:15:07.160Z')) expect(message_from_hash.segment_count).to eq(2) - expect(message_from_hash.direction).to eq('in') + expect(message_from_hash.direction).to eq(Bandwidth::MessageDirectionEnum::IN) expect(message_from_hash.to).to eq(['+19195551234']) expect(message_from_hash.from).to eq('+19195554321') expect(message_from_hash.media).to eq(['https://dev.bandwidth.com/images/bandwidth-logo.png']) @@ -91,12 +97,6 @@ end end - describe '#list_invalid_properties' do - it 'returns list of invalid properties' do - expect(message_default.list_invalid_properties).to eq([]) - end - end - describe '#hash' do it 'returns a hash code according to attributes' do expect(message_default.hash).to be_instance_of(Integer) @@ -109,13 +109,6 @@ end end - describe '#valid?' do - it 'validates instances with and without attributes set' do - expect(message_default).to be_valid - expect(message_values).to be_valid - end - end - describe '#eq? #==' do it 'returns true/false when comparing objects' do expect(message_default.eql?(Bandwidth::Message.new)).to be true @@ -131,7 +124,7 @@ applicationId: '93de2206-9669-4e07-948d-329f4b722ee2', time: '2022-06-16T13:15:07.160Z', segmentCount: 2, - direction: 'in', + direction: Bandwidth::MessageDirectionEnum::IN, to: ['+19195551234'], from: '+19195554321', media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'], diff --git a/spec/models/verify_code_request_spec.rb b/spec/models/verify_code_request_spec.rb index 643a2ed7..48673ff5 100644 --- a/spec/models/verify_code_request_spec.rb +++ b/spec/models/verify_code_request_spec.rb @@ -1,6 +1,5 @@ # Unit tests for Bandwidth::VerifyCodeRequest describe Bandwidth::VerifyCodeRequest do - let(:verify_code_request_default) { Bandwidth::VerifyCodeRequest.new } let(:verify_code_request_values) { Bandwidth::VerifyCodeRequest.new({ to: '+19195551234', scope: '2FA', @@ -50,12 +49,6 @@ end end - describe '#list_invalid_properties' do - it 'returns list of invalid properties' do - expect(verify_code_request_values.list_invalid_properties).to eq([]) - end - end - describe '#hash' do it 'returns a hash code according to attributes' do expect(verify_code_request_values.hash).to be_instance_of(Integer) @@ -68,16 +61,15 @@ end end - describe '#valid?' do - it 'validates instances with and without attributes set' do - expect(verify_code_request_values).to be_valid - end - end - describe '#eq? #==' do it 'returns true/false when comparing objects' do - expect(verify_code_request_default.eql?(Bandwidth::VerifyCodeRequest.new)).to be true - expect(verify_code_request_default.eql?(verify_code_request_values)).to be false + verify_code_request_equal = Bandwidth::VerifyCodeRequest.new({ + to: '+19195551234', + scope: '2FA', + expiration_time_in_minutes: 1.0, + code: '123456' + }) + expect(verify_code_request_equal.eql?(verify_code_request_values)).to be true end end From 330022eea3a9f6b79c4a2e62f209e3c6005601ff Mon Sep 17 00:00:00 2001 From: ckoegel Date: Wed, 26 Jul 2023 14:28:42 -0400 Subject: [PATCH 25/30] update workflow --- .github/workflows/update-sdk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml index acba3707..47b1bbfd 100644 --- a/.github/workflows/update-sdk.yml +++ b/.github/workflows/update-sdk.yml @@ -78,7 +78,7 @@ jobs: with: branch-name: ${{ steps.jira.outputs.jira-key }} token: ${{ env.DX_GITHUB_TOKEN }} - openapi-generator-version: 6.5.0 + openapi-generator-version: 7.0.0 language: ruby config: ./openapi-config.yml From 8aa576c024fc39092e525922d2ddb3669f6cc38a Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Fri, 25 Aug 2023 11:21:16 -0400 Subject: [PATCH 26/30] SWI-3336 Update SDK to OpenAPI Generator 7.0.0 (#108) * SWI-3336 Update SDK to OpenAPI Generator 7.0.0 * update generator config * update bw spec * update sdk to 7.0.0 * add `display_name` to calls tests --- .github/workflows/deploy.yml | 2 +- .openapi-generator/VERSION | 2 +- bandwidth-sdk.gemspec | 2 +- bandwidth.yml | 26 ++++++++++++++++ docs/CreateCall.md | 2 ++ lib/bandwidth-sdk.rb | 2 +- lib/bandwidth-sdk/api/calls_api.rb | 2 +- lib/bandwidth-sdk/api/conferences_api.rb | 2 +- lib/bandwidth-sdk/api/media_api.rb | 2 +- lib/bandwidth-sdk/api/messages_api.rb | 2 +- lib/bandwidth-sdk/api/mfa_api.rb | 2 +- .../api/phone_number_lookup_api.rb | 2 +- lib/bandwidth-sdk/api/recordings_api.rb | 2 +- lib/bandwidth-sdk/api/statistics_api.rb | 2 +- lib/bandwidth-sdk/api_client.rb | 2 +- lib/bandwidth-sdk/api_error.rb | 2 +- lib/bandwidth-sdk/configuration.rb | 2 +- .../models/account_statistics.rb | 2 +- lib/bandwidth-sdk/models/answer_callback.rb | 2 +- .../models/bridge_complete_callback.rb | 2 +- .../models/bridge_target_complete_callback.rb | 2 +- .../models/call_direction_enum.rb | 2 +- .../models/call_recording_metadata.rb | 2 +- lib/bandwidth-sdk/models/call_state.rb | 2 +- lib/bandwidth-sdk/models/call_state_enum.rb | 2 +- .../models/callback_method_enum.rb | 2 +- lib/bandwidth-sdk/models/code_request.rb | 2 +- lib/bandwidth-sdk/models/conference.rb | 2 +- .../models/conference_completed_callback.rb | 2 +- .../models/conference_created_callback.rb | 2 +- lib/bandwidth-sdk/models/conference_member.rb | 2 +- .../models/conference_member_exit_callback.rb | 2 +- .../models/conference_member_join_callback.rb | 2 +- ...conference_recording_available_callback.rb | 2 +- .../models/conference_recording_metadata.rb | 2 +- .../models/conference_redirect_callback.rb | 2 +- .../models/conference_state_enum.rb | 2 +- lib/bandwidth-sdk/models/create_call.rb | 30 +++++++++++++++++-- .../models/create_call_response.rb | 2 +- .../models/create_lookup_response.rb | 2 +- .../models/create_message_request_error.rb | 2 +- lib/bandwidth-sdk/models/deferred_result.rb | 2 +- .../models/disconnect_callback.rb | 2 +- lib/bandwidth-sdk/models/diversion.rb | 2 +- lib/bandwidth-sdk/models/dtmf_callback.rb | 2 +- lib/bandwidth-sdk/models/field_error.rb | 2 +- lib/bandwidth-sdk/models/file_format_enum.rb | 2 +- lib/bandwidth-sdk/models/gather_callback.rb | 2 +- .../models/inbound_message_callback.rb | 2 +- .../inbound_message_callback_message.rb | 2 +- lib/bandwidth-sdk/models/initiate_callback.rb | 2 +- .../models/list_message_direction_enum.rb | 2 +- lib/bandwidth-sdk/models/list_message_item.rb | 2 +- lib/bandwidth-sdk/models/lookup_request.rb | 2 +- lib/bandwidth-sdk/models/lookup_result.rb | 2 +- lib/bandwidth-sdk/models/lookup_status.rb | 2 +- .../models/lookup_status_enum.rb | 2 +- .../machine_detection_complete_callback.rb | 2 +- .../models/machine_detection_configuration.rb | 2 +- .../models/machine_detection_mode_enum.rb | 2 +- .../models/machine_detection_result.rb | 2 +- lib/bandwidth-sdk/models/media.rb | 2 +- lib/bandwidth-sdk/models/message.rb | 2 +- .../models/message_delivered_callback.rb | 2 +- .../message_delivered_callback_message.rb | 2 +- .../models/message_direction_enum.rb | 2 +- .../models/message_failed_callback.rb | 2 +- .../models/message_failed_callback_message.rb | 2 +- lib/bandwidth-sdk/models/message_request.rb | 2 +- .../models/message_sending_callback.rb | 2 +- .../message_sending_callback_message.rb | 2 +- .../models/message_status_enum.rb | 2 +- lib/bandwidth-sdk/models/message_type_enum.rb | 2 +- lib/bandwidth-sdk/models/messages_list.rb | 2 +- .../models/messaging_code_response.rb | 2 +- .../models/messaging_request_error.rb | 2 +- .../models/mfa_forbidden_request_error.rb | 2 +- lib/bandwidth-sdk/models/mfa_request_error.rb | 2 +- .../models/mfa_unauthorized_request_error.rb | 2 +- lib/bandwidth-sdk/models/page_info.rb | 2 +- lib/bandwidth-sdk/models/priority_enum.rb | 2 +- .../models/recording_available_callback.rb | 2 +- .../models/recording_complete_callback.rb | 2 +- .../models/recording_state_enum.rb | 2 +- lib/bandwidth-sdk/models/redirect_callback.rb | 2 +- .../models/redirect_method_enum.rb | 2 +- lib/bandwidth-sdk/models/stir_shaken.rb | 2 +- lib/bandwidth-sdk/models/tag.rb | 2 +- .../models/tn_lookup_request_error.rb | 2 +- .../models/transcribe_recording.rb | 2 +- lib/bandwidth-sdk/models/transcription.rb | 2 +- .../transcription_available_callback.rb | 2 +- .../models/transcription_list.rb | 2 +- .../models/transcription_metadata.rb | 2 +- .../models/transfer_answer_callback.rb | 2 +- .../models/transfer_complete_callback.rb | 2 +- .../models/transfer_disconnect_callback.rb | 2 +- lib/bandwidth-sdk/models/update_call.rb | 2 +- .../models/update_call_recording.rb | 2 +- lib/bandwidth-sdk/models/update_conference.rb | 2 +- .../models/update_conference_member.rb | 2 +- .../models/verify_code_request.rb | 2 +- .../models/verify_code_response.rb | 2 +- lib/bandwidth-sdk/models/voice_api_error.rb | 2 +- .../models/voice_code_response.rb | 2 +- lib/bandwidth-sdk/version.rb | 2 +- openapitools.json | 2 +- spec/api/calls_api_spec.rb | 2 ++ .../integration/calls_api_integration_spec.rb | 2 ++ 109 files changed, 164 insertions(+), 106 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cceafda1..7c6d56ff 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -36,7 +36,7 @@ jobs: if [[ $RELEASE_VERSION =~ $re ]]; then echo "GEM_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV else - echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+\.[0-9]+\.[0-9]+\.pre\.beta\.[0-9]+\.?[0-9]*\.?[0-9]*)' + echo "Tag does not match expected regex pattern for beta releases (v$re)" echo $RELEASE_VERSION echo 'Please update your tag to match the expected regex pattern' exit 1 diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 757e6740..41225218 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.0.0-SNAPSHOT \ No newline at end of file +7.0.0 \ No newline at end of file diff --git a/bandwidth-sdk.gemspec b/bandwidth-sdk.gemspec index 74e8c475..3ed52c1c 100644 --- a/bandwidth-sdk.gemspec +++ b/bandwidth-sdk.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/bandwidth.yml b/bandwidth.yml index cb848837..1cbcd06f 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -40,6 +40,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -70,6 +72,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -110,6 +114,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -141,6 +147,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -212,6 +220,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -1994,6 +2004,16 @@ components: strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). example: '+19195554321' + displayName: + nullable: true + type: string + 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. + maxLength: 256 + example: John Doe uui: nullable: true type: string @@ -4403,6 +4423,12 @@ components: application/json: schema: $ref: '#/components/schemas/messagingRequestError' + messagingNotAcceptableError: + description: Not Acceptable + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' createMessageBadRequestError: description: Bad Request content: diff --git a/docs/CreateCall.md b/docs/CreateCall.md index 9f8fda7e..a38537ca 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -6,6 +6,7 @@ | ---- | ---- | ----------- | ----- | | **to** | **String** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | | | **from** | **String** | 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** | **String** | 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] | | **uui** | **String** | 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** | **String** | The id of the application associated with the `from` number. | | | **answer_url** | **String** | 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`. | | @@ -32,6 +33,7 @@ require 'bandwidth-sdk' instance = Bandwidth::CreateCall.new( to: +19195551234, 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, diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index 27b6a9af..87f7417f 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/api/calls_api.rb b/lib/bandwidth-sdk/api/calls_api.rb index b765186b..4ab1d659 100644 --- a/lib/bandwidth-sdk/api/calls_api.rb +++ b/lib/bandwidth-sdk/api/calls_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/api/conferences_api.rb b/lib/bandwidth-sdk/api/conferences_api.rb index 68f18f51..28adc783 100644 --- a/lib/bandwidth-sdk/api/conferences_api.rb +++ b/lib/bandwidth-sdk/api/conferences_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/api/media_api.rb b/lib/bandwidth-sdk/api/media_api.rb index 52773ccf..bad2d8e5 100644 --- a/lib/bandwidth-sdk/api/media_api.rb +++ b/lib/bandwidth-sdk/api/media_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb index b4d87cfd..4f1cdc1f 100644 --- a/lib/bandwidth-sdk/api/messages_api.rb +++ b/lib/bandwidth-sdk/api/messages_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/api/mfa_api.rb b/lib/bandwidth-sdk/api/mfa_api.rb index 723d7699..becdf34f 100644 --- a/lib/bandwidth-sdk/api/mfa_api.rb +++ b/lib/bandwidth-sdk/api/mfa_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb index b6f9d8d3..a5c8e0a8 100644 --- a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +++ b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/api/recordings_api.rb b/lib/bandwidth-sdk/api/recordings_api.rb index 3f1896da..3adbdbdf 100644 --- a/lib/bandwidth-sdk/api/recordings_api.rb +++ b/lib/bandwidth-sdk/api/recordings_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/api/statistics_api.rb b/lib/bandwidth-sdk/api/statistics_api.rb index 6ed63282..bbb1ebb5 100644 --- a/lib/bandwidth-sdk/api/statistics_api.rb +++ b/lib/bandwidth-sdk/api/statistics_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/api_client.rb b/lib/bandwidth-sdk/api_client.rb index c662ea3c..2412b9d5 100644 --- a/lib/bandwidth-sdk/api_client.rb +++ b/lib/bandwidth-sdk/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/api_error.rb b/lib/bandwidth-sdk/api_error.rb index ae853593..901fb837 100644 --- a/lib/bandwidth-sdk/api_error.rb +++ b/lib/bandwidth-sdk/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/configuration.rb b/lib/bandwidth-sdk/configuration.rb index 54a949b5..d9a0ad5b 100644 --- a/lib/bandwidth-sdk/configuration.rb +++ b/lib/bandwidth-sdk/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/account_statistics.rb b/lib/bandwidth-sdk/models/account_statistics.rb index 5c12bf9a..592530f4 100644 --- a/lib/bandwidth-sdk/models/account_statistics.rb +++ b/lib/bandwidth-sdk/models/account_statistics.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/answer_callback.rb b/lib/bandwidth-sdk/models/answer_callback.rb index 5250e0e8..a1df3331 100644 --- a/lib/bandwidth-sdk/models/answer_callback.rb +++ b/lib/bandwidth-sdk/models/answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/bridge_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_complete_callback.rb index 547b5f94..8a7cbc79 100644 --- a/lib/bandwidth-sdk/models/bridge_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb index d5c41045..8150a36f 100644 --- a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +++ b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/call_direction_enum.rb b/lib/bandwidth-sdk/models/call_direction_enum.rb index 606582dc..3208d340 100644 --- a/lib/bandwidth-sdk/models/call_direction_enum.rb +++ b/lib/bandwidth-sdk/models/call_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/call_recording_metadata.rb b/lib/bandwidth-sdk/models/call_recording_metadata.rb index 8b51da7f..b475737a 100644 --- a/lib/bandwidth-sdk/models/call_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/call_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/call_state.rb b/lib/bandwidth-sdk/models/call_state.rb index fe4d8da6..e5e735cc 100644 --- a/lib/bandwidth-sdk/models/call_state.rb +++ b/lib/bandwidth-sdk/models/call_state.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/call_state_enum.rb b/lib/bandwidth-sdk/models/call_state_enum.rb index 5177106d..16f757f5 100644 --- a/lib/bandwidth-sdk/models/call_state_enum.rb +++ b/lib/bandwidth-sdk/models/call_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/callback_method_enum.rb b/lib/bandwidth-sdk/models/callback_method_enum.rb index dee2fbb5..9face145 100644 --- a/lib/bandwidth-sdk/models/callback_method_enum.rb +++ b/lib/bandwidth-sdk/models/callback_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/code_request.rb b/lib/bandwidth-sdk/models/code_request.rb index 8ae74b57..c6501549 100644 --- a/lib/bandwidth-sdk/models/code_request.rb +++ b/lib/bandwidth-sdk/models/code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/conference.rb b/lib/bandwidth-sdk/models/conference.rb index e8b908b2..1f239ef6 100644 --- a/lib/bandwidth-sdk/models/conference.rb +++ b/lib/bandwidth-sdk/models/conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/conference_completed_callback.rb b/lib/bandwidth-sdk/models/conference_completed_callback.rb index b5e202fc..8074fc50 100644 --- a/lib/bandwidth-sdk/models/conference_completed_callback.rb +++ b/lib/bandwidth-sdk/models/conference_completed_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/conference_created_callback.rb b/lib/bandwidth-sdk/models/conference_created_callback.rb index cf684c87..7142732a 100644 --- a/lib/bandwidth-sdk/models/conference_created_callback.rb +++ b/lib/bandwidth-sdk/models/conference_created_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/conference_member.rb b/lib/bandwidth-sdk/models/conference_member.rb index f12acfbd..ed5fe582 100644 --- a/lib/bandwidth-sdk/models/conference_member.rb +++ b/lib/bandwidth-sdk/models/conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb index 416cfd9d..a3e4a5d7 100644 --- a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/conference_member_join_callback.rb b/lib/bandwidth-sdk/models/conference_member_join_callback.rb index f1b5f089..f8352171 100644 --- a/lib/bandwidth-sdk/models/conference_member_join_callback.rb +++ b/lib/bandwidth-sdk/models/conference_member_join_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb index edac9e57..695007d1 100644 --- a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/conference_recording_metadata.rb b/lib/bandwidth-sdk/models/conference_recording_metadata.rb index 6035e5f8..365d04b3 100644 --- a/lib/bandwidth-sdk/models/conference_recording_metadata.rb +++ b/lib/bandwidth-sdk/models/conference_recording_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/conference_redirect_callback.rb b/lib/bandwidth-sdk/models/conference_redirect_callback.rb index f9af8846..a0252fc3 100644 --- a/lib/bandwidth-sdk/models/conference_redirect_callback.rb +++ b/lib/bandwidth-sdk/models/conference_redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/conference_state_enum.rb b/lib/bandwidth-sdk/models/conference_state_enum.rb index 06f1534b..19b83f0f 100644 --- a/lib/bandwidth-sdk/models/conference_state_enum.rb +++ b/lib/bandwidth-sdk/models/conference_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/create_call.rb b/lib/bandwidth-sdk/models/create_call.rb index dd1128de..70853754 100644 --- a/lib/bandwidth-sdk/models/create_call.rb +++ b/lib/bandwidth-sdk/models/create_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end @@ -21,6 +21,9 @@ class CreateCall # 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`). attr_accessor :from + # The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. + attr_accessor :display_name + # 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. attr_accessor :uui @@ -95,6 +98,7 @@ def self.attribute_map { :'to' => :'to', :'from' => :'from', + :'display_name' => :'displayName', :'uui' => :'uui', :'application_id' => :'applicationId', :'answer_url' => :'answerUrl', @@ -125,6 +129,7 @@ def self.openapi_types { :'to' => :'String', :'from' => :'String', + :'display_name' => :'String', :'uui' => :'String', :'application_id' => :'String', :'answer_url' => :'String', @@ -148,6 +153,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'display_name', :'uui', :'answer_method', :'username', @@ -192,6 +198,10 @@ def initialize(attributes = {}) self.from = nil end + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + if attributes.key?(:'uui') self.uui = attributes[:'uui'] end @@ -290,6 +300,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "from", from cannot be nil.') end + if !@display_name.nil? && @display_name.to_s.length > 256 + invalid_properties.push('invalid value for "display_name", the character length must be smaller than or equal to 256.') + end + if @application_id.nil? invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') end @@ -363,6 +377,7 @@ def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @to.nil? return false if @from.nil? + return false if !@display_name.nil? && @display_name.to_s.length > 256 return false if @application_id.nil? return false if @answer_url.nil? return false if @answer_url.to_s.length > 2048 @@ -382,6 +397,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] display_name Value to be assigned + def display_name=(display_name) + if !display_name.nil? && display_name.to_s.length > 256 + fail ArgumentError, 'invalid value for "display_name", the character length must be smaller than or equal to 256.' + end + + @display_name = display_name + end + # Custom attribute writer method with validation # @param [Object] answer_url Value to be assigned def answer_url=(answer_url) @@ -515,6 +540,7 @@ def ==(o) self.class == o.class && to == o.to && from == o.from && + display_name == o.display_name && uui == o.uui && application_id == o.application_id && answer_url == o.answer_url && @@ -543,7 +569,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [to, from, uui, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash + [to, from, display_name, uui, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash end # Builds the object from hash diff --git a/lib/bandwidth-sdk/models/create_call_response.rb b/lib/bandwidth-sdk/models/create_call_response.rb index e91fecef..a93608fa 100644 --- a/lib/bandwidth-sdk/models/create_call_response.rb +++ b/lib/bandwidth-sdk/models/create_call_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/create_lookup_response.rb b/lib/bandwidth-sdk/models/create_lookup_response.rb index 0b502a91..ce6f0892 100644 --- a/lib/bandwidth-sdk/models/create_lookup_response.rb +++ b/lib/bandwidth-sdk/models/create_lookup_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/create_message_request_error.rb b/lib/bandwidth-sdk/models/create_message_request_error.rb index 081214f4..10dd2032 100644 --- a/lib/bandwidth-sdk/models/create_message_request_error.rb +++ b/lib/bandwidth-sdk/models/create_message_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/deferred_result.rb b/lib/bandwidth-sdk/models/deferred_result.rb index 6c667d76..9aa5a732 100644 --- a/lib/bandwidth-sdk/models/deferred_result.rb +++ b/lib/bandwidth-sdk/models/deferred_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/disconnect_callback.rb b/lib/bandwidth-sdk/models/disconnect_callback.rb index 192b6e6c..9363c0f9 100644 --- a/lib/bandwidth-sdk/models/disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/disconnect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/diversion.rb b/lib/bandwidth-sdk/models/diversion.rb index 12b914e2..cc055774 100644 --- a/lib/bandwidth-sdk/models/diversion.rb +++ b/lib/bandwidth-sdk/models/diversion.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/dtmf_callback.rb b/lib/bandwidth-sdk/models/dtmf_callback.rb index a67a2fbe..3578643d 100644 --- a/lib/bandwidth-sdk/models/dtmf_callback.rb +++ b/lib/bandwidth-sdk/models/dtmf_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/field_error.rb b/lib/bandwidth-sdk/models/field_error.rb index a9c2ec36..f5f50356 100644 --- a/lib/bandwidth-sdk/models/field_error.rb +++ b/lib/bandwidth-sdk/models/field_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/file_format_enum.rb b/lib/bandwidth-sdk/models/file_format_enum.rb index 7941e020..30cbaeac 100644 --- a/lib/bandwidth-sdk/models/file_format_enum.rb +++ b/lib/bandwidth-sdk/models/file_format_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/gather_callback.rb b/lib/bandwidth-sdk/models/gather_callback.rb index 7006ab02..167475f9 100644 --- a/lib/bandwidth-sdk/models/gather_callback.rb +++ b/lib/bandwidth-sdk/models/gather_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/inbound_message_callback.rb b/lib/bandwidth-sdk/models/inbound_message_callback.rb index 3d15b616..b886eb62 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb index 12fec95c..3ae2890f 100644 --- a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +++ b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/initiate_callback.rb b/lib/bandwidth-sdk/models/initiate_callback.rb index cb32b374..af7c4d1f 100644 --- a/lib/bandwidth-sdk/models/initiate_callback.rb +++ b/lib/bandwidth-sdk/models/initiate_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/list_message_direction_enum.rb b/lib/bandwidth-sdk/models/list_message_direction_enum.rb index 07a2d72b..443b9e96 100644 --- a/lib/bandwidth-sdk/models/list_message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/list_message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/list_message_item.rb b/lib/bandwidth-sdk/models/list_message_item.rb index ea9da05e..014fb7b1 100644 --- a/lib/bandwidth-sdk/models/list_message_item.rb +++ b/lib/bandwidth-sdk/models/list_message_item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/lookup_request.rb b/lib/bandwidth-sdk/models/lookup_request.rb index e5a96dec..38b5cda4 100644 --- a/lib/bandwidth-sdk/models/lookup_request.rb +++ b/lib/bandwidth-sdk/models/lookup_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/lookup_result.rb b/lib/bandwidth-sdk/models/lookup_result.rb index b09c2126..159a0e92 100644 --- a/lib/bandwidth-sdk/models/lookup_result.rb +++ b/lib/bandwidth-sdk/models/lookup_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/lookup_status.rb b/lib/bandwidth-sdk/models/lookup_status.rb index 39d022ed..4aca5818 100644 --- a/lib/bandwidth-sdk/models/lookup_status.rb +++ b/lib/bandwidth-sdk/models/lookup_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/lookup_status_enum.rb b/lib/bandwidth-sdk/models/lookup_status_enum.rb index 7c10f914..d78b65a4 100644 --- a/lib/bandwidth-sdk/models/lookup_status_enum.rb +++ b/lib/bandwidth-sdk/models/lookup_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb index 236f33c9..58c31254 100644 --- a/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +++ b/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/machine_detection_configuration.rb b/lib/bandwidth-sdk/models/machine_detection_configuration.rb index d0e7b5d1..c7fc87ae 100644 --- a/lib/bandwidth-sdk/models/machine_detection_configuration.rb +++ b/lib/bandwidth-sdk/models/machine_detection_configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb index f2ba8431..3ae4845c 100644 --- a/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +++ b/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/machine_detection_result.rb b/lib/bandwidth-sdk/models/machine_detection_result.rb index acc9bfae..8a2eb71b 100644 --- a/lib/bandwidth-sdk/models/machine_detection_result.rb +++ b/lib/bandwidth-sdk/models/machine_detection_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/media.rb b/lib/bandwidth-sdk/models/media.rb index 7d658874..37da6588 100644 --- a/lib/bandwidth-sdk/models/media.rb +++ b/lib/bandwidth-sdk/models/media.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/message.rb b/lib/bandwidth-sdk/models/message.rb index 5463b7ee..2f551d49 100644 --- a/lib/bandwidth-sdk/models/message.rb +++ b/lib/bandwidth-sdk/models/message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/message_delivered_callback.rb b/lib/bandwidth-sdk/models/message_delivered_callback.rb index 69e74004..ef3143db 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb index ed0a91ad..e467706d 100644 --- a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/message_direction_enum.rb b/lib/bandwidth-sdk/models/message_direction_enum.rb index 45b72c4b..0195a462 100644 --- a/lib/bandwidth-sdk/models/message_direction_enum.rb +++ b/lib/bandwidth-sdk/models/message_direction_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/message_failed_callback.rb b/lib/bandwidth-sdk/models/message_failed_callback.rb index 855464d4..e1f55acf 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/message_failed_callback_message.rb b/lib/bandwidth-sdk/models/message_failed_callback_message.rb index b7811538..0c3ab2c7 100644 --- a/lib/bandwidth-sdk/models/message_failed_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_failed_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/message_request.rb b/lib/bandwidth-sdk/models/message_request.rb index c204be9e..d72e8070 100644 --- a/lib/bandwidth-sdk/models/message_request.rb +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/message_sending_callback.rb b/lib/bandwidth-sdk/models/message_sending_callback.rb index 2fb923d2..5f662c1f 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/message_sending_callback_message.rb b/lib/bandwidth-sdk/models/message_sending_callback_message.rb index 74526012..f1a7529b 100644 --- a/lib/bandwidth-sdk/models/message_sending_callback_message.rb +++ b/lib/bandwidth-sdk/models/message_sending_callback_message.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/message_status_enum.rb b/lib/bandwidth-sdk/models/message_status_enum.rb index 1762e105..9a426842 100644 --- a/lib/bandwidth-sdk/models/message_status_enum.rb +++ b/lib/bandwidth-sdk/models/message_status_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/message_type_enum.rb b/lib/bandwidth-sdk/models/message_type_enum.rb index 3418b2a0..7e6e91ea 100644 --- a/lib/bandwidth-sdk/models/message_type_enum.rb +++ b/lib/bandwidth-sdk/models/message_type_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/messages_list.rb b/lib/bandwidth-sdk/models/messages_list.rb index 5baa2cf1..ff7d3adf 100644 --- a/lib/bandwidth-sdk/models/messages_list.rb +++ b/lib/bandwidth-sdk/models/messages_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/messaging_code_response.rb b/lib/bandwidth-sdk/models/messaging_code_response.rb index db230699..1f469f6d 100644 --- a/lib/bandwidth-sdk/models/messaging_code_response.rb +++ b/lib/bandwidth-sdk/models/messaging_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/messaging_request_error.rb b/lib/bandwidth-sdk/models/messaging_request_error.rb index 18172206..26b738a0 100644 --- a/lib/bandwidth-sdk/models/messaging_request_error.rb +++ b/lib/bandwidth-sdk/models/messaging_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb index d8cb5463..53374d88 100644 --- a/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/mfa_request_error.rb b/lib/bandwidth-sdk/models/mfa_request_error.rb index d809f1dd..44f5706a 100644 --- a/lib/bandwidth-sdk/models/mfa_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb index 3e926bdf..244f18f4 100644 --- a/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +++ b/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/page_info.rb b/lib/bandwidth-sdk/models/page_info.rb index ba0d2b4e..655b916c 100644 --- a/lib/bandwidth-sdk/models/page_info.rb +++ b/lib/bandwidth-sdk/models/page_info.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/priority_enum.rb b/lib/bandwidth-sdk/models/priority_enum.rb index e28c54cc..cd7a1ba6 100644 --- a/lib/bandwidth-sdk/models/priority_enum.rb +++ b/lib/bandwidth-sdk/models/priority_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/recording_available_callback.rb b/lib/bandwidth-sdk/models/recording_available_callback.rb index 1ad492f9..9378ee80 100644 --- a/lib/bandwidth-sdk/models/recording_available_callback.rb +++ b/lib/bandwidth-sdk/models/recording_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/recording_complete_callback.rb b/lib/bandwidth-sdk/models/recording_complete_callback.rb index 8414189c..026f497f 100644 --- a/lib/bandwidth-sdk/models/recording_complete_callback.rb +++ b/lib/bandwidth-sdk/models/recording_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/recording_state_enum.rb b/lib/bandwidth-sdk/models/recording_state_enum.rb index 6950cca6..376e3503 100644 --- a/lib/bandwidth-sdk/models/recording_state_enum.rb +++ b/lib/bandwidth-sdk/models/recording_state_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/redirect_callback.rb b/lib/bandwidth-sdk/models/redirect_callback.rb index a91b7ecb..28aaf5b9 100644 --- a/lib/bandwidth-sdk/models/redirect_callback.rb +++ b/lib/bandwidth-sdk/models/redirect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/redirect_method_enum.rb b/lib/bandwidth-sdk/models/redirect_method_enum.rb index 901afb20..5755080d 100644 --- a/lib/bandwidth-sdk/models/redirect_method_enum.rb +++ b/lib/bandwidth-sdk/models/redirect_method_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/stir_shaken.rb b/lib/bandwidth-sdk/models/stir_shaken.rb index 909e6f29..6d496cf8 100644 --- a/lib/bandwidth-sdk/models/stir_shaken.rb +++ b/lib/bandwidth-sdk/models/stir_shaken.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/tag.rb b/lib/bandwidth-sdk/models/tag.rb index c77c90d5..889bbcf3 100644 --- a/lib/bandwidth-sdk/models/tag.rb +++ b/lib/bandwidth-sdk/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb index c847b9ed..c03e3106 100644 --- a/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +++ b/lib/bandwidth-sdk/models/tn_lookup_request_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/transcribe_recording.rb b/lib/bandwidth-sdk/models/transcribe_recording.rb index babafd2e..d61d09c3 100644 --- a/lib/bandwidth-sdk/models/transcribe_recording.rb +++ b/lib/bandwidth-sdk/models/transcribe_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/transcription.rb b/lib/bandwidth-sdk/models/transcription.rb index ac98b024..1570c2e9 100644 --- a/lib/bandwidth-sdk/models/transcription.rb +++ b/lib/bandwidth-sdk/models/transcription.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/transcription_available_callback.rb b/lib/bandwidth-sdk/models/transcription_available_callback.rb index 37c70d89..88f4fa9d 100644 --- a/lib/bandwidth-sdk/models/transcription_available_callback.rb +++ b/lib/bandwidth-sdk/models/transcription_available_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/transcription_list.rb b/lib/bandwidth-sdk/models/transcription_list.rb index 7a45c478..c638a60f 100644 --- a/lib/bandwidth-sdk/models/transcription_list.rb +++ b/lib/bandwidth-sdk/models/transcription_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/transcription_metadata.rb b/lib/bandwidth-sdk/models/transcription_metadata.rb index 9c90ce27..1a341e70 100644 --- a/lib/bandwidth-sdk/models/transcription_metadata.rb +++ b/lib/bandwidth-sdk/models/transcription_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/transfer_answer_callback.rb b/lib/bandwidth-sdk/models/transfer_answer_callback.rb index ecd78321..bdc73fea 100644 --- a/lib/bandwidth-sdk/models/transfer_answer_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_answer_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/transfer_complete_callback.rb b/lib/bandwidth-sdk/models/transfer_complete_callback.rb index c6bbd2c7..480ae847 100644 --- a/lib/bandwidth-sdk/models/transfer_complete_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_complete_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb index fcdbe423..a38711a6 100644 --- a/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +++ b/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/update_call.rb b/lib/bandwidth-sdk/models/update_call.rb index bde07500..57b1396c 100644 --- a/lib/bandwidth-sdk/models/update_call.rb +++ b/lib/bandwidth-sdk/models/update_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/update_call_recording.rb b/lib/bandwidth-sdk/models/update_call_recording.rb index edbb6e8c..06b6300b 100644 --- a/lib/bandwidth-sdk/models/update_call_recording.rb +++ b/lib/bandwidth-sdk/models/update_call_recording.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/update_conference.rb b/lib/bandwidth-sdk/models/update_conference.rb index 909ac83c..c15c034b 100644 --- a/lib/bandwidth-sdk/models/update_conference.rb +++ b/lib/bandwidth-sdk/models/update_conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/update_conference_member.rb b/lib/bandwidth-sdk/models/update_conference_member.rb index 2fa48dc5..59782916 100644 --- a/lib/bandwidth-sdk/models/update_conference_member.rb +++ b/lib/bandwidth-sdk/models/update_conference_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/verify_code_request.rb b/lib/bandwidth-sdk/models/verify_code_request.rb index 6552bc26..e2324364 100644 --- a/lib/bandwidth-sdk/models/verify_code_request.rb +++ b/lib/bandwidth-sdk/models/verify_code_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/verify_code_response.rb b/lib/bandwidth-sdk/models/verify_code_response.rb index b2708e28..5ab58b75 100644 --- a/lib/bandwidth-sdk/models/verify_code_response.rb +++ b/lib/bandwidth-sdk/models/verify_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/voice_api_error.rb b/lib/bandwidth-sdk/models/voice_api_error.rb index d7700ea2..f577959b 100644 --- a/lib/bandwidth-sdk/models/voice_api_error.rb +++ b/lib/bandwidth-sdk/models/voice_api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/models/voice_code_response.rb b/lib/bandwidth-sdk/models/voice_code_response.rb index 3d201145..7f6c07c4 100644 --- a/lib/bandwidth-sdk/models/voice_code_response.rb +++ b/lib/bandwidth-sdk/models/voice_code_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/lib/bandwidth-sdk/version.rb b/lib/bandwidth-sdk/version.rb index b4dfe81c..3d49c72a 100644 --- a/lib/bandwidth-sdk/version.rb +++ b/lib/bandwidth-sdk/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end diff --git a/openapitools.json b/openapitools.json index a3883a34..3015568c 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": "6.5.0" + "version": "7.0.0" } } diff --git a/spec/api/calls_api_spec.rb b/spec/api/calls_api_spec.rb index cde57bba..ac3020c9 100644 --- a/spec/api/calls_api_spec.rb +++ b/spec/api/calls_api_spec.rb @@ -6,6 +6,7 @@ let(:call_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}" } let(:call_timeout) { 30.0 } let(:callback_timeout) { 15.0 } + let(:display_name) { 'Ruby SDK' } let(:answer_method) { Bandwidth::CallbackMethodEnum::POST } let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' } let(:answer_fallback_url) { BASE_CALLBACK_URL + '/callbacks/answer' } @@ -69,6 +70,7 @@ application_id: BW_VOICE_APPLICATION_ID, to: USER_NUMBER, from: BW_NUMBER, + display_name: display_name, answer_url: answer_url, answer_fallback_url: answer_fallback_url, answer_method: answer_method, diff --git a/spec/integration/calls_api_integration_spec.rb b/spec/integration/calls_api_integration_spec.rb index b0bca263..3c870ad3 100644 --- a/spec/integration/calls_api_integration_spec.rb +++ b/spec/integration/calls_api_integration_spec.rb @@ -3,6 +3,7 @@ # Integration Tests for Bandwidth::CallsApi describe 'CallsApi Integration Tests' do # call info + let(:display_name) { 'Ruby SDK' } let(:answer_method) { Bandwidth::CallbackMethodEnum::POST } let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' } let(:answer_fallback_method) { Bandwidth::CallbackMethodEnum::POST } @@ -47,6 +48,7 @@ application_id: BW_VOICE_APPLICATION_ID, to: USER_NUMBER, from: BW_NUMBER, + display_name: display_name, answer_url: answer_url, answer_method: answer_method, disconnect_url: disconnect_url, From 295e19d8b604ae8b1fd86531ec922970286ecb11 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 28 Aug 2023 14:34:59 -0400 Subject: [PATCH 27/30] remove assignee from Jira --- .github/workflows/update-sdk.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml index 47b1bbfd..07be1aa8 100644 --- a/.github/workflows/update-sdk.yml +++ b/.github/workflows/update-sdk.yml @@ -51,9 +51,6 @@ jobs: }, "summary": "[$LANGUAGE] Update SDK for New Spec Version", "description": "Prepare the $LANGUAGE SDK for release based on the latest spec changes.", - "assignee": { - "id": "$ASSIGNEE" - }, "issuetype": { "name": "Story" }, @@ -69,7 +66,6 @@ jobs: echo "jira-key=$JIRA_KEY" >> $GITHUB_OUTPUT env: LANGUAGE: Ruby - ASSIGNEE: 611c2f1740168700691bcc2b - name: Build SDK id: build From 4b6b52aaea9b7bbce57e9342be0758880a007589 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:09:47 -0400 Subject: [PATCH 28/30] SWI-3338 Update SDK for GA (#109) * SWI-3338 Update SDK for GA * update beta regex to normal release regex * update version * update README to include generate command * update deploy workflow to update gem version before release * test wf * update test * remove test * revert pre-release regex * update call state test --- .github/workflows/deploy.yml | 7 +++- .github/workflows/update-sdk.yml | 37 +++++++++++-------- README.md | 3 ++ custom_templates/README.mustache | 3 ++ custom_templates/version.mustache | 7 ---- lib/bandwidth-sdk/version.rb | 2 +- .../integration/calls_api_integration_spec.rb | 2 +- 7 files changed, 34 insertions(+), 27 deletions(-) delete mode 100644 custom_templates/version.mustache diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7c6d56ff..76b6658c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,7 +7,7 @@ on: jobs: deploy: - name: Deploy SDK to Rubygems # TODO: Decide on putting env vars in vault after we decide on mocking integration tests + name: Deploy SDK to Rubygems runs-on: ubuntu-latest env: BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} @@ -36,7 +36,7 @@ jobs: if [[ $RELEASE_VERSION =~ $re ]]; then echo "GEM_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV else - echo "Tag does not match expected regex pattern for beta releases (v$re)" + echo "Tag does not match expected semver regex pattern (v$re)" echo $RELEASE_VERSION echo 'Please update your tag to match the expected regex pattern' exit 1 @@ -50,6 +50,9 @@ jobs: with: ruby-version: "3.0" + - name: Update Gem Version + run: sed -i "s/VERSION = '.*'/VERSION = '$GEM_VERSION'/g" lib/bandwidth-sdk/version.rb + - name: Install Packages and Test run: | bundle install diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml index 07be1aa8..b4d9ad56 100644 --- a/.github/workflows/update-sdk.yml +++ b/.github/workflows/update-sdk.yml @@ -8,28 +8,17 @@ on: jobs: update-sdk: name: Update SDK if Necessary - runs-on: ${{ fromJSON(vars.SWI_GLORG_UBUNTU_2204) }} + runs-on: ubuntu-latest outputs: generate: ${{ steps.compare.outputs.generate }} - permissions: - id-token: write - contents: write steps: - - name: Get Github and Jira Tokens from Vault - uses: Bandwidth/vault-provider-action@v1 - with: - secrets: | - workloads/prod/software_infra::secrets:dx-github-token:dx-github-token@1::DX_GITHUB_TOKEN - workloads/prod/software_infra::secrets:SDLC-Enforcer-Prod:JIRA_TOKEN@9::JIRA_TOKEN - workloads/prod/software_infra::secrets:SDLC-Enforcer-Prod:JIRA_USERNAME@9::JIRA_USERNAME - - name: Checkout uses: actions/checkout@v3 - name: Combine Product Specs uses: Bandwidth/api-specs-combine-action@v1.0.0 with: - token: ${{ env.DX_GITHUB_TOKEN }} + token: ${{ secrets.DX_GITHUB_TOKEN }} - name: Determine if a New SDK is Needed id: compare @@ -55,7 +44,7 @@ jobs: "name": "Story" }, "customfield_12108": "$LANGUAGE SDK is ready for release. Tests are created/updated if need be.", - "customfield_10205": "SWI-1876", + "customfield_10205": "$EPIC", "components": [{ "name": "Client SDKs" }] @@ -66,6 +55,9 @@ jobs: echo "jira-key=$JIRA_KEY" >> $GITHUB_OUTPUT env: LANGUAGE: Ruby + EPIC: SWI-1876 + JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }} + JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }} - name: Build SDK id: build @@ -73,7 +65,7 @@ jobs: uses: Bandwidth/generate-sdk-action@v3.0.0 with: branch-name: ${{ steps.jira.outputs.jira-key }} - token: ${{ env.DX_GITHUB_TOKEN }} + token: ${{ secrets.DX_GITHUB_TOKEN }} openapi-generator-version: 7.0.0 language: ruby config: ./openapi-config.yml @@ -100,4 +92,17 @@ jobs: run: | gh pr create -B main -H Bandwidth:${{ steps.jira.outputs.jira-key }} -t '${{ steps.jira.outputs.jira-key }} Update SDK Based on Recent Spec Changes' -b 'Auto-generated by Update SDK Workflow' env: - GITHUB_TOKEN: ${{ env.DX_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }} + + notify-for-failures: + name: Notify for Failures + needs: [update-sdk] + if: failure() + runs-on: ubuntu-latest + steps: + - name: Notify Slack of Failures + uses: Bandwidth/build-notify-slack-action@v1.0.0 + with: + job-status: failure + slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} diff --git a/README.md b/README.md index a0fa1b38..36980169 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ Bandwidth - the Ruby gem for the Bandwidth +# Generated with the command: +`openapi-generator generate -g ruby -i bandwidth.yml -c openapi-config.yml -o ./` + Bandwidth's Communication APIs This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/custom_templates/README.mustache b/custom_templates/README.mustache index 85e5b50b..9ca7a51d 100644 --- a/custom_templates/README.mustache +++ b/custom_templates/README.mustache @@ -14,6 +14,9 @@ {{moduleName}} - the Ruby gem for the {{appName}} +# Generated with the command: +`openapi-generator generate -g ruby -i bandwidth.yml -c openapi-config.yml -o ./` + {{#appDescriptionWithNewLines}} {{{.}}} {{/appDescriptionWithNewLines}} diff --git a/custom_templates/version.mustache b/custom_templates/version.mustache deleted file mode 100644 index ae35b81c..00000000 --- a/custom_templates/version.mustache +++ /dev/null @@ -1,7 +0,0 @@ -=begin -{{> api_info}} -=end - -module {{moduleName}} - VERSION = ENV.fetch("GEM_VERSION") -end diff --git a/lib/bandwidth-sdk/version.rb b/lib/bandwidth-sdk/version.rb index 3d49c72a..baeb051c 100644 --- a/lib/bandwidth-sdk/version.rb +++ b/lib/bandwidth-sdk/version.rb @@ -11,5 +11,5 @@ =end module Bandwidth - VERSION = ENV.fetch('GEM_VERSION') + VERSION = '11.0.0' end diff --git a/spec/integration/calls_api_integration_spec.rb b/spec/integration/calls_api_integration_spec.rb index 3c870ad3..0f584882 100644 --- a/spec/integration/calls_api_integration_spec.rb +++ b/spec/integration/calls_api_integration_spec.rb @@ -93,7 +93,7 @@ expect(data.call_id).to eq($call_info_id) expect(data.account_id).to eq(BW_ACCOUNT_ID) expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID) - expect(data.start_time).to be_instance_of(Time) + expect(data.start_time).to be_instance_of(Time).or be_nil expect(data.last_update).to be_instance_of(Time) expect(data.state).to be_instance_of(String) expect(data.direction).to eq(direction) From 005993dcccd50d42281038128d7ebae75392d33e Mon Sep 17 00:00:00 2001 From: ckoegel Date: Wed, 30 Aug 2023 15:27:45 -0400 Subject: [PATCH 29/30] update release regex --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 76b6658c..747b47d9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,7 +32,7 @@ jobs: - name: Set Release Version run: | RELEASE_VERSION=${GITHUB_REF#refs/tags/v} - re=[0-9]+\.[0-9]+\.[0-9]+\.pre\.beta\.[0-9]+\.?[0-9]*\.?[0-9]* + re=[0-9]+\.[0-9]+\.[0-9]+ if [[ $RELEASE_VERSION =~ $re ]]; then echo "GEM_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV else From 22a992683f7a7f4648170d84894450508433fc07 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 25 Sep 2023 14:31:16 -0400 Subject: [PATCH 30/30] remove ruby-notes and old sdk files --- .../voice_lib/bxml/verbs/custom_param.rb | 17 -------- .../bxml/verbs/start_transcription.rb | 42 ------------------- .../bxml/verbs/stop_transcription.rb | 16 ------- ruby-notes.md | 15 ------- 4 files changed, 90 deletions(-) delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/custom_param.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/start_transcription.rb delete mode 100644 lib/bandwidth/voice_lib/bxml/verbs/stop_transcription.rb delete mode 100644 ruby-notes.md diff --git a/lib/bandwidth/voice_lib/bxml/verbs/custom_param.rb b/lib/bandwidth/voice_lib/bxml/verbs/custom_param.rb deleted file mode 100644 index 8b3a4b08..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/custom_param.rb +++ /dev/null @@ -1,17 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # These elements define optional user specified parameters that will be sent to the destination URL when the real-time transcription is first started - class CustomParam - include XmlVerb - - def to_bxml(xml) - xml.CustomParam(compact_hash({ - 'name' => name, - 'value' => value - })) - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/start_transcription.rb b/lib/bandwidth/voice_lib/bxml/verbs/start_transcription.rb deleted file mode 100644 index cd5f1f03..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/start_transcription.rb +++ /dev/null @@ -1,42 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StartTranscription verb allows a segment of a call to be transcribed and optionally for the live transcription to be sent off to another destination for additional processing - class StartTranscription - include XmlVerb - - def to_bxml(xml) - xml.StartTranscription(compact_hash({ - 'name' => name, - 'tracks' => tracks, - 'transcriptionEventUrl' => transcriptionEventUrl, - 'transcriptionEventMethod' => transcriptionEventMethod, - 'username' => username, - 'password' => password, - 'destination' => destination, - 'stabilized' => stabilized - })) do - def embedded_xml(xml, property, type) - if property - s = if property.is_a?(type) - then property - else type.new(property) - end - s.to_bxml(xml) - end - end - def nest_verbs_list(xml, property) - if property - property.each do |verb| - verb.to_bxml(xml) - end - end - end - embedded_xml(xml, custom_params, CustomParam) - nest_verbs_list(xml, nested_verbs) - end - end - end - end -end diff --git a/lib/bandwidth/voice_lib/bxml/verbs/stop_transcription.rb b/lib/bandwidth/voice_lib/bxml/verbs/stop_transcription.rb deleted file mode 100644 index cd7f0bb8..00000000 --- a/lib/bandwidth/voice_lib/bxml/verbs/stop_transcription.rb +++ /dev/null @@ -1,16 +0,0 @@ -require_relative 'xml_verb' - -module Bandwidth - module Voice - # The StopTranscription verb is used to stop a real-time transcription that was started with a previous `` verb - class StopTranscription - include XmlVerb - - def to_bxml(xml) - xml.StopTranscription(compact_hash({ - 'name' => name - })) - end - end - end -end diff --git a/ruby-notes.md b/ruby-notes.md deleted file mode 100644 index 8f7fe482..00000000 --- a/ruby-notes.md +++ /dev/null @@ -1,15 +0,0 @@ -# Generate Command -`openapi-generator generate -g ruby -i bandwidth.yml -c openapi-config.yml -o ./` - -# Custom Base URL - -* To get a custom url, instead of setting the `environment` parameter in the config, you must make a custom operation in `configuration.rb` -``` ruby -"Custom": [ - { - url: "https://d6979da481772c167be0edcd10eb64d7.m.pipedream.net", - description: "testing" - } -], -``` -this must go in `operation_server_settings` and then `:operation => :"Custom",` must go in `new_options = opts.merge(` for the method you are calling within the `?_api.rb` file for the specific api