Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SWI-3927 OpenAPI Generator SDK (#168)
* Remove Old SDK * Generate SDK with OpenAPI generator Used v6.0.1 * Create `unit` and `integration` test subdirectories * Update test.yaml * Update test.yaml * Regenerate SDK using Binary instead of Byte format * DX-2684 * DX-2684 Calls API Integration Tests * DX-2691 Add TN Lookup Integration Tests (#92) * Begin integration tests Bad lookup status response model related to the oas definition changed the definition and regenerated the spec * Regenerate so that createLookupResponse returns enum for status * Finalize Integration tests for phoneNumberLookup API * Improve tests Remove unused tearDown function Add a verizon (non-bw) number add stronger logic to test order status add regex testing for uuid test each lookup result field for type and data (where possible) add tests for 401 and 403 responses * Update test.yaml new requirements filename * Update test.yaml * Update test.yaml Load secrets as envs * Add python 3.10 to matrix testing * Add tests for AT&T and T-Mobile Tns * missed env variables in new tests * Reusable `validateResult` function * Move the polling logic into a separate function * Create `validateAuthException` helper function * Missed asserting anything in testDuplicatePhoneNumberLookup * PEP8 Formatting * Add function docstrings * Change validateAuthException name Use assertAuthException to match unittest assert names * Document function return types * DX-2689 Add MFA Integration Tests (#93) * Create test_multi_factor_authentication.py 1st pass at writing integration tests * Add docstrings and format * Remove unused imports * Change validateAuthException name Use assertAuthException to match unittest assert names * Update test.yaml * Update test.yaml * Update test.yaml * Get the 401 test working No auth header causes a 401 * Use random number generator for the verify tn request Otherwise we hit a rate limit very quickly * Newline for readability * Move seed outside of class - still seeing 429 errors * Update test/integration/test_multi_factor_authentication.py * Add test to check that the rate limit clears after 30 seconds Requested by MFA team * Remove unused error models These never get used due to the nature of the ApiException that gets raised. Overkill to initialize these by kwarg and test * Clean up spacing and remove test skips * Raise existing exception instead of a new ApiException Bump time.sleep from 30-35 * test without seeding - use systime by default * Remove manual seed for randint sets seed value as system time by default - this works better for multiple tests in parallel * Document function return types * DX-2686 Add Media Integration Tests (#95) * Write Media API Integration Test Added FIxtures * Update test to conform to binary format definition * PEP8 format * Remove unused libraries * Add Media Integration Tests * Utilize a steps function to run tests in a specific order https://stackoverflow.com/questions/5387299/python-unittest-testcase-execution-order/5387956#5387956 * Test Cleanup * Update mediaId github actions runId is not unique * wrong env * Address PR Comments * DX-2684 * Update test_call_callback.py * Update test_calls.py * Update test_calls.py * Update test_calls.py * Update test_calls.py * DX-2684 * Added Test Assertion options for review * DX-2688 * Add sleep to Media Tests (#99) * Add sleep to Media Tests * Bump time.sleep to 5 Clean up docstrings f string formatting for exception * Remove unneeded exception handling * Print for logging * More logging * Move log statement * Add UUID to media name GHA uses `linux` for each ubuntu version - so the media IDs arent unique * DX-2684 * Update test_calls.py * Update test_calls.py * Update test_calls.py * Update test_calls.py * Update test_calls.py * Update test_calls.py * Update test_calls.py * DX-2692 Recordings API Integration Tests (#96) * Added initial call creation and recording tests. * Working on downloading recordings. * Added tests for downloading recordings, transcriptions, and deleting. * Added validation of 204 response for deleting recording media. * Extracted common call setup functionality and began work on active updates. * Added Manteca polling for calls tests. * Began work on testing error paths for recordings api. * Added GitHub Actions environment vars for OS and Python Version. * Added method stubs for invalid endpoint tests. * Created invalid tests for several endpoints. * Completed tests for invalid recordings API calls. * Added docstrings for test methods. * Updated happy path to use extracted method. * Added checks for 2XX response codes. * Updating access to environment variables. * Removed tracking for .vscode * Increased timeout period for Manteca polling. * Updated teardown for call length restriction. * Fix api_instance typo causing test failures * Bump time.sleep to `5` to account for long running transcriptions Co-authored-by: AJ Rice <[email protected]> * DX-2691 `messages_api` Integration Tests (#91) * First commit with updated sdk and tests * more updates to sdk and tests * more test and spec updates * update test afer fielderror additon * update to use specific 401 exception * Apply suggestions from code review Co-authored-by: AJ Rice <[email protected]> * remove duplicate account_id * updates based on comments * log message time * remove logging and drop 3.6 for testing * use json body instead of models for errors * update tests based on comments * Update test/integration/test_messages_api.py * remove unnecessary typing Co-authored-by: AJ Rice <[email protected]> * DX-2684 * DX-2688 Added utils and other cleanup * DX-2684 refactoring * Update test.yaml * Update test_recordings.py * Add skips to recording tests (#102) * Update test_conferences.py * Update test/integration/test_conferences.py Co-authored-by: AJ Rice <[email protected]> * DX-2728 * Update test_calls.py * Update test_media_api.py * Update test.yaml * Update test_media_api.py * Update test.yaml * Update test.yaml * Update test_phone_number_lookup.py * Update test_phone_number_lookup.py * DX-2728 removed unnecessary logging examples * DX-2690, DX-2693 webrtc_api Integration Tests (#101) * DX-2690, DX-2693 `webrtc_api` Integration Tests * revert files * push what i have rn * most of happy path done * happy path done * add notFound and unauthorized exception assertions * add docstrings * Update test/integration/test_webrtc_api.py Co-authored-by: AJ Rice <[email protected]> * use env_vars util * fix gitignore Co-authored-by: AJ Rice <[email protected]> * Added workflow dispatch for various log levels * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test/integration/test_media_api.py Co-authored-by: Cameron Koegel <[email protected]> * Removed writing a local log file * Update test_phone_number_lookup.py * Update test_phone_number_lookup.py * Update test_phone_number_lookup.py * Update test_phone_number_lookup.py * Update test_phone_number_lookup.py * Update test_phone_number_lookup.py * Removed an unused block * Bump OpenAPI Generator Version in listener * Target latest generate-sdk-action version * DX-2795: Re-enable Recordings API Tests (#104) * Re-enabled recordings api tests. * Updated conference tests to deterministically retrieve conference id values. * Updates to conference tests to poll Manteca for recording status. * Removed unnecessary long sleep from conference recording test. * DX-2751 Refactor Integration Tests to Use Hamcrest (#105) * DX-2751 Refactor Integration Tests to Use Hamcrest * fix messages tests * fix recordings tests * media tests * empty array * update tests to use env var helper * _ :upside_down_face * DX-2779 Regenerate using updated `bandwidth.json` (#106) * DX-2779 Regenerate SDK using updated `bandwidth.json` * Regenerate with updated `bandwidth.json` Remove `username` and `password` models from voice spec * Revert "Regenerate with updated `bandwidth.json`" This reverts commit b909806. * Regenerate with updated `bandwidth.json` file Remove `username` and `password` models from voice spec * Regenerate with `carrierName` set to nullable: true * Update bandwidth.json Added example for stir/shaken param * Don't autogenerate unit tests * DX-2826 Regenerate with updated `bandwidth.json` file (#108) * DX-2842 add `StartStream` and `StopStream` BXML (#109) * DX-2842 add `StartStream` and `StopStream` BXML * Wrong import statements copy/paste error * Skip missed generate_transfer_bxml unit tests * add pytest import statement * DX-2849 Add `webrtc_utils` (#110) * DX-2849 Add `webrtc_utils` Add WebRTC Utilities module with helper methods to generate transfer BXML * Made it fancier * Refactor function names * DX-2840 * DX-2870 Refactor of BXML Module (#113) * DX-2870 Create Base BXML Classes Created base class for root (`<Bxml>` and `<Response>`) Created base class for verbs Wrote `<Tag>` verb to do some basic testing * Add docstrings * Refactor `BxmlRoot` -> `Root` `BxmlVerb` -> `Verb` * Refactor tests for bxml base classes * Add `test_tag.py` to test `<Tag>` Also fixed some bugs in the base models causing test failures * Clean up tests to follow proper pytest convention Removed `lxml` from requirements Added base class tests * Add another test to add verbs during init of root * DX-2901, DX-2908, DX-2918 (#114) * DX-2901 `<PhoneNumber>` BXML Had to fix some bugs with the attributes in the `Verb` class Reordered arguments in the `Tag` class to match `Verb` * DX-2908 Refactor `<SipUri> BXML * DX-2918 Refactor `<Transfer>` BXML * Cleanup and update descriptions in docstrings * Fix WebRTC Utilities Test * import List type for Python < 3.9 https://stackoverflow.com/a/63460173/11633328 * Fix other `List` instances * Missed one `List` * Add `Union` to support multiple types in List * Construct verbs in alphabetical order to satisfy [email protected] tests * Alphabetize attributes dict for python3.7 * DX-2887 Refactor `<Bridge>` BXML * task/Update models to be python version agnostic (#115) * Update models to be python version agnostic Handling of different version behavior should be handled in the tests since the dict ordering behavior in 3.7 has no effect on how the backend handles the serialized xml. order of attributes is unimportant * Fix invalid syntax * Finish `<Bridge>` and test * DX-2899 * Update test_pause.py * DX-2898 Hangup Verb Refactor * Add `TerminalVerb` Class * Update terminal_verb.py * DX-2896 Refactor Forward Verb * Update test_hangup.py * DX-2887 Create `<Bridge>` BXML (#116) * DX-2887 Refactor `<Bridge>` BXML * Finish `<Bridge>` and test * Add `TerminalVerb` Class * Update terminal_verb.py * Make all class properties modifiable post init * Update terminal_verb.py * Cleanup TerminalVerb * Refactor for terminal verb * Update terminal_verb.py * Update hangup.py * Update __init__.py * Refactored due to addition of terminal verb * Refactored to take into account new terminal verb * DX-2903 Add `<Record>` BXML * Trigger Tests * Remove `inspect` * Refactor existing verbs for changes to `attributes` * Document attributes type * Make `attributes` property private * DX2897, DX2902, DX2909 * Update for Attribute Refactoring * Refactored attribute construction for update * refactored to include update to attributes constructor * Refactored due to change in attribute constructor * DX-2905 ResumeRecording * DX-2915 StopRecording Refactor * DX-2911 StartRecording Verb Refactored * Update test_start_recording.py * DX-2900 Add `<PauseRecording>` BXML (#120) * DX-2903 add `<Record>` BXML (#121) * DX-2903 Add `<Record>` BXML * Trigger Tests * Remove `inspect` * Refactor existing verbs for changes to `attributes` * Document attributes type * Make `attributes` property private * Fixed casing * Fixed casing * Update __init__.py * PauseRecording Update * DX-2906 Ring * DX-2907 Send DTMF * Update test_gather.py * Update pause_recording.py * DX-2910 * DX-2914 StopGather * DX-2895 * Update test_conference.py * Update conference.py * Update conference.py * DX2913, DX2916, DX2917 * Update test_start_stream.py * Apply suggestions from code review Co-authored-by: AJ Rice <[email protected]> * Update bandwidth/model/bxml/verbs/ring.py Co-authored-by: AJ Rice <[email protected]> * Update bandwidth/model/bxml/verbs/forward.py Co-authored-by: AJ Rice <[email protected]> * DX-2913, DX2916, DX2917 Updates and added stream param test * Quick updates * Updates to Forward * Update test_forward.py * DX-2904 `<Redirect>` BXML (#126) * DX-2904 `<Redirect>` BXML * Trigger Tests * Add param descriptions for `bridge.py` constructor * Correct BXML Unit Test Class names * DX-2935 Remove WebRTC (#134) * DX-2935 Remove WebRTC * Remove WebRTC Unit Tests & Utilities * Revert statistics api deletion remove sessions api remove tests * DRY Added one test to TerminalVerb base class and removed redundant ones to reduce repetition per @bpateldx's recommendation * Revert "DRY" This reverts commit 3ba082d. * DX-2855 Update BXML library (#133) * Set pause duration to be Int * Fix `Record.max_duration` * Update `ring.duration` and `ring.answer_call` test * Update int fields for `SendDtmf` * Fix Conference Not allowed to have nested verbs * Set `Gather` int properties to int * Set proper bool values for `StartRecording` * DRY * Fix `Ring` test * Task/fix bxml declaration bug (#135) * DX-2935 Remove WebRTC * Remove WebRTC Unit Tests & Utilities * Revert statistics api deletion remove sessions api remove tests * DRY Added one test to TerminalVerb base class and removed redundant ones to reduce repetition per @bpateldx's recommendation * Revert "DRY" This reverts commit 3ba082d. * Fix bug with xml declaration `utf8` causes an issue with the backend - `UTF-8` is valid Also updated the import statements so that users can declare `from bandwidth.model.bxml import Response` * Trigger Tests * Remove LXML dependency in `setup.py` * Drop Support for Python 3.7 * Fix tests from merge conflicts * Update Lookup integration tests. (#137) * Update Lookup integration tests. * Remove unneeded line_provider values. * Grab release version in `setup.py` from environment variable * DX-2981 Update package version in user agent (#140) * Update package version in user agent * `b1` * DX-2981 Add Beta Deployment Logic (#141) * DX-2933 Update PR Comment Action (#143) * DX-2933 Update PR Comment Action * add quotes * DX-3037 Update Description (#142) * Task: Stabilize Recording Test Timings (#147) * Sleep recording test to prevent timing failures. * Increase sleep timing for calls. * Add contingency retries for cleanup. * Task: Fix Recordings Tests (#148) * Sleep recording test to prevent timing failures. * Increase sleep timing for calls. * Add contingency retries for cleanup. * Use shared call cleanup for recordings tests. * Combined invalid tests for recordings operations. * Update for manteca content return type. * Decode test ids from bytes to string. * SWI-1997 Strip `_` from BXML keys that are reserved (#151) * SWI-2832 Migrate to OpenAPI Generator `v7.0.0` (#156) * Update bandwidth.yml * Regenerate with OpenAPI Generator 7.0.0 Fixed TN lookup Tests in this commit * Remove autogenerated linter workflow * Fix `_from` + test on Python 3.11 * more from stuff * Update Call Cleanup * remove type hint * Fix Media tests * Return asset path to original value * Fix MFA tests * Update test_recordings.py * Update test_calls.py * Update test_calls.py * Fix messages test * Attempt to fix some calls tests * More calls tests updates * Conferences test * More error fixes * More test fixes * more conference fixes * fix calls tests * Update test_calls.py * Update test_recordings.py * Update test_recordings.py * remove preload content * please work * Update test_recordings.py * Update test_recordings.py * Fix unit tests * SWI-3461 Update Ubuntu versions (#158) * SWI-2571 Start/Stop Transcription (#169) * SWI-2571 Add Start/Stop Transcription Verbs * Add unit tests * Elementree doesnt like bool values * Fix the tests * Add param descriptions * Remove workflow to test 2 different branches * Update test/unit/bxml/test_redirect.py Co-authored-by: Julia Januchowski <[email protected]> * Apply suggestion from code review --------- Co-authored-by: Brian <[email protected]> Co-authored-by: Bhavin Patel <[email protected]> Co-authored-by: Matthew Martin <[email protected]> Co-authored-by: Cameron Koegel <[email protected]> Co-authored-by: Brian <[email protected]> Co-authored-by: Julia Januchowski <[email protected]>
- Loading branch information