Skip to content

Commit

Permalink
SWI-5462 Update SDK Based on Recent Spec Changes (#205)
Browse files Browse the repository at this point in the history
* Generate SDK with OpenAPI Generator Version 7.4.0

* update workflows

* fix wf

* try one test

* copy them all

* remove all but init

* now remove the init

* bring it back

* move bxml

* move smoke

* clean up spaces

* update tests

* fix completedTime to be date-time

* include_optional

* update spec

* unit tests

* more unit tests

* unit tessssssssts

* final model unit tests

* move api unit tests

* SWI-4279 Fix BXML Library Anti Pattern (#206)

* fix verbs

* finish updating bxml library

* Update bandwidth/models/bxml/nestable_verb.py

Co-authored-by: AJ Rice <[email protected]>

---------

Co-authored-by: AJ Rice <[email protected]>

* SWI-5462 Add Real Time Transcriptions Tests (#207)

* add privacy field to calls api test

* remove unused env var

* update recordings smoke tests to use new method names

* add files for stats and transcriptions apis

* update smoke test header blocks

* add statistics smoke tests

* fill in skeleton of transcriptions test

* transcriptions

* 403 from manteca :(

* finalize transcriptions tests

* update smoke test wf

* only main

* fix tests hopefully

* SWI-5457 Prism Unit Tests (#209)

* SWI-5457 Prism Unit Tests

* calls, conferences, media, messages

* final unit tests

* run prism on unit tests

* only test models until base url can be updated

* bring back apis, we're waiting to update

* only test models for now

* SWI-5462 Update to Generator v7.6.0 (#210)

* SWI-5545 Update Transcription Model (#214)

* SWI-5545 Update Transcription Model

* remove models path from deploy tests

* generate using 7.7.0-SNAPSHOT

* remove old model

* update tests

* fix tests

* regenerate with 7.7.0

* unit test everything on PR

* small test updates

* bash shell

---------

Co-authored-by: DX-Bandwidth <[email protected]>
Co-authored-by: ckoegel <[email protected]>
Co-authored-by: Cameron Koegel <[email protected]>
Co-authored-by: AJ Rice <[email protected]>
  • Loading branch information
5 people authored Jul 8, 2024
1 parent e809982 commit 1bae9a5
Show file tree
Hide file tree
Showing 373 changed files with 9,360 additions and 4,332 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }}
steps:
- name: Set Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
Expand All @@ -57,7 +56,9 @@ jobs:
- name: Test
run: |
pytest -v
npm install -g @stoplight/prism-cli
prism mock ./bandwidth.yml & pytest -v ./test/unit
- name: Deploy to PYPI
run: |
Expand All @@ -68,7 +69,7 @@ jobs:
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

- uses: Bandwidth/[email protected]
if: always()
with:
Expand Down Expand Up @@ -100,7 +101,6 @@ jobs:
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }}
steps:
- name: Set Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
Expand All @@ -125,7 +125,9 @@ jobs:
- name: Test
run: |-
pytest -v
npm install -g @stoplight/prism-cli
prism mock ./bandwidth.yml & pytest -v ./test/unit
shell: bash

- name: Deploy to PYPI
run: |
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Test PR

on:
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
VZW_NUMBER: ${{ secrets.VZW_NUMBER }}
ATT_NUMBER: ${{ secrets.ATT_NUMBER }}
T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}

jobs:
test:
name: Test PR
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-latest]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
fail-fast: false
env:
PYTHON_VERSION: ${{ matrix.python-version }}
OPERATING_SYSTEM: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Packages
run: |
pip install -r requirements.txt
pip install -r test-requirements.txt
- name: Test at Warning Level
run: |
echo "Log level: WARNING"
npm install -g @stoplight/prism-cli
prism mock ./bandwidth.yml & pytest -v --log-cli-level=WARNING ./test/unit
shell: bash
92 changes: 92 additions & 0 deletions .github/workflows/test-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Smoke Tests

on:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
inputs:
logLevel:
description: Log level
required: false
default: WARNING
type: choice
options:
- WARNING
- DEBUG
pull_request:
branches:
- main
paths:
- 'test/smoke/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
VZW_NUMBER: ${{ secrets.VZW_NUMBER }}
ATT_NUMBER: ${{ secrets.ATT_NUMBER }}
T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}

jobs:
test:
name: Smoke Test
runs-on: ubuntu-latest
env:
PYTHON_VERSION: '3.12'
OPERATING_SYSTEM: ubuntu

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Packages
run: |
pip install -r requirements.txt
pip install -r test-requirements.txt
- name: Test at Debug Level
if: ${{ inputs.logLevel == 'DEBUG' }}
run: |
echo "Log level: DEBUG"
pytest -v --log-cli-level=DEBUG
shell: bash

- name: Test at Warning Level
if: ${{( inputs.logLevel == null) || ( inputs.logLevel == 'WARNING') }}
run: |
echo "Log level: WARNING"
pytest -v --log-cli-level=WARNING ./test/smoke
shell: bash

notify_for_failures:
name: Notify for Failures
needs: [test]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Slack of Failures
uses: Bandwidth/[email protected]
with:
job-status: failure
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}
92 changes: 0 additions & 92 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ __pycache__/
# C extensions
*.so

# MacOS Files
# MacOS Files
.DS_Store

# Distribution / packaging
Expand Down
22 changes: 16 additions & 6 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ bandwidth/api/mfa_api.py
bandwidth/api/phone_number_lookup_api.py
bandwidth/api/recordings_api.py
bandwidth/api/statistics_api.py
bandwidth/api/transcriptions_api.py
bandwidth/api_client.py
bandwidth/api_response.py
bandwidth/configuration.py
Expand All @@ -24,6 +25,11 @@ bandwidth/models/call_direction_enum.py
bandwidth/models/call_recording_metadata.py
bandwidth/models/call_state.py
bandwidth/models/call_state_enum.py
bandwidth/models/call_transcription.py
bandwidth/models/call_transcription_detected_language_enum.py
bandwidth/models/call_transcription_metadata.py
bandwidth/models/call_transcription_response.py
bandwidth/models/call_transcription_track_enum.py
bandwidth/models/callback_method_enum.py
bandwidth/models/code_request.py
bandwidth/models/conference.py
Expand Down Expand Up @@ -83,6 +89,8 @@ bandwidth/models/priority_enum.py
bandwidth/models/recording_available_callback.py
bandwidth/models/recording_complete_callback.py
bandwidth/models/recording_state_enum.py
bandwidth/models/recording_transcription_metadata.py
bandwidth/models/recording_transcriptions.py
bandwidth/models/redirect_callback.py
bandwidth/models/redirect_method_enum.py
bandwidth/models/stir_shaken.py
Expand All @@ -91,8 +99,6 @@ bandwidth/models/tn_lookup_request_error.py
bandwidth/models/transcribe_recording.py
bandwidth/models/transcription.py
bandwidth/models/transcription_available_callback.py
bandwidth/models/transcription_list.py
bandwidth/models/transcription_metadata.py
bandwidth/models/transfer_answer_callback.py
bandwidth/models/transfer_complete_callback.py
bandwidth/models/transfer_disconnect_callback.py
Expand All @@ -114,6 +120,11 @@ docs/CallDirectionEnum.md
docs/CallRecordingMetadata.md
docs/CallState.md
docs/CallStateEnum.md
docs/CallTranscription.md
docs/CallTranscriptionDetectedLanguageEnum.md
docs/CallTranscriptionMetadata.md
docs/CallTranscriptionResponse.md
docs/CallTranscriptionTrackEnum.md
docs/CallbackMethodEnum.md
docs/CallsApi.md
docs/CodeRequest.md
Expand Down Expand Up @@ -179,6 +190,8 @@ docs/PriorityEnum.md
docs/RecordingAvailableCallback.md
docs/RecordingCompleteCallback.md
docs/RecordingStateEnum.md
docs/RecordingTranscriptionMetadata.md
docs/RecordingTranscriptions.md
docs/RecordingsApi.md
docs/RedirectCallback.md
docs/RedirectMethodEnum.md
Expand All @@ -189,8 +202,7 @@ docs/TnLookupRequestError.md
docs/TranscribeRecording.md
docs/Transcription.md
docs/TranscriptionAvailableCallback.md
docs/TranscriptionList.md
docs/TranscriptionMetadata.md
docs/TranscriptionsApi.md
docs/TransferAnswerCallback.md
docs/TransferCompleteCallback.md
docs/TransferDisconnectCallback.md
Expand All @@ -204,7 +216,5 @@ docs/VoiceApiError.md
docs/VoiceCodeResponse.md
git_push.sh
pyproject.toml
requirements.txt
setup.py
test-requirements.txt
tox.ini
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.4.0
7.7.0
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
License:
License:
========
The MIT License (MIT)
http://opensource.org/licenses/MIT
Expand All @@ -25,4 +25,4 @@ THE SOFTWARE.

Trade Mark:
==========
APIMATIC is a trade mark for APIMATIC Limited
APIMATIC is a trade mark for APIMATIC Limited
Loading

0 comments on commit 1bae9a5

Please sign in to comment.